Search in sources :

Example 1 with EncryptionPage

use of pageobjects.EncryptionPage 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)

Aggregations

URL (java.net.URL)1 Test (org.junit.Test)1 EncryptionPage (pageobjects.EncryptionPage)1 Navigation (pageobjects.Navigation)1