コード例 #1
0
  private void assertVersions(ProjectVersionsPage page, int versionsCount, String[] versionNames) {
    assertThat(page.getNumberOfDisplayedVersions())
        .isEqualTo(versionsCount)
        .as("The version count is " + versionsCount);

    assertThat(page.getVersions()).contains(versionNames).as("The versions are correct");
  }
コード例 #2
0
  @Feature(
      summary = "The user can filter project versions by name",
      tcmsTestPlanIds = 5316,
      tcmsTestCaseIds = 0)
  @Ignore("dodgy test (intermittent timeout)")
  @Test(timeout = ZanataTestCase.MAX_SHORT_TEST_DURATION)
  public void versionSearchFiltering() throws Exception {
    String projectName = "versionsearchnums";
    zanataRestCaller =
        new ZanataRestCaller(
            "translator", PropertiesHolder.getProperty(Constants.zanataTranslatorKey.value()));
    zanataRestCaller.createProjectAndVersion(projectName, "alpha", "file");
    zanataRestCaller.createProjectAndVersion(projectName, "bravo", "file");

    assertThat(new LoginWorkFlow().signIn("translator", "translator").loggedInAs())
        .isEqualTo("translator")
        .as("Login as translator");

    ProjectVersionsPage projectVersionsPage =
        new ProjectWorkFlow().goToProjectByName(projectName).expectDisplayedVersions(2);

    assertVersions(projectVersionsPage, 2, new String[] {"bravo", "alpha"});

    projectVersionsPage =
        projectVersionsPage
            .clickSearchIcon()
            .enterVersionSearch("alpha")
            .expectDisplayedVersions(1);

    assertVersions(projectVersionsPage, 1, new String[] {"alpha"});

    projectVersionsPage = projectVersionsPage.clearVersionSearch().expectDisplayedVersions(2);

    assertVersions(projectVersionsPage, 2, new String[] {"bravo", "alpha"});

    projectVersionsPage =
        projectVersionsPage.enterVersionSearch("bravo").expectDisplayedVersions(1);

    assertVersions(projectVersionsPage, 1, new String[] {"bravo"});

    projectVersionsPage.waitForPageSilence();
    projectVersionsPage =
        projectVersionsPage
            .clearVersionSearch()
            .enterVersionSearch("charlie")
            .expectDisplayedVersions(0);

    assertVersions(projectVersionsPage, 0, new String[] {});

    projectVersionsPage.waitForPageSilence();
    projectVersionsPage = projectVersionsPage.clearVersionSearch().expectDisplayedVersions(2);

    assertVersions(projectVersionsPage, 2, new String[] {"bravo", "alpha"});
  }