Search in sources :

Example 1 with ProjectQualityGatePage

use of pageobjects.ProjectQualityGatePage in project sonarqube by SonarSource.

the class ProjectQualityGatePageTest method should_set_default.

@Test
public void should_set_default() {
    QualityGate customQualityGate = createCustomQualityGate("should_set_default");
    qualityGateClient().setDefault(customQualityGate.id());
    ProjectQualityGatePage page = openPage();
    page.setQualityGate(customQualityGate.name());
    SelenideElement selectedQualityGate = page.getSelectedQualityGate();
    selectedQualityGate.should(Condition.hasText("Default"));
    selectedQualityGate.should(Condition.hasText(customQualityGate.name()));
}
Also used : SelenideElement(com.codeborne.selenide.SelenideElement) ProjectQualityGatePage(pageobjects.ProjectQualityGatePage) QualityGate(org.sonar.wsclient.qualitygate.QualityGate) Test(org.junit.Test)

Example 2 with ProjectQualityGatePage

use of pageobjects.ProjectQualityGatePage in project sonarqube by SonarSource.

the class ProjectQualityGatePageTest method should_set_custom.

@Test
public void should_set_custom() {
    QualityGate customQualityGate = createCustomQualityGate("should_set_custom");
    ProjectQualityGatePage page = openPage();
    page.setQualityGate(customQualityGate.name());
    SelenideElement selectedQualityGate = page.getSelectedQualityGate();
    selectedQualityGate.should(Condition.hasText(customQualityGate.name()));
}
Also used : SelenideElement(com.codeborne.selenide.SelenideElement) ProjectQualityGatePage(pageobjects.ProjectQualityGatePage) QualityGate(org.sonar.wsclient.qualitygate.QualityGate) Test(org.junit.Test)

Example 3 with ProjectQualityGatePage

use of pageobjects.ProjectQualityGatePage in project sonarqube by SonarSource.

the class ProjectQualityGatePageTest method should_display_none.

@Test
public void should_display_none() {
    qualityGateClient().unsetDefault();
    ProjectQualityGatePage page = openPage();
    page.assertNotSelected();
}
Also used : ProjectQualityGatePage(pageobjects.ProjectQualityGatePage) Test(org.junit.Test)

Example 4 with ProjectQualityGatePage

use of pageobjects.ProjectQualityGatePage in project sonarqube by SonarSource.

the class ProjectQualityGatePageTest method should_display_custom.

@Test
public void should_display_custom() {
    QualityGate customQualityGate = createCustomQualityGate("should_display_custom");
    associateWithQualityGate(customQualityGate);
    ProjectQualityGatePage page = openPage();
    SelenideElement selectedQualityGate = page.getSelectedQualityGate();
    selectedQualityGate.shouldNot(Condition.hasText("Default"));
    selectedQualityGate.should(Condition.hasText(customQualityGate.name()));
}
Also used : SelenideElement(com.codeborne.selenide.SelenideElement) ProjectQualityGatePage(pageobjects.ProjectQualityGatePage) QualityGate(org.sonar.wsclient.qualitygate.QualityGate) Test(org.junit.Test)

Example 5 with ProjectQualityGatePage

use of pageobjects.ProjectQualityGatePage in project sonarqube by SonarSource.

the class ProjectQualityGatePageTest method should_set_none.

@Test
@Ignore("find a way to select None")
public void should_set_none() {
    qualityGateClient().unsetDefault();
    QualityGate customQualityGate = createCustomQualityGate("should_set_none");
    associateWithQualityGate(customQualityGate);
    ProjectQualityGatePage page = openPage();
    page.setQualityGate("");
    page.assertNotSelected();
}
Also used : ProjectQualityGatePage(pageobjects.ProjectQualityGatePage) QualityGate(org.sonar.wsclient.qualitygate.QualityGate) Ignore(org.junit.Ignore) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)6 ProjectQualityGatePage (pageobjects.ProjectQualityGatePage)6 QualityGate (org.sonar.wsclient.qualitygate.QualityGate)5 SelenideElement (com.codeborne.selenide.SelenideElement)4 Ignore (org.junit.Ignore)1