diff options
author | Grégoire Aubert <gregoire.aubert@sonarsource.com> | 2018-02-02 16:29:10 +0100 |
---|---|---|
committer | Guillaume Jambet <guillaume.jambet@gmail.com> | 2018-03-01 15:21:05 +0100 |
commit | 85f7f977c021ea177d3f2442efa114997e313aa2 (patch) | |
tree | 365e7cc53253a906d205bd207391072c52009695 /server/sonar-qa-util | |
parent | 21b4be2173e36fef157e46582060e265edb1bf45 (diff) | |
download | sonarqube-85f7f977c021ea177d3f2442efa114997e313aa2.tar.gz sonarqube-85f7f977c021ea177d3f2442efa114997e313aa2.zip |
SONAR-10344 Create IT's for webhooks console page
Diffstat (limited to 'server/sonar-qa-util')
-rw-r--r-- | server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/pageobjects/Navigation.java | 12 | ||||
-rw-r--r-- | server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/pageobjects/WebhooksPage.java | 48 |
2 files changed, 60 insertions, 0 deletions
diff --git a/server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/pageobjects/Navigation.java b/server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/pageobjects/Navigation.java index ede43929a06..073df461b8b 100644 --- a/server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/pageobjects/Navigation.java +++ b/server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/pageobjects/Navigation.java @@ -202,6 +202,18 @@ public class Navigation { return open("/organizations/" + orgKey + "/projects_management", ProjectsManagementPage.class); } + public WebhooksPage openWebhooks() { + return open("/admin/webhooks", WebhooksPage.class); + } + + public WebhooksPage openOrganizationWebhooks(String orgKey) { + return open("/organizations/" + orgKey + "/webhooks", WebhooksPage.class); + } + + public WebhooksPage openProjectWebhooks(String projectKey) { + return open("/project/webhooks?id="+ projectKey, WebhooksPage.class); + } + public LoginPage openLogin() { return open("/sessions/login", LoginPage.class); } diff --git a/server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/pageobjects/WebhooksPage.java b/server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/pageobjects/WebhooksPage.java new file mode 100644 index 00000000000..af6c8c6f816 --- /dev/null +++ b/server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/pageobjects/WebhooksPage.java @@ -0,0 +1,48 @@ +/* + * SonarQube + * Copyright (C) 2009-2018 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +package org.sonarqube.qa.util.pageobjects; + +import com.codeborne.selenide.ElementsCollection; + +import static com.codeborne.selenide.Condition.exist; +import static com.codeborne.selenide.Condition.text; +import static com.codeborne.selenide.Selenide.$; +import static com.codeborne.selenide.Selenide.$$; + +public class WebhooksPage { + + public WebhooksPage() { + $(".page-header .page-title").should(exist).shouldHave(text("Webhooks")); + } + + public WebhooksPage hasWebhook(String text) { + getWebhooks().find(text(text)).should(exist); + return this; + } + + public WebhooksPage countWebhooks(Integer number) { + getWebhooks().shouldHaveSize(number); + return this; + } + + private static ElementsCollection getWebhooks() { + return $$(".boxed-group tbody tr"); + } +} |