From 87ca6669cd77f57d0621c70e53adaa42350ff128 Mon Sep 17 00:00:00 2001 From: Grégoire Aubert Date: Thu, 8 Feb 2018 15:38:53 +0100 Subject: SONAR-10347 Create a BoxedGroupAccordion component and use it in system page --- .../qa/util/pageobjects/SystemInfoPage.java | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'server/sonar-qa-util') diff --git a/server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/pageobjects/SystemInfoPage.java b/server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/pageobjects/SystemInfoPage.java index 9c9802e7e7f..857153eb517 100644 --- a/server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/pageobjects/SystemInfoPage.java +++ b/server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/pageobjects/SystemInfoPage.java @@ -21,26 +21,28 @@ package org.sonarqube.qa.util.pageobjects; import com.codeborne.selenide.CollectionCondition; import com.codeborne.selenide.Condition; -import com.codeborne.selenide.Selenide; +import com.codeborne.selenide.ElementsCollection; import com.codeborne.selenide.SelenideElement; +import static com.codeborne.selenide.Selenide.$; +import static com.codeborne.selenide.Selenide.$$; + public class SystemInfoPage { public SystemInfoPage() { - Selenide.$(".page-title").should(Condition.exist).shouldHave(Condition.text("System Info")); - } - - public SystemInfoPage shouldHaveCard(String title) { - Selenide.$$(".system-info-health-card-title").find(Condition.text(title)).should(Condition.exist); - return this; + $(".page-title").should(Condition.exist).shouldHave(Condition.text("System Info")); } public SystemInfoPage shouldHaveCards(String... titles) { - Selenide.$$(".system-info-health-card-title").shouldHave(CollectionCondition.texts(titles)); + getHealthCards().shouldHave(CollectionCondition.texts(titles)); return this; } public SystemInfoPageItem getCardItem(String card) { - SelenideElement cardTitle = Selenide.$$(".system-info-health-card-title").find(Condition.text(card)).should(Condition.exist); + SelenideElement cardTitle = getHealthCards().find(Condition.text(card)).should(Condition.exist); return new SystemInfoPageItem(cardTitle.parent().parent()); } + + private static ElementsCollection getHealthCards() { + return $$(".boxed-group-accordion-title"); + } } -- cgit v1.2.3