diff options
author | Grégoire Aubert <gregoire.aubert@sonarsource.com> | 2018-04-04 12:18:22 +0200 |
---|---|---|
committer | SonarTech <sonartech@sonarsource.com> | 2018-04-04 20:28:01 +0200 |
commit | 0602abbaae52104ab39087ae29efd6ea2ab45cb7 (patch) | |
tree | 7c9cf36fee28b52b9431341b46afeddac37ffda7 /server/sonar-qa-util | |
parent | 6ab3e013a2cc0f3c90c6cff8f89ab015977a561f (diff) | |
download | sonarqube-0602abbaae52104ab39087ae29efd6ea2ab45cb7.tar.gz sonarqube-0602abbaae52104ab39087ae29efd6ea2ab45cb7.zip |
Fix Quality Gate create form
Diffstat (limited to 'server/sonar-qa-util')
-rw-r--r-- | server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/pageobjects/QualityGatePage.java | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/pageobjects/QualityGatePage.java b/server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/pageobjects/QualityGatePage.java index 480b4bdb357..94e73a0451c 100644 --- a/server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/pageobjects/QualityGatePage.java +++ b/server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/pageobjects/QualityGatePage.java @@ -19,36 +19,47 @@ */ package org.sonarqube.qa.util.pageobjects; -import com.codeborne.selenide.Condition; -import com.codeborne.selenide.Selenide; +import static com.codeborne.selenide.Condition.exist; +import static com.codeborne.selenide.Condition.text; +import static com.codeborne.selenide.Condition.visible; +import static com.codeborne.selenide.Selenide.$; +import static com.codeborne.selenide.Selenide.$$; public class QualityGatePage { public QualityGatePage() { - Selenide.$("#quality-gates-page").shouldBe(Condition.visible); + $("#quality-gates-page").shouldBe(visible); } public QualityGatePage countQualityGates(Integer count) { - Selenide.$$("#quality-gates-page .list-group-item").shouldHaveSize(count); + $$("#quality-gates-page .list-group-item").shouldHaveSize(count); return this; } public QualityGatePage canCreateQG() { - Selenide.$("#quality-gate-add").should(Condition.exist).shouldBe(Condition.visible); + $("#quality-gate-add").should(exist).shouldBe(visible); + return this; + } + + public QualityGatePage createQG(String name) { + $("#quality-gate-add").click(); + $(".modal-head").should(exist).shouldHave(text("Create Quality Gate")); + $("#quality-gate-form-name").sendKeys(name); + $(".js-confirm").click(); return this; } public QualityGatePage canNotCreateQG() { - Selenide.$("#quality-gate-add").shouldNot(Condition.exist); + $("#quality-gate-add").shouldNot(exist); return this; } public QualityGatePage displayIntro() { - Selenide.$(".search-navigator-intro").should(Condition.exist).shouldBe(Condition.visible); + $(".search-navigator-intro").should(exist).shouldBe(visible); return this; } public QualityGatePage displayQualityGateDetail(String qualityGateName) { - Selenide.$(".layout-page-main-header").shouldHave(Condition.text(qualityGateName)); + $(".layout-page-main-header").shouldHave(text(qualityGateName)); return this; } } |