Search in sources :

Example 1 with Navigation

use of pageobjects.Navigation in project sonarqube by SonarSource.

the class QualityProfilesPageTest method testNotFound.

@Test
public void testNotFound() {
    Navigation nav = Navigation.get(orchestrator);
    nav.open("/profiles/show?key=unknown");
    $(".quality-profile-not-found").should(Condition.visible);
}
Also used : Navigation(pageobjects.Navigation) Test(org.junit.Test)

Example 2 with Navigation

use of pageobjects.Navigation in project sonarqube by SonarSource.

the class SettingsTestRestartingOrchestrator method test_settings.

@Test
public void test_settings() throws UnsupportedEncodingException {
    URL secretKeyUrl = getClass().getResource("/settings/SettingsTest/sonar-secret.txt");
    orchestrator = Orchestrator.builderEnv().addPlugin(pluginArtifact("settings-plugin")).addPlugin(pluginArtifact("license-plugin")).setServerProperty("sonar.secretKeyPath", secretKeyUrl.getFile()).build();
    orchestrator.start();
    Navigation nav = Navigation.get(orchestrator).openHomepage().logIn().asAdmin();
    nav.openSettings(null).assertMenuContains("General").assertSettingDisplayed("sonar.dbcleaner.cleanDirectory").assertSettingNotDisplayed("settings.extension.hidden").assertSettingNotDisplayed("settings.extension.global");
    EncryptionPage encryptionPage = nav.openEncryption();
    assertThat(encryptionPage.encryptValue("clear")).isEqualTo("{aes}4aQbfYe1lrEjiRzv/ETbyg==");
    encryptionPage.generateNewKey();
    encryptionPage.generationForm().shouldBe(visible).submit();
    encryptionPage.generationForm().shouldNotBe(visible);
    encryptionPage.newSecretKey().shouldBe(visible);
}
Also used : Navigation(pageobjects.Navigation) EncryptionPage(pageobjects.EncryptionPage) URL(java.net.URL) Test(org.junit.Test)

Example 3 with Navigation

use of pageobjects.Navigation in project sonarqube by SonarSource.

the class LocalAuthenticationTest method log_in_with_correct_credentials_then_log_out.

@Test
public void log_in_with_correct_credentials_then_log_out() {
    nav.shouldNotBeLoggedIn();
    Navigation page = nav.logIn().submitCredentials(LOGIN, "123456");
    page.getRightBar().shouldHave(Condition.text(LOGIN));
    nav.shouldBeLoggedIn();
    nav.logOut();
    nav.shouldNotBeLoggedIn();
}
Also used : Navigation(pageobjects.Navigation) Test(org.junit.Test)

Example 4 with Navigation

use of pageobjects.Navigation in project sonarqube by SonarSource.

the class ProjectDashboardTest method display_a_nice_error_when_requesting_unknown_project.

@Test
@Ignore("there is no more place to show the error")
public void display_a_nice_error_when_requesting_unknown_project() {
    Navigation nav = Navigation.get(orchestrator);
    nav.open("/dashboard/index?id=unknown");
    nav.getErrorMessage().should(text("The requested project does not exist. Either it has never been analyzed successfully or it has been deleted."));
// TODO verify that on global homepage
}
Also used : Navigation(pageobjects.Navigation) Ignore(org.junit.Ignore) Test(org.junit.Test)

Example 5 with Navigation

use of pageobjects.Navigation in project sonarqube by SonarSource.

the class ProjectDashboardTest method display_size.

@Test
public void display_size() {
    executeBuild("shared/xoo-sample", "sample", "Sample");
    Navigation nav = Navigation.get(orchestrator);
    ProjectDashboardPage page = nav.openProjectDashboard("sample");
    page.getLinesOfCode().should(hasText("13"));
    page.getLanguageDistribution().should(hasText("Xoo"), hasText("13"));
}
Also used : Navigation(pageobjects.Navigation) ProjectDashboardPage(pageobjects.ProjectDashboardPage) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)7 Navigation (pageobjects.Navigation)7 URL (java.net.URL)1 Ignore (org.junit.Ignore)1 EncryptionPage (pageobjects.EncryptionPage)1 ProjectDashboardPage (pageobjects.ProjectDashboardPage)1 ServerIdPage (pageobjects.ServerIdPage)1