]> source.dussan.org Git - sonarqube.git/commitdiff
Move pageobjects to new module sonar-qa-util
authorSimon Brandhof <simon.brandhof@sonarsource.com>
Thu, 9 Nov 2017 15:58:27 +0000 (16:58 +0100)
committerEric Hartmann <hartmann.eric@gmail.Com>
Tue, 14 Nov 2017 12:10:17 +0000 (13:10 +0100)
114 files changed:
server/pom.xml
server/sonar-qa-util/pom.xml [new file with mode: 0644]
server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/SelenideConfig.java [new file with mode: 0644]
server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/package-info.java [new file with mode: 0644]
server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/pageobjects/BackgroundTaskItem.java [new file with mode: 0644]
server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/pageobjects/BackgroundTasksPage.java [new file with mode: 0644]
server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/pageobjects/EncryptionPage.java [new file with mode: 0644]
server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/pageobjects/LoginPage.java [new file with mode: 0644]
server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/pageobjects/MarketplacePage.java [new file with mode: 0644]
server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/pageobjects/Navigation.java [new file with mode: 0644]
server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/pageobjects/NotificationsPage.java [new file with mode: 0644]
server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/pageobjects/ProjectActivityPage.java [new file with mode: 0644]
server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/pageobjects/ProjectAnalysisItem.java [new file with mode: 0644]
server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/pageobjects/ProjectCodePage.java [new file with mode: 0644]
server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/pageobjects/ProjectDashboardPage.java [new file with mode: 0644]
server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/pageobjects/ProjectKeyPage.java [new file with mode: 0644]
server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/pageobjects/ProjectLinkItem.java [new file with mode: 0644]
server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/pageobjects/ProjectLinksPage.java [new file with mode: 0644]
server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/pageobjects/ProjectPermissionsPage.java [new file with mode: 0644]
server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/pageobjects/ProjectQualityGatePage.java [new file with mode: 0644]
server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/pageobjects/ProjectsManagementPage.java [new file with mode: 0644]
server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/pageobjects/QualityGatePage.java [new file with mode: 0644]
server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/pageobjects/QualityProfilePage.java [new file with mode: 0644]
server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/pageobjects/RuleDetails.java [new file with mode: 0644]
server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/pageobjects/RuleItem.java [new file with mode: 0644]
server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/pageobjects/RulesPage.java [new file with mode: 0644]
server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/pageobjects/SystemInfoPage.java [new file with mode: 0644]
server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/pageobjects/SystemInfoPageItem.java [new file with mode: 0644]
server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/pageobjects/issues/Issue.java [new file with mode: 0644]
server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/pageobjects/issues/IssuesPage.java [new file with mode: 0644]
server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/pageobjects/measures/MeasureContent.java [new file with mode: 0644]
server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/pageobjects/measures/MeasuresPage.java [new file with mode: 0644]
server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/pageobjects/organization/MemberItem.java [new file with mode: 0644]
server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/pageobjects/organization/MembersPage.java [new file with mode: 0644]
server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/pageobjects/package-info.java [new file with mode: 0644]
server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/pageobjects/projects/FacetItem.java [new file with mode: 0644]
server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/pageobjects/projects/ProjectItem.java [new file with mode: 0644]
server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/pageobjects/projects/ProjectsPage.java [new file with mode: 0644]
server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/pageobjects/settings/PropertySetInput.java [new file with mode: 0644]
server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/pageobjects/settings/SettingsPage.java [new file with mode: 0644]
tests/pom.xml
tests/src/test/java/org/sonarqube/pageobjects/BackgroundTaskItem.java [deleted file]
tests/src/test/java/org/sonarqube/pageobjects/BackgroundTasksPage.java [deleted file]
tests/src/test/java/org/sonarqube/pageobjects/EncryptionPage.java [deleted file]
tests/src/test/java/org/sonarqube/pageobjects/LoginPage.java [deleted file]
tests/src/test/java/org/sonarqube/pageobjects/MarketplacePage.java [deleted file]
tests/src/test/java/org/sonarqube/pageobjects/Navigation.java [deleted file]
tests/src/test/java/org/sonarqube/pageobjects/NotificationsPage.java [deleted file]
tests/src/test/java/org/sonarqube/pageobjects/ProjectActivityPage.java [deleted file]
tests/src/test/java/org/sonarqube/pageobjects/ProjectAnalysisItem.java [deleted file]
tests/src/test/java/org/sonarqube/pageobjects/ProjectCodePage.java [deleted file]
tests/src/test/java/org/sonarqube/pageobjects/ProjectDashboardPage.java [deleted file]
tests/src/test/java/org/sonarqube/pageobjects/ProjectKeyPage.java [deleted file]
tests/src/test/java/org/sonarqube/pageobjects/ProjectLinkItem.java [deleted file]
tests/src/test/java/org/sonarqube/pageobjects/ProjectLinksPage.java [deleted file]
tests/src/test/java/org/sonarqube/pageobjects/ProjectPermissionsPage.java [deleted file]
tests/src/test/java/org/sonarqube/pageobjects/ProjectQualityGatePage.java [deleted file]
tests/src/test/java/org/sonarqube/pageobjects/ProjectsManagementPage.java [deleted file]
tests/src/test/java/org/sonarqube/pageobjects/QualityGatePage.java [deleted file]
tests/src/test/java/org/sonarqube/pageobjects/QualityProfilePage.java [deleted file]
tests/src/test/java/org/sonarqube/pageobjects/RuleDetails.java [deleted file]
tests/src/test/java/org/sonarqube/pageobjects/RuleItem.java [deleted file]
tests/src/test/java/org/sonarqube/pageobjects/RulesPage.java [deleted file]
tests/src/test/java/org/sonarqube/pageobjects/SelenideConfig.java [deleted file]
tests/src/test/java/org/sonarqube/pageobjects/SystemInfoPage.java [deleted file]
tests/src/test/java/org/sonarqube/pageobjects/SystemInfoPageItem.java [deleted file]
tests/src/test/java/org/sonarqube/pageobjects/issues/Issue.java [deleted file]
tests/src/test/java/org/sonarqube/pageobjects/issues/IssuesPage.java [deleted file]
tests/src/test/java/org/sonarqube/pageobjects/measures/MeasureContent.java [deleted file]
tests/src/test/java/org/sonarqube/pageobjects/measures/MeasuresPage.java [deleted file]
tests/src/test/java/org/sonarqube/pageobjects/organization/MemberItem.java [deleted file]
tests/src/test/java/org/sonarqube/pageobjects/organization/MembersPage.java [deleted file]
tests/src/test/java/org/sonarqube/pageobjects/projects/FacetItem.java [deleted file]
tests/src/test/java/org/sonarqube/pageobjects/projects/ProjectItem.java [deleted file]
tests/src/test/java/org/sonarqube/pageobjects/projects/ProjectsPage.java [deleted file]
tests/src/test/java/org/sonarqube/pageobjects/settings/PropertySetInput.java [deleted file]
tests/src/test/java/org/sonarqube/pageobjects/settings/SettingsPage.java [deleted file]
tests/src/test/java/org/sonarqube/tests/Tester.java
tests/src/test/java/org/sonarqube/tests/issue/IssuesPageTest.java
tests/src/test/java/org/sonarqube/tests/issue/OrganizationIssueAssignTest.java
tests/src/test/java/org/sonarqube/tests/issue/OrganizationIssuesPageTest.java
tests/src/test/java/org/sonarqube/tests/marketplace/UpdateCenterTest.java
tests/src/test/java/org/sonarqube/tests/measure/DifferentialPeriodsTest.java
tests/src/test/java/org/sonarqube/tests/measure/ProjectDashboardTest.java
tests/src/test/java/org/sonarqube/tests/measure/ProjectMeasuresPageTest.java
tests/src/test/java/org/sonarqube/tests/organization/BillingTest.java
tests/src/test/java/org/sonarqube/tests/organization/OrganizationMembershipUiTest.java
tests/src/test/java/org/sonarqube/tests/projectAdministration/BackgroundTasksTest.java
tests/src/test/java/org/sonarqube/tests/projectAdministration/ProjectAdministrationTest.java
tests/src/test/java/org/sonarqube/tests/projectAdministration/ProjectKeyUpdatePageTest.java
tests/src/test/java/org/sonarqube/tests/projectAdministration/ProjectLinksPageTest.java
tests/src/test/java/org/sonarqube/tests/projectAdministration/ProjectPermissionsTest.java
tests/src/test/java/org/sonarqube/tests/projectAdministration/ProjectQualityGatePageTest.java
tests/src/test/java/org/sonarqube/tests/projectAdministration/ProjectVisibilityPageTest.java
tests/src/test/java/org/sonarqube/tests/projectEvent/ProjectActivityPageTest.java
tests/src/test/java/org/sonarqube/tests/projectSearch/LeakProjectsPageTest.java
tests/src/test/java/org/sonarqube/tests/projectSearch/ProjectsPageTest.java
tests/src/test/java/org/sonarqube/tests/qualityGate/OrganizationQualityGateUiTest.java
tests/src/test/java/org/sonarqube/tests/qualityGate/QualityGateUiTest.java
tests/src/test/java/org/sonarqube/tests/qualityProfile/OrganizationQualityProfilesUiTest.java
tests/src/test/java/org/sonarqube/tests/qualityProfile/QualityProfilesUiTest.java
tests/src/test/java/org/sonarqube/tests/rule/RulesPageTest.java
tests/src/test/java/org/sonarqube/tests/serverSystem/SystemInfoTest.java
tests/src/test/java/org/sonarqube/tests/settings/PropertySetsTest.java
tests/src/test/java/org/sonarqube/tests/settings/SettingsTestRestartingOrchestrator.java
tests/src/test/java/org/sonarqube/tests/ui/SourceViewerTest.java
tests/src/test/java/org/sonarqube/tests/ui/UiTest.java
tests/src/test/java/org/sonarqube/tests/user/BaseIdentityProviderTest.java
tests/src/test/java/org/sonarqube/tests/user/ForceAuthenticationTest.java
tests/src/test/java/org/sonarqube/tests/user/LocalAuthenticationTest.java
tests/src/test/java/org/sonarqube/tests/user/MyAccountPageTest.java
tests/src/test/java/org/sonarqube/tests/user/OAuth2IdentityProviderTest.java
tests/src/test/java/org/sonarqube/tests/user/RealmAuthenticationTest.java
tests/src/test/java/util/selenium/SeleneseRunner.java

index 99a700f2a58569011e9cb752859f34cc5faa61b9..5b27942fb00a2b0cb90fdcb6d8f0fa773a7fb258 100644 (file)
@@ -23,6 +23,7 @@
     <module>sonar-ce</module>
     <module>sonar-plugin-bridge</module>
     <module>sonar-web</module>
+    <module>sonar-qa-util</module>
   </modules>
 
   <profiles>
diff --git a/server/sonar-qa-util/pom.xml b/server/sonar-qa-util/pom.xml
new file mode 100644 (file)
index 0000000..a953433
--- /dev/null
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>org.sonarsource.sonarqube</groupId>
+    <artifactId>server</artifactId>
+    <version>7.0-SNAPSHOT</version>
+    <relativePath>..</relativePath>
+  </parent>
+  <artifactId>sonar-qa-util</artifactId>
+  <name>SonarQube :: Utilities for QA Tests</name>
+
+  <properties>
+    <sonar.coverage.exclusions>src/main/java/**/*</sonar.coverage.exclusions>
+  </properties>
+
+  <dependencies>
+    <dependency>
+      <groupId>com.codeborne</groupId>
+      <artifactId>selenide</artifactId>
+      <version>4.4.3</version>
+    </dependency>
+    <dependency>
+      <groupId>org.assertj</groupId>
+      <artifactId>assertj-core</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.sonarsource.orchestrator</groupId>
+      <artifactId>sonar-orchestrator</artifactId>
+      <version>${orchestrator.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>com.google.guava</groupId>
+      <artifactId>guava</artifactId>
+      <!-- required for selenide -->
+      <version>21.0</version>
+    </dependency>
+
+    <dependency>
+      <groupId>com.google.code.findbugs</groupId>
+      <artifactId>jsr305</artifactId>
+      <scope>provided</scope>
+    </dependency>
+  </dependencies>
+
+</project>
diff --git a/server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/SelenideConfig.java b/server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/SelenideConfig.java
new file mode 100644 (file)
index 0000000..155ded5
--- /dev/null
@@ -0,0 +1,70 @@
+/*
+ * SonarQube
+ * Copyright (C) 2009-2017 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;
+
+import com.codeborne.selenide.Configuration;
+import com.codeborne.selenide.WebDriverRunner;
+import com.sonar.orchestrator.Orchestrator;
+import java.util.stream.Collectors;
+import org.openqa.selenium.WebDriver;
+
+import static java.util.Arrays.stream;
+
+public class SelenideConfig {
+
+  private enum Browser {
+    firefox("(v46 and lower)"),
+    marionette("(recent Firefox, require Geckodriver)"),
+    chrome("(require Chromedriver)");
+
+    private final String label;
+
+    Browser(String label) {
+      this.label = label;
+    }
+
+    static Browser of(String s) {
+      try {
+        return Browser.valueOf(s);
+      } catch (Exception e) {
+        throw new IllegalArgumentException("Invalid browser: " + s + ". Supported values are " +
+          stream(values()).map(b -> b.name() + " " + b.label).collect(Collectors.joining(", ")));
+      }
+    }
+  }
+
+  public static WebDriver configure(Orchestrator orchestrator) {
+    String browserKey = orchestrator.getConfiguration().getString("orchestrator.browser", Browser.firefox.name());
+    Browser browser = Browser.of(browserKey);
+    Configuration.browser = browser.name();
+    Configuration.baseUrl = orchestrator.getServer().getUrl();
+    Configuration.timeout = 8_000;
+    Configuration.reportsFolder = "target/screenshots";
+    Configuration.screenshots = true;
+    Configuration.captureJavascriptErrors = true;
+    Configuration.savePageSource = true;
+    Configuration.browserSize = "1280x1024";
+    return getWebDriver();
+  }
+
+  static WebDriver getWebDriver() {
+    return WebDriverRunner.getWebDriver();
+  }
+}
diff --git a/server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/package-info.java b/server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/package-info.java
new file mode 100644 (file)
index 0000000..696f553
--- /dev/null
@@ -0,0 +1,23 @@
+/*
+ * SonarQube
+ * Copyright (C) 2009-2017 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.
+ */
+@ParametersAreNonnullByDefault
+package org.sonarqube.qa.util;
+
+import javax.annotation.ParametersAreNonnullByDefault;
diff --git a/server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/pageobjects/BackgroundTaskItem.java b/server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/pageobjects/BackgroundTaskItem.java
new file mode 100644 (file)
index 0000000..0c86d32
--- /dev/null
@@ -0,0 +1,65 @@
+/*
+ * SonarQube
+ * Copyright (C) 2009-2017 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.Condition;
+import com.codeborne.selenide.Selenide;
+import com.codeborne.selenide.SelenideElement;
+
+public class BackgroundTaskItem {
+
+  private final SelenideElement elt;
+
+  public BackgroundTaskItem(SelenideElement elt) {
+    this.elt = elt;
+  }
+
+  public SelenideElement getComponent() {
+    return elt.$("td:nth-child(2)");
+  }
+
+  public BackgroundTaskItem openActions() {
+    elt.$(".js-task-action > .dropdown-toggle").click();
+    elt.$(".js-task-action > .dropdown-menu").shouldBe(Condition.visible);
+    return this;
+  }
+
+  public BackgroundTaskItem openScannerContext() {
+    elt.$(".js-task-show-scanner-context").click();
+    Selenide.$(".js-task-scanner-context").shouldBe(Condition.visible);
+    return this;
+  }
+
+  public BackgroundTaskItem assertScannerContextContains(String text) {
+    Selenide.$(".js-task-scanner-context").should(Condition.hasText(text));
+    return this;
+  }
+
+  public BackgroundTaskItem openErrorStacktrace() {
+    elt.$(".js-task-show-stacktrace").click();
+    Selenide.$(".js-task-stacktrace").shouldBe(Condition.visible);
+    return this;
+  }
+
+  public BackgroundTaskItem assertErrorStacktraceContains(String text) {
+    Selenide.$(".js-task-stacktrace").should(Condition.hasText(text));
+    return this;
+  }
+}
diff --git a/server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/pageobjects/BackgroundTasksPage.java b/server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/pageobjects/BackgroundTasksPage.java
new file mode 100644 (file)
index 0000000..a14bc2c
--- /dev/null
@@ -0,0 +1,45 @@
+/*
+ * SonarQube
+ * Copyright (C) 2009-2017 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.Condition;
+import com.codeborne.selenide.ElementsCollection;
+import com.codeborne.selenide.Selenide;
+import java.util.List;
+import java.util.stream.Collectors;
+import org.openqa.selenium.By;
+
+public class BackgroundTasksPage {
+
+  public BackgroundTasksPage() {
+    Selenide.$(By.cssSelector(".background-tasks")).should(Condition.exist);
+  }
+
+  public ElementsCollection getTasks() {
+    return Selenide.$$(".background-tasks > tbody > tr");
+  }
+
+  public List<BackgroundTaskItem> getTasksAsItems() {
+    return getTasks()
+      .stream()
+      .map(BackgroundTaskItem::new)
+      .collect(Collectors.toList());
+  }
+}
diff --git a/server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/pageobjects/EncryptionPage.java b/server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/pageobjects/EncryptionPage.java
new file mode 100644 (file)
index 0000000..0e3bac7
--- /dev/null
@@ -0,0 +1,51 @@
+/*
+ * SonarQube
+ * Copyright (C) 2009-2017 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.Condition;
+import com.codeborne.selenide.Selenide;
+import com.codeborne.selenide.SelenideElement;
+
+public class EncryptionPage extends Navigation {
+
+  public EncryptionPage() {
+    Selenide.$("#encryption-page").should(Condition.exist);
+  }
+
+  public SelenideElement generationForm() {
+    return Selenide.$("#generate-secret-key-form");
+  }
+
+  public SelenideElement newSecretKey() {
+    return Selenide.$("#secret-key");
+  }
+
+  public String encryptValue(String value) {
+    Selenide.$("#encryption-form-value").val(value);
+    Selenide.$("#encryption-form").submit();
+    return Selenide.$("#encrypted-value").shouldBe(Condition.visible).val();
+  }
+
+  public EncryptionPage generateNewKey() {
+    Selenide.$("#encryption-new-key-form").submit();
+    Selenide.$("#generate-secret-key-form").shouldBe(Condition.visible);
+    return this;
+  }
+}
diff --git a/server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/pageobjects/LoginPage.java b/server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/pageobjects/LoginPage.java
new file mode 100644 (file)
index 0000000..b210e01
--- /dev/null
@@ -0,0 +1,64 @@
+/*
+ * SonarQube
+ * Copyright (C) 2009-2017 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.Condition;
+import com.codeborne.selenide.Selenide;
+import com.codeborne.selenide.SelenideElement;
+import org.openqa.selenium.By;
+
+public class LoginPage {
+
+  public LoginPage() {
+    Selenide.$("#login_form").should(Condition.exist);
+  }
+
+  public Navigation submitCredentials(String login) {
+    return submitCredentials(login, login, Navigation.class);
+  }
+
+  public Navigation submitCredentials(String login, String password) {
+    return submitCredentials(login, password, Navigation.class);
+  }
+
+  public Navigation useOAuth2() {
+    Selenide.$(".oauth-providers a").click();
+    return Selenide.page(Navigation.class);
+  }
+
+  public LoginPage submitWrongCredentials(String login, String password) {
+    Selenide.$("#login").val(login);
+    Selenide.$("#password").val(password);
+    Selenide.$(By.name("commit")).click();
+    return Selenide.page(LoginPage.class);
+  }
+
+  public SelenideElement getErrorMessage() {
+    return Selenide.$(".process-spinner-failed");
+  }
+
+  private <T> T submitCredentials(String login, String password, Class<T> expectedResultPage) {
+    Selenide.$("#login").val(login);
+    Selenide.$("#password").val(password);
+    Selenide.$(By.name("commit")).click();
+    Selenide.$("#login").should(Condition.disappear);
+    return Selenide.page(expectedResultPage);
+  }
+}
diff --git a/server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/pageobjects/MarketplacePage.java b/server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/pageobjects/MarketplacePage.java
new file mode 100644 (file)
index 0000000..908bad3
--- /dev/null
@@ -0,0 +1,60 @@
+/*
+ * SonarQube
+ * Copyright (C) 2009-2017 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.Condition;
+import com.codeborne.selenide.Selenide;
+import com.codeborne.selenide.SelenideElement;
+
+public class MarketplacePage {
+
+  public MarketplacePage() {
+    Selenide.$("#marketplace-page").should(Condition.exist);
+  }
+
+  public MarketplacePage hasPendingPlugins(String text) {
+    Selenide.$(".js-pending").should(Condition.exist).shouldHave(Condition.text(text));
+    return this;
+  }
+
+  public MarketplacePage hasPluginsCount(int count) {
+    Selenide.$$("#marketplace-plugins>ul>li").shouldHaveSize(count);
+    return this;
+  }
+
+  public MarketplacePage hasPluginWithText(String name, String text) {
+    getPlugin(name).shouldHave(Condition.text(text));
+    return this;
+  }
+
+  public MarketplacePage searchPlugin(String search) {
+    Selenide.$("#marketplace-search input.search-box-input").should(Condition.exist).sendKeys(search);
+    return this;
+  }
+
+  public MarketplacePage uninstallPlugin(String name) {
+    getPlugin(name).$("button.js-uninstall").click();
+    return this;
+  }
+
+  private SelenideElement getPlugin(String name) {
+    return Selenide.$$(".js-plugin-name").findBy(Condition.text(name)).should(Condition.exist).parent().parent().parent();
+  }
+}
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
new file mode 100644 (file)
index 0000000..67cea19
--- /dev/null
@@ -0,0 +1,265 @@
+/*
+ * SonarQube
+ * Copyright (C) 2009-2017 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.Condition;
+import com.codeborne.selenide.Selenide;
+import com.codeborne.selenide.SelenideElement;
+import com.codeborne.selenide.WebDriverRunner;
+import com.sonar.orchestrator.Orchestrator;
+import java.io.UnsupportedEncodingException;
+import java.net.URLEncoder;
+import java.util.function.Consumer;
+import javax.annotation.Nullable;
+import org.openqa.selenium.By;
+import org.openqa.selenium.WebDriver;
+import org.openqa.selenium.html5.WebStorage;
+import org.sonarqube.qa.util.SelenideConfig;
+import org.sonarqube.qa.util.pageobjects.issues.IssuesPage;
+import org.sonarqube.qa.util.pageobjects.measures.MeasuresPage;
+import org.sonarqube.qa.util.pageobjects.organization.MembersPage;
+import org.sonarqube.qa.util.pageobjects.projects.ProjectsPage;
+import org.sonarqube.qa.util.pageobjects.settings.SettingsPage;
+
+public class Navigation {
+
+  public Navigation() {
+    Selenide.$("#content").shouldBe(Condition.exist);
+  }
+
+  public static Navigation create(Orchestrator orchestrator) {
+    WebDriver driver = SelenideConfig.configure(orchestrator);
+    driver.manage().deleteAllCookies();
+    clearStorage(d -> d.getLocalStorage().clear());
+    clearStorage(d -> d.getSessionStorage().clear());
+    clearStorage(d -> Selenide.clearBrowserLocalStorage());
+    return Selenide.open("/", Navigation.class);
+  }
+
+  private static void clearStorage(Consumer<WebStorage> cleaner) {
+    try {
+      cleaner.accept((WebStorage) WebDriverRunner.getWebDriver());
+    } catch (Exception e) {
+      // ignore, it may occur when the first test opens browser. No pages are loaded
+      // and local/session storages are not available yet.
+      // Example with Chrome: "Failed to read the 'localStorage' property from 'Window': Storage is disabled inside 'data:' URLs."
+    }
+  }
+
+  public Navigation openHome() {
+    return open("/", Navigation.class);
+  }
+
+  public ProjectsPage openProjects() {
+    return open("/projects", ProjectsPage.class);
+  }
+
+  public ProjectsPage openProjects(String organization) {
+    return open("/organizations/" + organization + "/projects", ProjectsPage.class);
+  }
+
+  public ProjectsPage openProjectsWithQuery(String query) {
+    return open("/projects?" + query, ProjectsPage.class);
+  }
+
+  public IssuesPage openIssues() {
+    return open("/issues", IssuesPage.class);
+  }
+
+  public IssuesPage openIssues(String organization) {
+    return open("/organizations/" + organization + "/issues", IssuesPage.class);
+  }
+
+  public IssuesPage openComponentIssues(String component) {
+    return open("/component_issues?id=" + component, IssuesPage.class);
+  }
+
+  public ProjectDashboardPage openProjectDashboard(String projectKey) {
+    // TODO encode projectKey
+    String url = "/dashboard?id=" + projectKey;
+    return open(url, ProjectDashboardPage.class);
+  }
+
+  public ProjectLinksPage openProjectLinks(String projectKey) {
+    // TODO encode projectKey
+    String url = "/project/links?id=" + projectKey;
+    return open(url, ProjectLinksPage.class);
+  }
+
+  public QualityGatePage openQualityGates() {
+    String url = "/quality_gates";
+    return open(url, QualityGatePage.class);
+  }
+
+  public QualityGatePage openQualityGates(String organization) {
+    String url = "/organizations/" + organization + "/quality_gates";
+    return open(url, QualityGatePage.class);
+  }
+
+  public ProjectQualityGatePage openProjectQualityGate(String projectKey) {
+    // TODO encode projectKey
+    String url = "/project/quality_gate?id=" + projectKey;
+    return open(url, ProjectQualityGatePage.class);
+  }
+
+  public ProjectKeyPage openProjectKey(String projectKey) {
+    // TODO encode projectKey
+    String url = "/project/key?id=" + projectKey;
+    return open(url, ProjectKeyPage.class);
+  }
+
+  public ProjectActivityPage openProjectActivity(String projectKey) {
+    // TODO encode projectKey
+    String url = "/project/activity?id=" + projectKey;
+    return open(url, ProjectActivityPage.class);
+  }
+
+  public MeasuresPage openProjectMeasures(String projectKey) {
+    // TODO encode projectKey
+    String url = "/component_measures?id=" + projectKey;
+    return open(url, MeasuresPage.class);
+  }
+
+  public ProjectCodePage openCode(String projectKey) {
+    // TODO encode projectKey
+    String url = "/code?id=" + projectKey;
+    return open(url, ProjectCodePage.class);
+  }
+
+  public ProjectCodePage openCode(String projectKey, String selected) {
+    // TODO encode projectKey and selected
+    String url = "/code?id=" + projectKey + "&selected=" + selected;
+    return open(url, ProjectCodePage.class);
+  }
+
+  public MembersPage openOrganizationMembers(String orgKey) {
+    String url = "/organizations/" + orgKey + "/members";
+    return open(url, MembersPage.class);
+  }
+
+  public QualityProfilePage openQualityProfile(String language, String name, String organization) {
+    String profileUrl = "/quality_profiles/show?language=" + language + "&name=" + name;
+    return open("/organizations/" + organization + profileUrl, QualityProfilePage.class);
+  }
+
+  public BackgroundTasksPage openBackgroundTasksPage() {
+    return open("/background_tasks", BackgroundTasksPage.class);
+  }
+
+  public SettingsPage openSettings(@Nullable String projectKey) throws UnsupportedEncodingException {
+    String url = projectKey != null ? "/project/settings?id=" + URLEncoder.encode(projectKey, "UTF-8") : "/settings";
+    return open(url, SettingsPage.class);
+  }
+
+  public EncryptionPage openEncryption() {
+    return open("/settings/encryption", EncryptionPage.class);
+  }
+
+  public SystemInfoPage openSystemInfo() {
+    return open("/admin/system", SystemInfoPage.class);
+  }
+
+  public MarketplacePage openMarketplace() {
+    return open("/admin/marketplace", MarketplacePage.class);
+  }
+
+  public NotificationsPage openNotifications() {
+    return open("/account/notifications", NotificationsPage.class);
+  }
+
+  public ProjectPermissionsPage openProjectPermissions(String projectKey) {
+    String url = "/project_roles?id=" + projectKey;
+    return open(url, ProjectPermissionsPage.class);
+  }
+
+  public ProjectsManagementPage openProjectsManagement() {
+    return open("/projects_admin", ProjectsManagementPage.class);
+  }
+
+  public LoginPage openLogin() {
+    return open("/sessions/login", LoginPage.class);
+  }
+
+  public void open(String relativeUrl) {
+    Selenide.open(relativeUrl);
+  }
+
+  public <P> P open(String relativeUrl, Class<P> pageObjectClassClass) {
+    return Selenide.open(relativeUrl, pageObjectClassClass);
+  }
+
+  public Navigation shouldBeLoggedIn() {
+    loggedInDropdown().should(Condition.visible);
+    return this;
+  }
+
+  public Navigation shouldNotBeLoggedIn() {
+    logInLink().should(Condition.visible);
+    return this;
+  }
+
+  public LoginPage logIn() {
+    logInLink().click();
+    return Selenide.page(LoginPage.class);
+  }
+
+  public Navigation logOut() {
+    SelenideElement dropdown = loggedInDropdown();
+    // click must be on the <a> but not on the dropdown <li>
+    // for compatibility with phantomjs
+    dropdown.find(".dropdown-toggle").click();
+    dropdown.find(By.linkText("Log out")).click();
+    return this;
+  }
+
+  public RulesPage openRules() {
+    return open("/coding_rules", RulesPage.class);
+  }
+
+  public SelenideElement clickOnQualityProfiles() {
+    return Selenide.$(By.linkText("Quality Profiles"));
+  }
+
+  public SelenideElement getRightBar() {
+    return Selenide.$("#global-navigation .navbar-right");
+  }
+
+  public SelenideElement getFooter() {
+    return Selenide.$("#footer");
+  }
+
+  public SelenideElement getErrorMessage() {
+    return Selenide.$("#error");
+  }
+
+  private SelenideElement logInLink() {
+    return Selenide.$(By.linkText("Log in"));
+  }
+
+  private SelenideElement loggedInDropdown() {
+    return Selenide.$(".js-user-authenticated");
+  }
+
+  public Navigation shouldBeRedirectedToLogin() {
+    Selenide.$("#login_form").should(Condition.visible);
+    return this;
+  }
+
+}
diff --git a/server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/pageobjects/NotificationsPage.java b/server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/pageobjects/NotificationsPage.java
new file mode 100644 (file)
index 0000000..bd4911a
--- /dev/null
@@ -0,0 +1,118 @@
+/*
+ * SonarQube
+ * Copyright (C) 2009-2017 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.Condition;
+import com.codeborne.selenide.Selenide;
+
+public class NotificationsPage extends Navigation {
+
+  private final String EMAIL = "EmailNotificationChannel";
+
+  public NotificationsPage() {
+    Selenide.$("#account-page").shouldHave(Condition.text("Overall notifications"));
+  }
+
+  public NotificationsPage shouldHaveGlobalNotification(String type) {
+    return shouldHaveGlobalNotification(type, EMAIL);
+  }
+
+  public NotificationsPage shouldHaveGlobalNotification(String type, String channel) {
+    return shouldBeChecked(globalCheckboxSelector(type, channel));
+  }
+
+  public NotificationsPage shouldNotHaveGlobalNotification(String type) {
+    return shouldNotHaveGlobalNotification(type, EMAIL);
+  }
+
+  public NotificationsPage shouldNotHaveGlobalNotification(String type, String channel) {
+    return shouldNotBeChecked(globalCheckboxSelector(type, channel));
+  }
+
+  public NotificationsPage shouldHaveProjectNotification(String project, String type, String channel) {
+    return shouldBeChecked(projectCheckboxSelector(project, type, channel));
+  }
+
+  public NotificationsPage shouldNotHaveProjectNotification(String project, String type, String channel) {
+    return shouldNotBeChecked(projectCheckboxSelector(project, type, channel));
+  }
+
+  public NotificationsPage addGlobalNotification(String type) {
+    return addGlobalNotification(type, EMAIL);
+  }
+
+  public NotificationsPage addGlobalNotification(String type, String channel) {
+    shouldNotHaveGlobalNotification(type, channel);
+    toggleCheckbox(globalCheckboxSelector(type, channel));
+    shouldHaveGlobalNotification(type, channel);
+    return this;
+  }
+
+  public NotificationsPage removeGlobalNotification(String type) {
+    return removeGlobalNotification(type, EMAIL);
+  }
+
+  public NotificationsPage removeGlobalNotification(String type, String channel) {
+    shouldHaveGlobalNotification(type, channel);
+    toggleCheckbox(globalCheckboxSelector(type, channel));
+    shouldNotHaveGlobalNotification(type, channel);
+    return this;
+  }
+
+  public NotificationsPage addProjectNotification(String project, String type, String channel) {
+    shouldNotHaveProjectNotification(project, type, channel);
+    toggleCheckbox(projectCheckboxSelector(project, type, channel));
+    shouldHaveProjectNotification(project, type, channel);
+    return this;
+  }
+
+  public NotificationsPage removeProjectNotification(String project, String type, String channel) {
+    shouldHaveProjectNotification(project, type, channel);
+    toggleCheckbox(projectCheckboxSelector(project, type, channel));
+    shouldNotHaveProjectNotification(project, type, channel);
+    return this;
+  }
+
+  private String globalCheckboxSelector(String type, String channel) {
+    return "#global-notification-" + type + "-" + channel;
+  }
+
+  private String projectCheckboxSelector(String project, String type, String channel) {
+    return "#project-notification-" + project + "-" + type + "-" + channel;
+  }
+
+  private NotificationsPage shouldBeChecked(String selector) {
+    Selenide.$(selector)
+      .shouldBe(Condition.visible)
+      .shouldHave(Condition.cssClass("icon-checkbox-checked"));
+    return this;
+  }
+
+  private NotificationsPage shouldNotBeChecked(String selector) {
+    Selenide.$(selector)
+      .shouldBe(Condition.visible)
+      .shouldNotHave(Condition.cssClass("icon-checkbox-checked"));
+    return this;
+  }
+
+  private void toggleCheckbox(String selector) {
+    Selenide.$(selector).click();
+  }
+}
diff --git a/server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/pageobjects/ProjectActivityPage.java b/server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/pageobjects/ProjectActivityPage.java
new file mode 100644 (file)
index 0000000..ad8206c
--- /dev/null
@@ -0,0 +1,60 @@
+/*
+ * SonarQube
+ * Copyright (C) 2009-2017 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.Condition;
+import com.codeborne.selenide.ElementsCollection;
+import com.codeborne.selenide.Selenide;
+import java.util.List;
+import java.util.stream.Collectors;
+
+public class ProjectActivityPage {
+
+  public ProjectActivityPage() {
+    Selenide.$("#project-activity").should(Condition.exist);
+  }
+
+  public ElementsCollection getAnalyses() {
+    return Selenide.$$(".project-activity-analysis");
+  }
+
+  public List<ProjectAnalysisItem> getAnalysesAsItems() {
+    return getAnalyses()
+      .stream()
+      .map(ProjectAnalysisItem::new)
+      .collect(Collectors.toList());
+  }
+
+  public ProjectAnalysisItem getLastAnalysis() {
+    return new ProjectAnalysisItem(Selenide.$(".project-activity-analysis"));
+  }
+
+  public ProjectAnalysisItem getFirstAnalysis() {
+    return new ProjectAnalysisItem(Selenide.$$(".project-activity-analysis").last());
+  }
+
+  public ProjectActivityPage assertFirstAnalysisOfTheDayHasText(String day, String text) {
+    Selenide.$("#project-activity")
+      .find(".project-activity-day[data-day=\"" + day + "\"]")
+      .find(".project-activity-analysis")
+      .should(Condition.hasText(text));
+    return this;
+  }
+}
diff --git a/server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/pageobjects/ProjectAnalysisItem.java b/server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/pageobjects/ProjectAnalysisItem.java
new file mode 100644 (file)
index 0000000..2f6d444
--- /dev/null
@@ -0,0 +1,102 @@
+/*
+ * SonarQube
+ * Copyright (C) 2009-2017 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.Condition;
+import com.codeborne.selenide.Selenide;
+import com.codeborne.selenide.SelenideElement;
+
+public class ProjectAnalysisItem {
+
+  private final SelenideElement elt;
+
+  public ProjectAnalysisItem(SelenideElement elt) {
+    this.elt = elt;
+  }
+
+  public ProjectAnalysisItem shouldHaveEventWithText(String text) {
+    elt.find(".project-activity-events").shouldHave(Condition.text(text));
+    return this;
+  }
+
+  public ProjectAnalysisItem shouldHaveDeleteButton() {
+    elt.find(".js-analysis-actions").click();
+    elt.find(".js-delete-analysis").shouldBe(Condition.visible);
+    return this;
+  }
+
+  public ProjectAnalysisItem shouldNotHaveDeleteButton() {
+    elt.find(".js-analysis-actions").click();
+    elt.find(".js-delete-analysis").shouldNotBe(Condition.visible);
+    return this;
+  }
+
+  public void delete() {
+    elt.find(".js-analysis-actions").click();
+    elt.find(".js-delete-analysis").click();
+
+    SelenideElement modal = Selenide.$(".modal");
+    modal.shouldBe(Condition.visible);
+    modal.find("button[type=\"submit\"]").click();
+
+    elt.shouldNotBe(Condition.visible);
+  }
+
+  public ProjectAnalysisItem addCustomEvent(String name) {
+    elt.find(".js-analysis-actions").click();
+    elt.find(".js-add-event").click();
+
+    SelenideElement modal = Selenide.$(".modal");
+    modal.shouldBe(Condition.visible);
+    modal.find("input").setValue(name);
+    modal.find("button[type=\"submit\"]").click();
+
+    elt.find(".project-activity-event:first-child").shouldHave(Condition.text(name));
+    return this;
+  }
+
+  public ProjectAnalysisItem changeFirstEvent(String newName) {
+    SelenideElement firstEvent = elt.find(".project-activity-event:first-child");
+    firstEvent.find(".js-change-event").click();
+
+    SelenideElement modal = Selenide.$(".modal");
+    modal.shouldBe(Condition.visible);
+    modal.find("input").setValue(newName);
+    modal.find("button[type=\"submit\"]").click();
+
+    firstEvent.shouldHave(Condition.text(newName));
+    return this;
+  }
+
+  public ProjectAnalysisItem deleteFirstEvent() {
+    int eventsCount = elt.findAll(".project-activity-event").size();
+
+    SelenideElement firstEvent = elt.find(".project-activity-event:first-child");
+    firstEvent.find(".js-delete-event").click();
+
+    SelenideElement modal = Selenide.$(".modal");
+    modal.shouldBe(Condition.visible);
+    modal.find("button[type=\"submit\"]").click();
+
+    elt.findAll(".project-activity-event").shouldHaveSize(eventsCount - 1);
+
+    return this;
+  }
+}
diff --git a/server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/pageobjects/ProjectCodePage.java b/server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/pageobjects/ProjectCodePage.java
new file mode 100644 (file)
index 0000000..42bb867
--- /dev/null
@@ -0,0 +1,61 @@
+/*
+ * SonarQube
+ * Copyright (C) 2009-2017 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.Condition;
+import com.codeborne.selenide.Selenide;
+
+public class ProjectCodePage {
+
+  public ProjectCodePage() {
+  }
+
+  public ProjectCodePage openFirstComponent() {
+    Selenide.$$(".code-name-cell a").first().click();
+    return this;
+  }
+
+  public ProjectCodePage search(String query) {
+    Selenide.$(".code-search .search-box-input").val(query);
+    return this;
+  }
+
+  public ProjectCodePage shouldHaveComponent(String name) {
+    Selenide.$(".code-components").shouldHave(Condition.text(name));
+    return this;
+  }
+
+  public ProjectCodePage shouldHaveCode(String code) {
+    Selenide.$(".code-components .source-viewer").shouldHave(Condition.text(code));
+    return this;
+  }
+
+  public ProjectCodePage shouldHaveBreadcrumbs(String... breadcrumbs) {
+    for (String breadcrumb : breadcrumbs) {
+      Selenide.$(".code-breadcrumbs").shouldHave(Condition.text(breadcrumb));
+    }
+    return this;
+  }
+
+  public ProjectCodePage shouldSearchResult(String name) {
+    Selenide.$(".code-search-with-results").shouldHave(Condition.text(name));
+    return this;
+  }
+}
diff --git a/server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/pageobjects/ProjectDashboardPage.java b/server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/pageobjects/ProjectDashboardPage.java
new file mode 100644 (file)
index 0000000..4db2864
--- /dev/null
@@ -0,0 +1,107 @@
+/*
+ * SonarQube
+ * Copyright (C) 2009-2017 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.Condition;
+import com.codeborne.selenide.ElementsCollection;
+import com.codeborne.selenide.Selenide;
+import com.codeborne.selenide.SelenideElement;
+import java.util.Arrays;
+import org.openqa.selenium.By;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+
+public class ProjectDashboardPage {
+
+  public ProjectDashboardPage() {
+    Selenide.$(".overview").shouldBe(Condition.visible);
+  }
+
+  public SelenideElement getLinesOfCode() {
+    SelenideElement element = Selenide.$("#overview-ncloc");
+    element.shouldBe(Condition.visible);
+    return element;
+  }
+
+  public SelenideElement getLanguageDistribution() {
+    SelenideElement element = Selenide.$("#overview-language-distribution");
+    element.shouldBe(Condition.visible);
+    return element;
+  }
+
+  public SelenideElement getOverviewMeasure(String measure) {
+    ElementsCollection measures = Selenide.$$(".overview-domain-measure");
+    SelenideElement element = measures.find(Condition.text(measure)).shouldBe(Condition.visible);
+    return element;
+  }
+
+  private SelenideElement getTagsMeta() {
+    SelenideElement element = Selenide.$(".overview-meta-tags");
+    element.shouldBe(Condition.visible);
+    return element;
+  }
+
+  public ProjectDashboardPage shouldHaveTags(String... tags) {
+    String tagsList = String.join(", ", Arrays.asList(tags));
+    this.getTagsMeta().$(".tags-list > span").should(Condition.hasText(tagsList));
+    return this;
+  }
+
+  public ProjectDashboardPage shouldNotBeEditable() {
+    SelenideElement tagsElem = this.getTagsMeta();
+    tagsElem.$("button").shouldNot(Condition.exist);
+    tagsElem.$("div.multi-select").shouldNot(Condition.exist);
+    return this;
+  }
+
+  public ProjectDashboardPage shouldBeEditable() {
+    SelenideElement tagsElem = this.getTagsMeta();
+    tagsElem.$("button").shouldBe(Condition.visible);
+    return this;
+  }
+
+  public ProjectDashboardPage openTagEditor() {
+    SelenideElement tagsElem = this.getTagsMeta();
+    tagsElem.$("button").shouldBe(Condition.visible).click();
+    tagsElem.$("div.multi-select").shouldBe(Condition.visible);
+    return this;
+  }
+
+  public SelenideElement getTagAtIdx(Integer idx) {
+    SelenideElement tagsElem = this.getTagsMeta();
+    tagsElem.$("div.multi-select").shouldBe(Condition.visible);
+    return tagsElem.$$("ul.menu a").get(idx);
+  }
+
+  public ProjectDashboardPage sendKeysToTagsInput(CharSequence... charSequences) {
+    SelenideElement tagsInput = this.getTagsMeta().find("input");
+    tagsInput.sendKeys(charSequences);
+    return this;
+  }
+
+  public ProjectDashboardPage hasQualityGateLink(String name, String link) {
+    SelenideElement elem = Selenide.$$(".overview-meta-card")
+      .findBy(Condition.text("Quality Gate")).should(Condition.exist)
+      .find(By.linkText(name)).should(Condition.exist);
+    assertThat(elem.attr("href")).endsWith(link);
+    return this;
+  }
+}
diff --git a/server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/pageobjects/ProjectKeyPage.java b/server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/pageobjects/ProjectKeyPage.java
new file mode 100644 (file)
index 0000000..5a3e5ec
--- /dev/null
@@ -0,0 +1,100 @@
+/*
+ * SonarQube
+ * Copyright (C) 2009-2017 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.Condition;
+import com.codeborne.selenide.Selenide;
+import com.codeborne.selenide.SelenideElement;
+
+public class ProjectKeyPage {
+
+  public ProjectKeyPage() {
+    Selenide.$("#project-key").should(Condition.exist);
+  }
+
+  public ProjectKeyPage assertSimpleUpdate() {
+    Selenide.$("#update-key-new-key").shouldBe(Condition.visible);
+    Selenide.$("#update-key-submit").shouldBe(Condition.visible);
+    return this;
+  }
+
+  public ProjectKeyPage trySimpleUpdate(String newKey) {
+    Selenide.$("#update-key-new-key").val(newKey);
+    Selenide.$("#update-key-submit").click();
+    Selenide.$("#update-key-confirm").click();
+    return this;
+  }
+
+  public ProjectKeyPage openFineGrainedUpdate() {
+    Selenide.$("#update-key-tab-fine").click();
+    Selenide.$("#project-key-fine-grained-update").shouldBe(Condition.visible);
+    return this;
+  }
+
+  public ProjectKeyPage tryFineGrainedUpdate(String key, String newKey) {
+    SelenideElement form = Selenide.$(".js-fine-grained-update[data-key=\"" + key + "\"]");
+    form.shouldBe(Condition.visible);
+
+    form.$("input").val(newKey);
+    form.$("button").click();
+
+    Selenide.$("#update-key-confirm").click();
+    return this;
+  }
+
+  public ProjectKeyPage assertBulkChange() {
+    Selenide.$("#bulk-update-replace").shouldBe(Condition.visible);
+    Selenide.$("#bulk-update-by").shouldBe(Condition.visible);
+    Selenide.$("#bulk-update-see-results").shouldBe(Condition.visible);
+    return this;
+  }
+
+  public ProjectKeyPage simulateBulkChange(String replace, String by) {
+    Selenide.$("#bulk-update-replace").val(replace);
+    Selenide.$("#bulk-update-by").val(by);
+    Selenide.$("#bulk-update-see-results").click();
+
+    Selenide.$("#bulk-update-simulation").shouldBe(Condition.visible);
+    return this;
+  }
+
+  public ProjectKeyPage assertBulkChangeSimulationResult(String oldKey, String newKey) {
+    SelenideElement row = Selenide.$("#bulk-update-results").$("[data-key=\"" + oldKey + "\"]");
+    row.$(".js-old-key").should(Condition.hasText(oldKey));
+    row.$(".js-new-key").should(Condition.hasText(newKey));
+    return this;
+  }
+
+  public ProjectKeyPage assertDuplicated(String oldKey) {
+    SelenideElement row = Selenide.$("#bulk-update-results").$("[data-key=\"" + oldKey + "\"]");
+    row.$(".js-new-key").$(".badge-danger").shouldBe(Condition.visible);
+    return this;
+  }
+
+  public ProjectKeyPage confirmBulkUpdate() {
+    Selenide.$("#bulk-update-confirm").click();
+    return this;
+  }
+
+  public ProjectKeyPage assertSuccessfulBulkUpdate() {
+    Selenide.$("#project-key-bulk-update").$(".alert.alert-success").shouldBe(Condition.visible);
+    return this;
+  }
+}
diff --git a/server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/pageobjects/ProjectLinkItem.java b/server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/pageobjects/ProjectLinkItem.java
new file mode 100644 (file)
index 0000000..7444ca5
--- /dev/null
@@ -0,0 +1,52 @@
+/*
+ * SonarQube
+ * Copyright (C) 2009-2017 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.SelenideElement;
+import org.openqa.selenium.NoSuchElementException;
+
+public class ProjectLinkItem {
+
+  private final SelenideElement elt;
+
+  public ProjectLinkItem(SelenideElement elt) {
+    this.elt = elt;
+  }
+
+  public SelenideElement getName() {
+    return elt.$(".js-name");
+  }
+
+  public SelenideElement getType() {
+    try {
+      return elt.$(".js-type");
+    } catch (NoSuchElementException e) {
+      return null;
+    }
+  }
+
+  public SelenideElement getUrl() {
+    return elt.$(".js-url");
+  }
+
+  public SelenideElement getDeleteButton() {
+    return elt.$(".js-delete-button");
+  }
+}
diff --git a/server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/pageobjects/ProjectLinksPage.java b/server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/pageobjects/ProjectLinksPage.java
new file mode 100644 (file)
index 0000000..8f9e886
--- /dev/null
@@ -0,0 +1,44 @@
+/*
+ * SonarQube
+ * Copyright (C) 2009-2017 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.Condition;
+import com.codeborne.selenide.ElementsCollection;
+import com.codeborne.selenide.Selenide;
+import java.util.List;
+import java.util.stream.Collectors;
+
+public class ProjectLinksPage {
+
+  public ProjectLinksPage() {
+    Selenide.$("#project-links").should(Condition.exist);
+  }
+
+  public ElementsCollection getLinks() {
+    return Selenide.$$("#project-links tr[data-name]");
+  }
+
+  public List<ProjectLinkItem> getLinksAsItems() {
+    return getLinks()
+      .stream()
+      .map(ProjectLinkItem::new)
+      .collect(Collectors.toList());
+  }
+}
diff --git a/server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/pageobjects/ProjectPermissionsPage.java b/server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/pageobjects/ProjectPermissionsPage.java
new file mode 100644 (file)
index 0000000..0fabc15
--- /dev/null
@@ -0,0 +1,59 @@
+/*
+ * SonarQube
+ * Copyright (C) 2009-2017 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.Condition;
+import com.codeborne.selenide.Selenide;
+
+public class ProjectPermissionsPage {
+
+  public ProjectPermissionsPage() {
+    Selenide.$("#project-permissions-page").should(Condition.exist);
+  }
+
+  public ProjectPermissionsPage shouldBePublic() {
+    Selenide.$("#visibility-public .icon-radio.is-checked").shouldBe(Condition.visible);
+    return this;
+  }
+
+  public ProjectPermissionsPage shouldBePrivate() {
+    Selenide.$("#visibility-private .icon-radio.is-checked").shouldBe(Condition.visible);
+    return this;
+  }
+
+  public ProjectPermissionsPage turnToPublic() {
+    Selenide.$("#visibility-public").click();
+    Selenide.$("#confirm-turn-to-public").click();
+    shouldBePublic();
+    return this;
+  }
+
+  public ProjectPermissionsPage turnToPrivate() {
+    Selenide.$("#visibility-private").click();
+    shouldBePrivate();
+    return this;
+  }
+
+  public ProjectPermissionsPage shouldNotAllowPrivate() {
+    Selenide.$("#visibility-private").shouldHave(Condition.cssClass("text-muted"));
+    Selenide.$(".upgrade-organization-box").shouldBe(Condition.visible);
+    return this;
+  }
+}
diff --git a/server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/pageobjects/ProjectQualityGatePage.java b/server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/pageobjects/ProjectQualityGatePage.java
new file mode 100644 (file)
index 0000000..0cf3904
--- /dev/null
@@ -0,0 +1,44 @@
+/*
+ * SonarQube
+ * Copyright (C) 2009-2017 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.Condition;
+import com.codeborne.selenide.Selenide;
+import com.codeborne.selenide.SelenideElement;
+
+public class ProjectQualityGatePage {
+
+  public ProjectQualityGatePage() {
+    Selenide.$("#project-quality-gate").should(Condition.exist);
+  }
+
+  public SelenideElement getSelectedQualityGate() {
+    return Selenide.$(".Select-value-label");
+  }
+
+  public void assertNotSelected() {
+    Selenide.$(".Select-placeholder").should(Condition.exist);
+    Selenide.$(".Select-value-label").shouldNot(Condition.exist);
+  }
+
+  public void setQualityGate(String name) {
+    Selenide.$(".Select-input input").val(name).pressEnter();
+  }
+}
diff --git a/server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/pageobjects/ProjectsManagementPage.java b/server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/pageobjects/ProjectsManagementPage.java
new file mode 100644 (file)
index 0000000..529c98a
--- /dev/null
@@ -0,0 +1,58 @@
+/*
+ * SonarQube
+ * Copyright (C) 2009-2017 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.Condition;
+import com.codeborne.selenide.Selenide;
+
+public class ProjectsManagementPage {
+
+  public ProjectsManagementPage() {
+    Selenide.$("#projects-management-page").should(Condition.exist);
+  }
+
+  public ProjectsManagementPage shouldHaveProjectsCount(int count) {
+    Selenide.$$("#projects-management-page-projects tbody tr").shouldHaveSize(count);
+    return this;
+  }
+
+  public ProjectsManagementPage shouldHaveProject(String key) {
+    Selenide.$("#projects-management-page-projects").shouldHave(Condition.text(key));
+    return this;
+  }
+
+  public ProjectsManagementPage createProject(String key, String name, String visibility) {
+    Selenide.$("#create-project").click();
+    Selenide.$("#create-project-name").val(key);
+    Selenide.$("#create-project-key").val(name);
+    Selenide.$("#visibility-" + visibility).click();
+    Selenide.$("#create-project-submit").submit();
+    return this;
+  }
+
+  public ProjectsManagementPage bulkApplyPermissionTemplate(String template) {
+    Selenide.$(".js-bulk-apply-permission-template").click();
+    Selenide.$(".modal .Select-value").click();
+    Selenide.$$(".modal .Select-option").findBy(Condition.text(template)).click();
+    Selenide.$(".modal-foot button").click();
+    Selenide.$(".modal-body .alert-success").shouldBe(Condition.visible);
+    return this;
+  }
+}
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
new file mode 100644 (file)
index 0000000..2f8f166
--- /dev/null
@@ -0,0 +1,54 @@
+/*
+ * SonarQube
+ * Copyright (C) 2009-2017 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.Condition;
+import com.codeborne.selenide.Selenide;
+
+public class QualityGatePage {
+  public QualityGatePage() {
+    Selenide.$("#quality-gates-page").shouldBe(Condition.visible);
+  }
+
+  public QualityGatePage countQualityGates(Integer count) {
+    Selenide.$$("#quality-gates-page .list-group-item").shouldHaveSize(count);
+    return this;
+  }
+
+  public QualityGatePage canCreateQG() {
+    Selenide.$("#quality-gate-add").should(Condition.exist).shouldBe(Condition.visible);
+    return this;
+  }
+
+  public QualityGatePage canNotCreateQG() {
+    Selenide.$("#quality-gate-add").shouldNot(Condition.exist);
+    return this;
+  }
+
+  public QualityGatePage displayIntro() {
+    Selenide.$(".search-navigator-intro").should(Condition.exist).shouldBe(Condition.visible);
+    return this;
+  }
+
+  public QualityGatePage displayQualityGateDetail(String qualityGateName) {
+    Selenide.$(".layout-page-main-header").shouldHave(Condition.text(qualityGateName));
+    return this;
+  }
+}
diff --git a/server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/pageobjects/QualityProfilePage.java b/server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/pageobjects/QualityProfilePage.java
new file mode 100644 (file)
index 0000000..88b0096
--- /dev/null
@@ -0,0 +1,54 @@
+/*
+ * SonarQube
+ * Copyright (C) 2009-2017 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.Condition;
+import com.codeborne.selenide.Selenide;
+
+public class QualityProfilePage {
+  public QualityProfilePage() {
+    Selenide.$("#quality-profile").shouldBe(Condition.visible);
+  }
+
+  public QualityProfilePage shouldHaveMissingSonarWayRules(Integer nbRules) {
+    Selenide.$(".quality-profile-rules-sonarway-missing")
+      .shouldBe(Condition.visible)
+      .$("a").shouldHave(Condition.text(nbRules.toString()));
+    return this;
+  }
+
+  public RulesPage showMissingSonarWayRules() {
+    Selenide.$(".quality-profile-rules-sonarway-missing")
+      .shouldBe(Condition.visible).$("a").click();
+    Selenide.$(".coding-rules").shouldBe(Condition.visible);
+    return Selenide.page(RulesPage.class);
+  }
+
+  public QualityProfilePage shouldHaveAssociatedProject(String projectName) {
+    Selenide.$(".js-profile-project").shouldHave(Condition.text(projectName));
+    return this;
+  }
+
+  public QualityProfilePage shouldAllowToChangeProjects() {
+    Selenide.$(".js-change-projects").shouldBe(Condition.visible).click();
+    Selenide.$("#profile-projects .select-list-list").shouldBe(Condition.visible);
+    return this;
+  }
+}
diff --git a/server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/pageobjects/RuleDetails.java b/server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/pageobjects/RuleDetails.java
new file mode 100644 (file)
index 0000000..035a66f
--- /dev/null
@@ -0,0 +1,39 @@
+/*
+ * SonarQube
+ * Copyright (C) 2009-2017 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.Condition;
+import com.codeborne.selenide.Selenide;
+import com.codeborne.selenide.SelenideElement;
+
+public class RuleDetails {
+
+  private final SelenideElement elt;
+
+  public RuleDetails(SelenideElement elt) {
+    this.elt = elt;
+  }
+
+  public RuleDetails shouldBeActivatedOn(String profileName) {
+    Selenide.$("#coding-rules-detail-quality-profiles").shouldHave(Condition.text(profileName));
+    return this;
+  }
+
+}
diff --git a/server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/pageobjects/RuleItem.java b/server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/pageobjects/RuleItem.java
new file mode 100644 (file)
index 0000000..7b5d818
--- /dev/null
@@ -0,0 +1,41 @@
+/*
+ * SonarQube
+ * Copyright (C) 2009-2017 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.SelenideElement;
+
+public class RuleItem {
+
+  private final SelenideElement elt;
+
+  public RuleItem(SelenideElement elt) {
+    this.elt = elt;
+  }
+
+  public SelenideElement getTitle() {
+    return elt.$(".coding-rule-title");
+  }
+
+  public SelenideElement getMetadata() {
+    return elt.$(".coding-rule-meta");
+  }
+
+
+}
diff --git a/server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/pageobjects/RulesPage.java b/server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/pageobjects/RulesPage.java
new file mode 100644 (file)
index 0000000..6b2916e
--- /dev/null
@@ -0,0 +1,66 @@
+/*
+ * SonarQube
+ * Copyright (C) 2009-2017 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.Condition;
+import com.codeborne.selenide.ElementsCollection;
+import com.codeborne.selenide.Selenide;
+import com.codeborne.selenide.SelenideElement;
+import org.openqa.selenium.By;
+
+public class RulesPage extends Navigation {
+
+  public RulesPage() {
+    Selenide.$(By.cssSelector(".coding-rules")).should(Condition.exist);
+  }
+
+  public int getTotal() {
+    // warning - number is localized
+    return Integer.parseInt(Selenide.$("#coding-rules-total").text());
+  }
+
+  public ElementsCollection getSelectedFacetItems(String facetName) {
+    SelenideElement facet = Selenide.$(".search-navigator-facet-box[data-property='"+ facetName+"']").shouldBe(Condition.visible);
+    return facet.$$(".js-facet.active");
+  }
+
+  public RulesPage shouldHaveTotalRules(Integer total) {
+    Selenide.$("#coding-rules-total").shouldHave(Condition.text(total.toString()));
+    return this;
+  }
+
+  public RulesPage openFacet(String facet) {
+    Selenide.$(".search-navigator-facet-box[data-property=\"" + facet + "\"] .js-facet-toggle").click();
+    return this;
+  }
+
+  public RulesPage selectFacetItemByText(String facet, String itemText) {
+    Selenide.$$(".search-navigator-facet-box[data-property=\"" + facet + "\"] .js-facet")
+      .findBy(Condition.text(itemText)).click();
+    return this;
+  }
+
+  public RuleDetails openFirstRule() {
+    Selenide.$$(".js-rule").first().click();
+    Selenide.$(".coding-rules-details").shouldBe(Condition.visible);
+    return new RuleDetails(Selenide.$(".coding-rules-details"));
+  }
+
+}
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
new file mode 100644 (file)
index 0000000..5b93e2b
--- /dev/null
@@ -0,0 +1,46 @@
+/*
+ * SonarQube
+ * Copyright (C) 2009-2017 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.CollectionCondition;
+import com.codeborne.selenide.Condition;
+import com.codeborne.selenide.Selenide;
+import com.codeborne.selenide.SelenideElement;
+
+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;
+  }
+
+  public SystemInfoPage shouldHaveCards(String... titles) {
+    Selenide.$$(".system-info-health-card-title").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);
+    return new SystemInfoPageItem(cardTitle.parent().parent());
+  }
+}
diff --git a/server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/pageobjects/SystemInfoPageItem.java b/server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/pageobjects/SystemInfoPageItem.java
new file mode 100644 (file)
index 0000000..55d9c84
--- /dev/null
@@ -0,0 +1,85 @@
+/*
+ * SonarQube
+ * Copyright (C) 2009-2017 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.Condition;
+import com.codeborne.selenide.SelenideElement;
+
+public class SystemInfoPageItem {
+  private final SelenideElement elt;
+
+  public SystemInfoPageItem(SelenideElement elt) {
+      this.elt = elt;
+    }
+
+  public SystemInfoPageItem shouldHaveHealth() {
+    elt.$(".system-info-health-info .status-indicator").should(Condition.exist);
+    return this;
+  }
+
+  public SystemInfoPageItem shouldHaveSection(String section) {
+    ensureOpen();
+    elt.$$("h4").findBy(Condition.text(section)).should(Condition.exist);
+    return this;
+  }
+
+  public SystemInfoPageItem shouldNotHaveSection(String section) {
+    ensureOpen();
+    elt.$$("h4").findBy(Condition.text(section)).shouldNot(Condition.exist);
+    return this;
+  }
+
+  public SystemInfoPageItem shouldHaveMainSection() {
+    ensureOpen();
+    elt.$$(".system-info-section").get(0).find("h4").shouldNot(Condition.exist);
+    return this;
+  }
+
+  public SystemInfoPageItem shouldHaveField(String field) {
+    ensureOpen();
+    elt.$$(".system-info-section-item-name").findBy(Condition.text(field)).should(Condition.exist);
+    return this;
+  }
+
+  public SystemInfoPageItem shouldNotHaveField(String field) {
+    ensureOpen();
+    elt.$$(".system-info-section-item-name").findBy(Condition.exactText(field)).shouldNot(Condition.exist);
+    return this;
+  }
+
+  public SystemInfoPageItem shouldHaveFieldWithValue(String field, String value) {
+    ensureOpen();
+    SelenideElement fieldElem = elt.$$(".system-info-section-item-name").findBy(Condition.text(field)).should(Condition.exist);
+    fieldElem.parent().parent().$$("td").shouldHaveSize(2).get(1).shouldHave(Condition.text(value));
+    return this;
+  }
+
+  public SystemInfoPageItem ensureOpen() {
+    if(!isOpen()) {
+      elt.click();
+      elt.$(".boxed-group-inner").should(Condition.exist);
+    }
+    return this;
+  }
+
+  private boolean isOpen() {
+    return elt.$(".boxed-group-inner").exists();
+  }
+}
diff --git a/server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/pageobjects/issues/Issue.java b/server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/pageobjects/issues/Issue.java
new file mode 100644 (file)
index 0000000..d4e2713
--- /dev/null
@@ -0,0 +1,64 @@
+/*
+ * SonarQube
+ * Copyright (C) 2009-2017 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.issues;
+
+import com.codeborne.selenide.Condition;
+import com.codeborne.selenide.Selenide;
+import com.codeborne.selenide.SelenideElement;
+
+public class Issue {
+
+  private final SelenideElement elt;
+
+  public Issue(SelenideElement elt) {
+    this.elt = elt;
+  }
+
+  public Issue shouldAllowAssign() {
+    elt.find(".js-issue-assign").shouldBe(Condition.visible);
+    return this;
+  }
+
+  public Issue shouldAllowChangeType() {
+    elt.find(".js-issue-set-type").shouldBe(Condition.visible);
+    return this;
+  }
+
+  public Issue shouldNotAllowAssign() {
+    elt.find(".js-issue-assign").shouldNotBe(Condition.visible);
+    return this;
+  }
+
+  public Issue shouldNotAllowChangeType() {
+    elt.find(".js-issue-set-type").shouldNotBe(Condition.visible);
+    return this;
+  }
+
+  public Issue assigneeSearchResultCount(String query, Integer count) {
+    SelenideElement assignLink = elt.find(".js-issue-assign");
+    assignLink.click();
+    SelenideElement popupMenu = Selenide.$(".bubble-popup ul.menu").shouldBe(Condition.visible);
+    Selenide.$(".bubble-popup input.search-box-input").shouldBe(Condition.visible).val("").sendKeys(query);
+    popupMenu.$("li a[data-text='Not assigned']").shouldNot(Condition.exist);
+    popupMenu.$$("li").shouldHaveSize(count);
+    assignLink.click();
+    return this;
+  }
+}
diff --git a/server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/pageobjects/issues/IssuesPage.java b/server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/pageobjects/issues/IssuesPage.java
new file mode 100644 (file)
index 0000000..9275592
--- /dev/null
@@ -0,0 +1,82 @@
+/*
+ * SonarQube
+ * Copyright (C) 2009-2017 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.issues;
+
+import com.codeborne.selenide.CollectionCondition;
+import com.codeborne.selenide.Condition;
+import com.codeborne.selenide.ElementsCollection;
+import com.codeborne.selenide.Selenide;
+import java.util.List;
+import java.util.stream.Collectors;
+
+public class IssuesPage {
+
+  public IssuesPage() {
+    Selenide.$(".issues").should(Condition.exist);
+  }
+
+  private ElementsCollection getIssuesElements() {
+    return Selenide.$$(".issues .issue");
+  }
+
+  private ElementsCollection getIssuesPathComponents() {
+    return Selenide.$$(".issues-workspace-list-component");
+  }
+
+  public List<Issue> getIssues() {
+    return getIssuesElements()
+      .stream()
+      .map(Issue::new)
+      .collect(Collectors.toList());
+  }
+
+  public IssuesPage issuesCount(Integer count) {
+    this.getIssuesElements().shouldHaveSize(count);
+    return this;
+  }
+
+  public Issue getFirstIssue() {
+    getIssuesElements().shouldHave(CollectionCondition.sizeGreaterThan(0));
+    return new Issue(getIssuesElements().first());
+  }
+
+  public IssuesPage componentsShouldContain(String path) {
+    this.getIssuesPathComponents().forEach(element -> element.shouldHave(Condition.text(path)));
+    return this;
+  }
+
+  public IssuesPage componentsShouldNotContain(String path) {
+    this.getIssuesPathComponents().forEach(element -> element.shouldNotHave(Condition.text(path)));
+    return this;
+  }
+
+  public IssuesPage bulkChangeOpen() {
+    Selenide.$("#issues-bulk-change").shouldBe(Condition.visible).click();
+    Selenide.$("#bulk-change-form").shouldBe(Condition.visible);
+    return this;
+  }
+
+  public IssuesPage bulkChangeAssigneeSearchCount(String query, Integer count) {
+    Selenide.$("#issues-bulk-change-assignee .Select-input input").val(query);
+    Selenide.$$("#issues-bulk-change-assignee .Select-option").shouldHaveSize(count);
+    Selenide.$("#issues-bulk-change-assignee .Select-input input").pressEscape();
+    return this;
+  }
+}
diff --git a/server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/pageobjects/measures/MeasureContent.java b/server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/pageobjects/measures/MeasureContent.java
new file mode 100644 (file)
index 0000000..4f3da04
--- /dev/null
@@ -0,0 +1,61 @@
+/*
+ * SonarQube
+ * Copyright (C) 2009-2017 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.measures;
+
+import com.codeborne.selenide.Condition;
+import com.codeborne.selenide.ElementsCollection;
+import com.codeborne.selenide.SelenideElement;
+
+public class MeasureContent {
+  private final SelenideElement elt;
+
+  public MeasureContent(SelenideElement elt) {
+    this.elt = elt;
+  }
+
+  public MeasureContent shouldHaveTitle(String title) {
+    this.elt.$(".measure-details-header .measure-details-metric").should(Condition.exist).shouldHave(Condition.text(title));
+    return this;
+  }
+
+  public MeasureContent shouldHaveHeaderValue(String value) {
+    this.elt.$(".measure-details-header .measure-details-value").should(Condition.exist).shouldHave(Condition.text(value));
+    return this;
+  }
+
+  public MeasureContent shouldHaveFile(String path) {
+    this.getFiles().find(Condition.text(path)).should(Condition.exist);
+    return this;
+  }
+
+  public MeasureContent drillDown(String item) {
+    this.getFiles().find(Condition.text(item)).should(Condition.exist).find("a").click();
+    return this;
+  }
+
+  public MeasureContent shouldDisplayCode() {
+    this.elt.$(".source-line-code").should(Condition.exist);
+    return this;
+  }
+
+  private ElementsCollection getFiles() {
+    return this.elt.$$(".measure-details-component-row");
+  }
+}
diff --git a/server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/pageobjects/measures/MeasuresPage.java b/server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/pageobjects/measures/MeasuresPage.java
new file mode 100644 (file)
index 0000000..de052a4
--- /dev/null
@@ -0,0 +1,97 @@
+/*
+ * SonarQube
+ * Copyright (C) 2009-2017 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.measures;
+
+import com.codeborne.selenide.CollectionCondition;
+import com.codeborne.selenide.Condition;
+import com.codeborne.selenide.Selenide;
+import com.codeborne.selenide.SelenideElement;
+import org.openqa.selenium.Keys;
+
+public class MeasuresPage {
+  public MeasuresPage() {
+    Selenide.$("#component-measures").should(Condition.exist);
+  }
+
+  public MeasuresPage displayBubbleChart(String title) {
+    SelenideElement bubblechart = Selenide.$("#component-measures .measure-overview-bubble-chart");
+    bubblechart.$(".measure-overview-bubble-chart-title").shouldHave(Condition.text(title));
+    return this;
+  }
+
+  public MeasuresPage measureHasValue(String measure, Integer value) {
+    SelenideElement sidebar = this.getSideBar();
+    sidebar.$("#measure-" + measure + "-name").should(Condition.exist);
+    sidebar.$("#measure-" + measure + "-value").should(Condition.exist).shouldHave(Condition.text(value.toString()));
+    return this;
+  }
+
+  public MeasuresPage measureHasLeak(String measure, Integer value) {
+    SelenideElement sidebar = this.getSideBar();
+    sidebar.$("#measure-" + measure + "-name").should(Condition.exist);
+    sidebar.$("#measure-" + measure + "-leak").should(Condition.exist).shouldHave(Condition.text(value.toString()));
+    return this;
+  }
+
+  public MeasuresPage breadcrumbsShouldHave(String item) {
+    Selenide.$(".layout-page-header-panel .measure-breadcrumbs").shouldHave(Condition.text(item));
+    return this;
+  }
+
+  public MeasuresPage breadcrumbsShouldNotHave(String item) {
+    Selenide.$(".layout-page-header-panel .measure-breadcrumbs").shouldNotHave(Condition.text(item));
+    return this;
+  }
+
+  public MeasuresPage backShortcut() {
+    Selenide.$(".layout-page-header-panel").sendKeys(Keys.LEFT);
+    return this;
+  }
+
+  public MeasuresPage switchView(String view) {
+    SelenideElement select = Selenide.$(".measure-view-select").should(Condition.exist);
+    select.click();
+    select.$(".Select-menu-outer").should(Condition.exist)
+      .$$(".Select-option").shouldHave(CollectionCondition.sizeGreaterThan(1))
+      .find(Condition.text(view)).should(Condition.exist).click();
+    return this;
+  }
+
+  public MeasuresPage openFacet(String facet) {
+    SelenideElement facetBox = Selenide.$$(".search-navigator-facet-box").find(Condition.text(facet));
+    if(!facetBox.find("search-navigator-facet-list").isDisplayed()) {
+      facetBox.$(".search-navigator-facet-header a").should(Condition.exist).click();
+    }
+    return this;
+  }
+
+  public MeasureContent openMeasureContent(String measure) {
+    SelenideElement sidebar = this.getSideBar();
+    SelenideElement facetItem = sidebar.$("#measure-" + measure + "-name");
+    facetItem.click();
+    MeasureContent content = new MeasureContent(Selenide.$("#component-measures .measure-details-content").should(Condition.exist));
+    content.shouldHaveTitle(facetItem.getText());
+    return content;
+  }
+
+  private SelenideElement getSideBar() {
+    return Selenide.$("#component-measures .layout-page-side").should(Condition.exist);
+  }
+}
diff --git a/server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/pageobjects/organization/MemberItem.java b/server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/pageobjects/organization/MemberItem.java
new file mode 100644 (file)
index 0000000..fd02dfb
--- /dev/null
@@ -0,0 +1,94 @@
+/*
+ * SonarQube
+ * Copyright (C) 2009-2017 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.organization;
+
+import com.codeborne.selenide.CollectionCondition;
+import com.codeborne.selenide.Condition;
+import com.codeborne.selenide.ElementsCollection;
+import com.codeborne.selenide.Selenide;
+import com.codeborne.selenide.SelenideElement;
+
+public class MemberItem {
+  private final SelenideElement elt;
+
+  public MemberItem(SelenideElement elt) {
+    this.elt = elt;
+  }
+
+  public MemberItem shouldBeNamed(String login, String name) {
+    ElementsCollection tds = this.elt.$$("td");
+    tds.get(1).$("strong").shouldHave(Condition.text(name));
+    tds.get(1).$("span").shouldHave(Condition.text(login));
+    return this;
+  }
+
+  public MemberItem shouldHaveGroups(Integer groups) {
+    ElementsCollection tds = this.elt.$$("td");
+    tds.get(2).should(Condition.exist);
+    tds.get(2).shouldHave(Condition.text(groups.toString()));
+    return this;
+  }
+
+  public MemberItem shouldNotHaveActions() {
+    this.elt.$$("td").shouldHave(CollectionCondition.sizeLessThan(3));
+    return this;
+  }
+
+  public MemberItem removeMembership() {
+    ElementsCollection tds = this.elt.$$("td");
+    tds.shouldHave(CollectionCondition.sizeGreaterThan(3));
+    SelenideElement actionTd = tds.get(3);
+    actionTd.$("button").should(Condition.exist).click();
+    actionTd.$$(".dropdown-menu > li").get(2).shouldBe(Condition.visible).click();
+    SelenideElement modal = getModal("Remove user");
+    modal.$("button.button-red").shouldBe(Condition.visible).click();
+    return this;
+  }
+
+  public MemberItem manageGroupsOpen() {
+    ElementsCollection tds = this.elt.$$("td");
+    tds.shouldHave(CollectionCondition.sizeGreaterThan(3));
+    SelenideElement actionTd = tds.get(3);
+    actionTd.$("button").should(Condition.exist).click();
+    actionTd.$$(".dropdown-menu > li").get(0).shouldBe(Condition.visible).click();
+    getModal("Manage groups");
+    return this;
+  }
+
+  public MemberItem manageGroupsSelect(String group) {
+    SelenideElement modal = getModal("Manage groups");
+    modal.$$("li").find(Condition.text(group)).shouldBe(Condition.visible).click();
+    return this;
+  }
+
+  public MemberItem manageGroupsSave() {
+    SelenideElement modal = getModal("Manage groups");
+    modal.$("button[type='submit']").shouldBe(Condition.visible).click();
+    return this;
+  }
+
+  private SelenideElement getModal(String title) {
+    Selenide.$(".modal-head").should(Condition.exist).shouldHave(Condition.text(title));
+    SelenideElement form = Selenide.$(".ReactModalPortal form");
+    form.should(Condition.exist);
+    return form;
+  }
+}
diff --git a/server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/pageobjects/organization/MembersPage.java b/server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/pageobjects/organization/MembersPage.java
new file mode 100644 (file)
index 0000000..21816ae
--- /dev/null
@@ -0,0 +1,81 @@
+/*
+ * SonarQube
+ * Copyright (C) 2009-2017 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.organization;
+
+import com.codeborne.selenide.Condition;
+import com.codeborne.selenide.ElementsCollection;
+import com.codeborne.selenide.Selenide;
+import com.codeborne.selenide.SelenideElement;
+
+public class MembersPage {
+
+  public MembersPage() {
+    Selenide.$(".navbar-tabs a.active").shouldBe(Condition.visible).shouldHave(Condition.text("Members"));
+  }
+
+  public ElementsCollection getMembers() {
+    return Selenide.$$("table.data tr");
+  }
+
+  public MemberItem getMembersByIdx(Integer idx) {
+    return new MemberItem(getMembers().get(idx));
+  }
+
+  public MembersPage shouldHaveTotal(int total) {
+    Selenide.$(".panel-vertical > span > strong").shouldHave(Condition.text(String.valueOf(total)));
+    return this;
+  }
+
+  public MembersPage searchForMember(String query) {
+    Selenide.$(".page .search-box-input").shouldBe(Condition.visible).val("").sendKeys(query);
+    return this;
+  }
+
+  public MembersPage canAddMember() {
+    Selenide.$(".page-actions").shouldBe(Condition.visible);
+    return this;
+  }
+
+  public MembersPage canNotAddMember() {
+    Selenide.$(".page-actions").shouldNot(Condition.exist);
+    return this;
+  }
+
+  public MembersPage addMember(String login) {
+    this.canAddMember();
+    Selenide.$(".page-actions button").click();
+
+    SelenideElement modal = this.getModal("Add user");
+    SelenideElement input = modal.$(".Select-input input");
+    input.val(login);
+    modal.$("div.Select-option.is-focused").should(Condition.exist);
+    input.pressEnter();
+    modal.$("button[type='submit']").click();
+    return this;
+  }
+
+  private SelenideElement getModal(String title) {
+    Selenide.$(".modal-head").should(Condition.exist).shouldHave(Condition.text(title));
+    SelenideElement form = Selenide.$(".ReactModalPortal form");
+    form.should(Condition.exist);
+    return form;
+  }
+}
diff --git a/server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/pageobjects/package-info.java b/server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/pageobjects/package-info.java
new file mode 100644 (file)
index 0000000..bc9f943
--- /dev/null
@@ -0,0 +1,23 @@
+/*
+ * SonarQube
+ * Copyright (C) 2009-2017 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.
+ */
+@ParametersAreNonnullByDefault
+package org.sonarqube.qa.util.pageobjects;
+
+import javax.annotation.ParametersAreNonnullByDefault;
diff --git a/server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/pageobjects/projects/FacetItem.java b/server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/pageobjects/projects/FacetItem.java
new file mode 100644 (file)
index 0000000..7442541
--- /dev/null
@@ -0,0 +1,49 @@
+/*
+ * SonarQube
+ * Copyright (C) 2009-2017 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.projects;
+
+import com.codeborne.selenide.Condition;
+import com.codeborne.selenide.SelenideElement;
+
+public class FacetItem {
+
+  private final SelenideElement elt;
+
+  public FacetItem(SelenideElement elt) {
+    this.elt = elt;
+  }
+
+  public FacetItem shouldHaveValue(String key, String value) {
+    this.elt.$(".facet[data-key=\"" + key + "\"] .facet-stat").shouldHave(Condition.text(value));
+    return this;
+  }
+
+  public void selectValue(String key) {
+    this.elt.$(".facet[data-key=\"" + key + "\"]").click();
+  }
+
+  public FacetItem selectOptionItem(String value) {
+    SelenideElement selectInput = this.elt.$(".Select-input input");
+    selectInput.val(value);
+    this.elt.$("div.Select-option.is-focused").should(Condition.exist);
+    selectInput.pressEnter();
+    return this;
+  }
+}
diff --git a/server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/pageobjects/projects/ProjectItem.java b/server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/pageobjects/projects/ProjectItem.java
new file mode 100644 (file)
index 0000000..45ef2cb
--- /dev/null
@@ -0,0 +1,37 @@
+/*
+ * SonarQube
+ * Copyright (C) 2009-2017 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.projects;
+
+import com.codeborne.selenide.Condition;
+import com.codeborne.selenide.SelenideElement;
+
+public class ProjectItem {
+
+  private final SelenideElement elt;
+
+  public ProjectItem(SelenideElement elt) {
+    this.elt = elt;
+  }
+
+  public ProjectItem shouldHaveMeasure(String metricKey, String value) {
+    this.elt.$(".project-card-measure[data-key=\"" + metricKey + "\"]").shouldHave(Condition.text(value));
+    return this;
+  }
+}
diff --git a/server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/pageobjects/projects/ProjectsPage.java b/server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/pageobjects/projects/ProjectsPage.java
new file mode 100644 (file)
index 0000000..cc55ce2
--- /dev/null
@@ -0,0 +1,116 @@
+/*
+ * SonarQube
+ * Copyright (C) 2009-2017 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.projects;
+
+import com.codeborne.selenide.Condition;
+import com.codeborne.selenide.ElementsCollection;
+import com.codeborne.selenide.Selenide;
+import com.codeborne.selenide.SelenideElement;
+import com.codeborne.selenide.WebDriverRunner;
+import org.assertj.core.api.Assertions;
+
+public class ProjectsPage {
+
+  public ProjectsPage() {
+    Selenide.$("#projects-page").shouldBe(Condition.visible);
+  }
+
+  public ElementsCollection getProjects() {
+    return Selenide.$$(".projects-list > .boxed-group");
+  }
+
+  public ElementsCollection getFacets() {
+    return Selenide.$$(".search-navigator-facet-box");
+  }
+
+  public ProjectItem getProjectByKey(String projectKey) {
+    SelenideElement element = getProjects().find(Condition.attribute("data-key", projectKey));
+    return new ProjectItem(element);
+  }
+
+  public ProjectItem getProjectByIdx(Integer idx) {
+    return new ProjectItem(getProjects().get(idx));
+  }
+
+  public FacetItem getFacetByProperty(String facetProperty) {
+    SelenideElement element = getFacets().find(Condition.attribute("data-key", facetProperty));
+    return new FacetItem(element);
+  }
+
+  public ProjectsPage shouldHaveTotal(int total) {
+    // warning - number is localized
+    Selenide.$("#projects-total").shouldHave(Condition.text(String.valueOf(total)));
+    return this;
+  }
+
+  public ProjectsPage shouldDisplayAllProjects() {
+    Assertions.assertThat(WebDriverRunner.url()).endsWith("/projects");
+    return this;
+  }
+
+  public ProjectsPage shouldDisplayAllProjectsWidthSort(String sort) {
+    Assertions.assertThat(WebDriverRunner.url()).endsWith("/projects?sort=" + sort);
+    return this;
+  }
+
+  public ProjectsPage shouldDisplayFavoriteProjects() {
+    Assertions.assertThat(WebDriverRunner.url()).endsWith("/projects/favorite");
+    return this;
+  }
+
+  public ProjectsPage selectAllProjects() {
+    Selenide.$("#all-projects").click();
+    return shouldDisplayAllProjects();
+  }
+
+  public ProjectsPage selectFavoriteProjects() {
+    Selenide.$("#favorite-projects").click();
+    return shouldDisplayFavoriteProjects();
+  }
+
+  public ProjectsPage searchProject(String search) {
+    SelenideElement searchInput = Selenide.$(".projects-topbar-item-search input");
+    searchInput.setValue("").sendKeys(search);
+    return this;
+  }
+
+  public ProjectsPage changePerspective(String perspective) {
+    SelenideElement sortSelect = getOpenTopBar().$(".js-projects-perspective-select");
+    sortSelect.$(".Select-value").should(Condition.exist).click();
+    sortSelect.$(".Select-option[title='" + perspective + "']").should(Condition.exist).click();
+    return this;
+  }
+
+  public ProjectsPage sortProjects(String sort) {
+    SelenideElement sortSelect = getOpenTopBar().$(".js-projects-sorting-select");
+    sortSelect.$(".Select-value").should(Condition.exist).click();
+    sortSelect.$(".Select-option[title='" + sort + "']").should(Condition.exist).click();
+    return this;
+  }
+
+  public ProjectsPage invertSorting() {
+    getOpenTopBar().$(".js-projects-sorting-invert").should(Condition.exist).click();
+    return this;
+  }
+
+  private SelenideElement getOpenTopBar() {
+    return Selenide.$(".projects-topbar-items").should(Condition.exist);
+  }
+}
diff --git a/server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/pageobjects/settings/PropertySetInput.java b/server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/pageobjects/settings/PropertySetInput.java
new file mode 100644 (file)
index 0000000..fb5de08
--- /dev/null
@@ -0,0 +1,47 @@
+/*
+ * SonarQube
+ * Copyright (C) 2009-2017 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.settings;
+
+import com.codeborne.selenide.Condition;
+import com.codeborne.selenide.SelenideElement;
+
+public class PropertySetInput {
+
+  private final SelenideElement elt;
+
+  public PropertySetInput(SelenideElement elt) {
+    this.elt = elt;
+  }
+
+  public PropertySetInput setFieldValue(int index, String fieldKey, String value) {
+    elt.findAll("input[name$=\"[" + fieldKey + "]\"]").get(index).val(value);
+    return this;
+  }
+
+  public PropertySetInput setFieldValue(String fieldKey, String value) {
+    return setFieldValue(0, fieldKey, value);
+  }
+
+  public PropertySetInput save() {
+    elt.find(".js-save-changes").click();
+    elt.find(".js-save-changes").shouldNot(Condition.exist);
+    return this;
+  }
+}
diff --git a/server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/pageobjects/settings/SettingsPage.java b/server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/pageobjects/settings/SettingsPage.java
new file mode 100644 (file)
index 0000000..1bc4e64
--- /dev/null
@@ -0,0 +1,80 @@
+/*
+ * SonarQube
+ * Copyright (C) 2009-2017 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.settings;
+
+import com.codeborne.selenide.Condition;
+import com.codeborne.selenide.Selenide;
+import com.codeborne.selenide.SelenideElement;
+import org.openqa.selenium.By;
+
+public class SettingsPage {
+
+  public SettingsPage() {
+    Selenide.$("#settings-page").shouldBe(Condition.visible);
+  }
+
+  public SettingsPage assertMenuContains(String categoryName) {
+    Selenide.$(".side-tabs-menu").$(By.linkText(categoryName)).shouldBe(Condition.visible);
+    return this;
+  }
+
+  public SettingsPage assertSettingDisplayed(String settingKey) {
+    Selenide.$(".settings-definition[data-key='" + settingKey + "']").shouldBe(Condition.visible);
+    return this;
+  }
+
+  public SettingsPage assertSettingNotDisplayed(String settingKey) {
+    Selenide.$(".settings-definition[data-key='" + settingKey + "']").shouldNotBe(Condition.visible);
+    return this;
+  }
+
+  public SettingsPage openCategory(String categoryName) {
+    Selenide.$(".side-tabs-menu").$(By.linkText(categoryName)).click();
+    return this;
+  }
+
+  public SettingsPage assertStringSettingValue(String settingKey, String value) {
+    Selenide.$("input[name=\"settings[" + settingKey + "]\"]").shouldHave(Condition.exactValue(value));
+    return this;
+  }
+
+  public SettingsPage assertBooleanSettingValue(String settingKey, boolean value) {
+    SelenideElement toggle = Selenide.$("button[name=\"settings[" + settingKey + "]\"]");
+    if (value) {
+      toggle.shouldHave(Condition.cssClass("boolean-toggle-on"));
+    } else {
+      toggle.shouldNotHave(Condition.cssClass("boolean-toggle-on"));
+    }
+    return this;
+  }
+
+  public SettingsPage setStringValue(String settingKey, String value) {
+    SelenideElement setting = Selenide.$(".settings-definition[data-key=\"" + settingKey + "\"]");
+    setting.find("input").val(value);
+    setting.find(".js-save-changes").click();
+    setting.find(".js-save-changes").shouldNot(Condition.exist);
+    return this;
+  }
+
+  public PropertySetInput getPropertySetInput(String settingKey) {
+    SelenideElement setting = Selenide.$(".settings-definition[data-key=\"" + settingKey + "\"]");
+    return new PropertySetInput(setting);
+  }
+}
index b16dedf42592ec1e0b10546fb30f03a4945dd4cd..4850c7b66e29efc9cac674516b3ec0d8f7b8966a 100644 (file)
       <type>zip</type>
       <scope>provided</scope>
     </dependency>
+    <dependency>
+      <groupId>org.sonarsource.sonarqube</groupId>
+      <artifactId>sonar-qa-util</artifactId>
+      <version>${project.parent.version}</version>
+      <scope>test</scope>
+    </dependency>
     <dependency>
       <groupId>org.sonarsource.sonarqube</groupId>
       <artifactId>sonar-process</artifactId>
diff --git a/tests/src/test/java/org/sonarqube/pageobjects/BackgroundTaskItem.java b/tests/src/test/java/org/sonarqube/pageobjects/BackgroundTaskItem.java
deleted file mode 100644 (file)
index aedd45e..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2017 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.pageobjects;
-
-import com.codeborne.selenide.SelenideElement;
-
-import static com.codeborne.selenide.Condition.hasText;
-import static com.codeborne.selenide.Condition.visible;
-import static com.codeborne.selenide.Selenide.$;
-
-public class BackgroundTaskItem {
-
-  private final SelenideElement elt;
-
-  public BackgroundTaskItem(SelenideElement elt) {
-    this.elt = elt;
-  }
-
-  public SelenideElement getComponent() {
-    return elt.$("td:nth-child(2)");
-  }
-
-  public BackgroundTaskItem openActions() {
-    elt.$(".js-task-action > .dropdown-toggle").click();
-    elt.$(".js-task-action > .dropdown-menu").shouldBe(visible);
-    return this;
-  }
-
-  public BackgroundTaskItem openScannerContext () {
-    elt.$(".js-task-show-scanner-context").click();
-    $(".js-task-scanner-context").shouldBe(visible);
-    return this;
-  }
-
-  public BackgroundTaskItem assertScannerContextContains(String text) {
-    $(".js-task-scanner-context").should(hasText(text));
-    return this;
-  }
-
-  public BackgroundTaskItem openErrorStacktrace () {
-    elt.$(".js-task-show-stacktrace").click();
-    $(".js-task-stacktrace").shouldBe(visible);
-    return this;
-  }
-
-  public BackgroundTaskItem assertErrorStacktraceContains(String text) {
-    $(".js-task-stacktrace").should(hasText(text));
-    return this;
-  }
-}
diff --git a/tests/src/test/java/org/sonarqube/pageobjects/BackgroundTasksPage.java b/tests/src/test/java/org/sonarqube/pageobjects/BackgroundTasksPage.java
deleted file mode 100644 (file)
index 432e1ad..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2017 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.pageobjects;
-
-import com.codeborne.selenide.ElementsCollection;
-import java.util.List;
-import java.util.stream.Collectors;
-import org.openqa.selenium.By;
-
-import static com.codeborne.selenide.Condition.exist;
-import static com.codeborne.selenide.Selenide.$;
-import static com.codeborne.selenide.Selenide.$$;
-
-public class BackgroundTasksPage {
-
-  public BackgroundTasksPage() {
-    $(By.cssSelector(".background-tasks")).should(exist);
-  }
-
-  public ElementsCollection getTasks() {
-    return $$(".background-tasks > tbody > tr");
-  }
-
-  public List<BackgroundTaskItem> getTasksAsItems() {
-    return getTasks()
-      .stream()
-      .map(BackgroundTaskItem::new)
-      .collect(Collectors.toList());
-  }
-}
diff --git a/tests/src/test/java/org/sonarqube/pageobjects/EncryptionPage.java b/tests/src/test/java/org/sonarqube/pageobjects/EncryptionPage.java
deleted file mode 100644 (file)
index f0c6884..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2017 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.pageobjects;
-
-import com.codeborne.selenide.SelenideElement;
-
-import static com.codeborne.selenide.Condition.exist;
-import static com.codeborne.selenide.Condition.visible;
-import static com.codeborne.selenide.Selenide.$;
-
-public class EncryptionPage extends Navigation {
-
-  public EncryptionPage() {
-    $("#encryption-page").should(exist);
-  }
-
-  public SelenideElement generationForm() {
-    return $("#generate-secret-key-form");
-  }
-
-  public SelenideElement newSecretKey() {
-    return $("#secret-key");
-  }
-
-  public String encryptValue(String value) {
-    $("#encryption-form-value").val(value);
-    $("#encryption-form").submit();
-    return $("#encrypted-value").shouldBe(visible).val();
-  }
-
-  public EncryptionPage generateNewKey() {
-    $("#encryption-new-key-form").submit();
-    $("#generate-secret-key-form").shouldBe(visible);
-    return this;
-  }
-}
diff --git a/tests/src/test/java/org/sonarqube/pageobjects/LoginPage.java b/tests/src/test/java/org/sonarqube/pageobjects/LoginPage.java
deleted file mode 100644 (file)
index bb17d09..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2017 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.pageobjects;
-
-import com.codeborne.selenide.Condition;
-import com.codeborne.selenide.SelenideElement;
-import org.openqa.selenium.By;
-
-import static com.codeborne.selenide.Selenide.$;
-import static com.codeborne.selenide.Selenide.page;
-
-public class LoginPage {
-
-  public LoginPage() {
-    $("#login_form").should(Condition.exist);
-  }
-
-  public Navigation submitCredentials(String login) {
-    return submitCredentials(login, login, Navigation.class);
-  }
-
-  public Navigation submitCredentials(String login, String password) {
-    return submitCredentials(login, password, Navigation.class);
-  }
-
-  public Navigation useOAuth2() {
-    $(".oauth-providers a").click();
-    return page(Navigation.class);
-  }
-
-  public LoginPage submitWrongCredentials(String login, String password) {
-    $("#login").val(login);
-    $("#password").val(password);
-    $(By.name("commit")).click();
-    return page(LoginPage.class);
-  }
-
-  public SelenideElement getErrorMessage() {
-    return $(".process-spinner-failed");
-  }
-
-  private <T> T submitCredentials(String login, String password, Class<T> expectedResultPage) {
-    $("#login").val(login);
-    $("#password").val(password);
-    $(By.name("commit")).click();
-    $("#login").should(Condition.disappear);
-    return page(expectedResultPage);
-  }
-}
diff --git a/tests/src/test/java/org/sonarqube/pageobjects/MarketplacePage.java b/tests/src/test/java/org/sonarqube/pageobjects/MarketplacePage.java
deleted file mode 100644 (file)
index 8e69c92..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2017 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.pageobjects;
-
-import com.codeborne.selenide.Condition;
-import com.codeborne.selenide.SelenideElement;
-import org.yaml.snakeyaml.error.Mark;
-
-import static com.codeborne.selenide.Selenide.$;
-import static com.codeborne.selenide.Selenide.$$;
-
-public class MarketplacePage {
-
-  public MarketplacePage() {
-    $("#marketplace-page").should(Condition.exist);
-  }
-
-  public MarketplacePage hasPendingPlugins(String text) {
-    $(".js-pending").should(Condition.exist).shouldHave(Condition.text(text));
-    return this;
-  }
-
-  public MarketplacePage hasPluginsCount(int count) {
-    $$("#marketplace-plugins>ul>li").shouldHaveSize(count);
-    return this;
-  }
-
-  public MarketplacePage hasPluginWithText(String name, String text) {
-    getPlugin(name).shouldHave(Condition.text(text));
-    return this;
-  }
-
-  public MarketplacePage searchPlugin(String search) {
-    $("#marketplace-search input.search-box-input").should(Condition.exist).sendKeys(search);
-    return this;
-  }
-
-  public MarketplacePage uninstallPlugin(String name) {
-    getPlugin(name).$("button.js-uninstall").click();
-    return this;
-  }
-
-  private SelenideElement getPlugin(String name) {
-    return $$(".js-plugin-name").findBy(Condition.text(name)).should(Condition.exist).parent().parent().parent();
-  }
-}
diff --git a/tests/src/test/java/org/sonarqube/pageobjects/Navigation.java b/tests/src/test/java/org/sonarqube/pageobjects/Navigation.java
deleted file mode 100644 (file)
index 8dbe70f..0000000
+++ /dev/null
@@ -1,272 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2017 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.pageobjects;
-
-import com.codeborne.selenide.Condition;
-import com.codeborne.selenide.Selenide;
-import com.codeborne.selenide.SelenideElement;
-import com.codeborne.selenide.WebDriverRunner;
-import com.sonar.orchestrator.Orchestrator;
-import java.io.UnsupportedEncodingException;
-import java.net.URLEncoder;
-import java.util.function.Consumer;
-import javax.annotation.Nullable;
-import org.openqa.selenium.By;
-import org.openqa.selenium.WebDriver;
-import org.openqa.selenium.html5.WebStorage;
-import org.sonarqube.pageobjects.issues.IssuesPage;
-import org.sonarqube.pageobjects.measures.MeasuresPage;
-import org.sonarqube.pageobjects.organization.MembersPage;
-import org.sonarqube.pageobjects.projects.ProjectsPage;
-import org.sonarqube.pageobjects.settings.SettingsPage;
-import org.sonarqube.tests.Tester;
-
-import static com.codeborne.selenide.Condition.visible;
-import static com.codeborne.selenide.Selenide.$;
-import static com.codeborne.selenide.Selenide.clearBrowserLocalStorage;
-import static com.codeborne.selenide.Selenide.page;
-
-public class Navigation {
-
-  public Navigation() {
-    $("#content").shouldBe(Condition.exist);
-  }
-
-  /**
-   * @deprecated use {@link Tester#openBrowser()}
-   */
-  @Deprecated
-  public static Navigation create(Orchestrator orchestrator) {
-    WebDriver driver = SelenideConfig.configure(orchestrator);
-    driver.manage().deleteAllCookies();
-    clearStorage(d -> d.getLocalStorage().clear());
-    clearStorage(d -> d.getSessionStorage().clear());
-    clearStorage(d -> clearBrowserLocalStorage());
-    return Selenide.open("/", Navigation.class);
-  }
-
-  private static void clearStorage(Consumer<WebStorage> cleaner) {
-    try {
-      cleaner.accept((WebStorage) WebDriverRunner.getWebDriver());
-    } catch (Exception e) {
-      // ignore, it may occur when the first test opens browser. No pages are loaded
-      // and local/session storages are not available yet.
-      // Example with Chrome: "Failed to read the 'localStorage' property from 'Window': Storage is disabled inside 'data:' URLs."
-    }
-  }
-
-  public Navigation openHome() {
-    return open("/", Navigation.class);
-  }
-
-  public ProjectsPage openProjects() {
-    return open("/projects", ProjectsPage.class);
-  }
-
-  public ProjectsPage openProjects(String organization) {
-    return open("/organizations/" + organization + "/projects", ProjectsPage.class);
-  }
-
-  public ProjectsPage openProjectsWithQuery(String query) {
-    return open("/projects?" + query, ProjectsPage.class);
-  }
-
-  public IssuesPage openIssues() {
-    return open("/issues", IssuesPage.class);
-  }
-
-  public IssuesPage openIssues(String organization) {
-    return open("/organizations/" + organization + "/issues", IssuesPage.class);
-  }
-
-  public IssuesPage openComponentIssues(String component) {
-    return open("/component_issues?id=" + component, IssuesPage.class);
-  }
-
-  public ProjectDashboardPage openProjectDashboard(String projectKey) {
-    // TODO encode projectKey
-    String url = "/dashboard?id=" + projectKey;
-    return open(url, ProjectDashboardPage.class);
-  }
-
-  public ProjectLinksPage openProjectLinks(String projectKey) {
-    // TODO encode projectKey
-    String url = "/project/links?id=" + projectKey;
-    return open(url, ProjectLinksPage.class);
-  }
-
-  public QualityGatePage openQualityGates() {
-    String url = "/quality_gates";
-    return open(url, QualityGatePage.class);
-  }
-
-  public QualityGatePage openQualityGates(String organization) {
-    String url = "/organizations/" + organization + "/quality_gates";
-    return open(url, QualityGatePage.class);
-  }
-
-  public ProjectQualityGatePage openProjectQualityGate(String projectKey) {
-    // TODO encode projectKey
-    String url = "/project/quality_gate?id=" + projectKey;
-    return open(url, ProjectQualityGatePage.class);
-  }
-
-  public ProjectKeyPage openProjectKey(String projectKey) {
-    // TODO encode projectKey
-    String url = "/project/key?id=" + projectKey;
-    return open(url, ProjectKeyPage.class);
-  }
-
-  public ProjectActivityPage openProjectActivity(String projectKey) {
-    // TODO encode projectKey
-    String url = "/project/activity?id=" + projectKey;
-    return open(url, ProjectActivityPage.class);
-  }
-
-  public MeasuresPage openProjectMeasures(String projectKey) {
-    // TODO encode projectKey
-    String url = "/component_measures?id=" + projectKey;
-    return open(url, MeasuresPage.class);
-  }
-
-  public ProjectCodePage openCode(String projectKey) {
-    // TODO encode projectKey
-    String url = "/code?id=" + projectKey;
-    return open(url, ProjectCodePage.class);
-  }
-
-  public ProjectCodePage openCode(String projectKey, String selected) {
-    // TODO encode projectKey and selected
-    String url = "/code?id=" + projectKey + "&selected=" + selected;
-    return open(url, ProjectCodePage.class);
-  }
-
-  public MembersPage openOrganizationMembers(String orgKey) {
-    String url = "/organizations/" + orgKey + "/members";
-    return open(url, MembersPage.class);
-  }
-
-  public QualityProfilePage openQualityProfile(String language, String name, String organization) {
-    String profileUrl = "/quality_profiles/show?language=" + language + "&name=" + name;
-    return open("/organizations/" + organization + profileUrl , QualityProfilePage.class);
-  }
-
-  public BackgroundTasksPage openBackgroundTasksPage() {
-    return open("/background_tasks", BackgroundTasksPage.class);
-  }
-
-  public SettingsPage openSettings(@Nullable String projectKey) throws UnsupportedEncodingException {
-    String url = projectKey != null ? "/project/settings?id=" + URLEncoder.encode(projectKey, "UTF-8") : "/settings";
-    return open(url, SettingsPage.class);
-  }
-
-  public EncryptionPage openEncryption() {
-    return open("/settings/encryption", EncryptionPage.class);
-  }
-
-  public SystemInfoPage openSystemInfo() {
-    return open("/admin/system", SystemInfoPage.class);
-  }
-
-  public MarketplacePage openMarketplace() { return open("/admin/marketplace", MarketplacePage.class);}
-
-  public NotificationsPage openNotifications() {
-    return open("/account/notifications", NotificationsPage.class);
-  }
-
-  public ProjectPermissionsPage openProjectPermissions(String projectKey) {
-    String url = "/project_roles?id=" + projectKey;
-    return open(url, ProjectPermissionsPage.class);
-  }
-
-  public ProjectsManagementPage openProjectsManagement() {
-    return open("/projects_admin", ProjectsManagementPage.class);
-  }
-
-  public LoginPage openLogin() {
-    return open("/sessions/login", LoginPage.class);
-  }
-
-  public void open(String relativeUrl) {
-    Selenide.open(relativeUrl);
-  }
-
-  public <P> P open(String relativeUrl, Class<P> pageObjectClassClass) {
-    return Selenide.open(relativeUrl, pageObjectClassClass);
-  }
-
-  public Navigation shouldBeLoggedIn() {
-    loggedInDropdown().should(visible);
-    return this;
-  }
-
-  public Navigation shouldNotBeLoggedIn() {
-    logInLink().should(visible);
-    return this;
-  }
-
-  public LoginPage logIn() {
-    logInLink().click();
-    return page(LoginPage.class);
-  }
-
-  public Navigation logOut() {
-    SelenideElement dropdown = loggedInDropdown();
-    // click must be on the <a> but not on the dropdown <li>
-    // for compatibility with phantomjs
-    dropdown.find(".dropdown-toggle").click();
-    dropdown.find(By.linkText("Log out")).click();
-    return this;
-  }
-
-  public RulesPage openRules() {
-    return open("/coding_rules", RulesPage.class);
-  }
-
-  public SelenideElement clickOnQualityProfiles() {
-    return $(By.linkText("Quality Profiles"));
-  }
-
-  public SelenideElement getRightBar() {
-    return $("#global-navigation .navbar-right");
-  }
-
-  public SelenideElement getFooter() {
-    return $("#footer");
-  }
-
-  public SelenideElement getErrorMessage() {
-    return $("#error");
-  }
-
-  private SelenideElement logInLink() {
-    return $(By.linkText("Log in"));
-  }
-
-  private SelenideElement loggedInDropdown() {
-    return $(".js-user-authenticated");
-  }
-
-  public Navigation shouldBeRedirectedToLogin() {
-    $("#login_form").should(visible);
-    return this;
-  }
-
-}
diff --git a/tests/src/test/java/org/sonarqube/pageobjects/NotificationsPage.java b/tests/src/test/java/org/sonarqube/pageobjects/NotificationsPage.java
deleted file mode 100644 (file)
index 456f08c..0000000
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2017 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.pageobjects;
-
-import static com.codeborne.selenide.Condition.cssClass;
-import static com.codeborne.selenide.Condition.text;
-import static com.codeborne.selenide.Condition.visible;
-import static com.codeborne.selenide.Selenide.$;
-
-public class NotificationsPage extends Navigation {
-
-  private final String EMAIL = "EmailNotificationChannel";
-
-  public NotificationsPage() {
-    $("#account-page").shouldHave(text("Overall notifications"));
-  }
-
-  public NotificationsPage shouldHaveGlobalNotification(String type) {
-    return shouldHaveGlobalNotification(type, EMAIL);
-  }
-
-  public NotificationsPage shouldHaveGlobalNotification(String type, String channel) {
-    return shouldBeChecked(globalCheckboxSelector(type, channel));
-  }
-
-  public NotificationsPage shouldNotHaveGlobalNotification(String type) {
-    return shouldNotHaveGlobalNotification(type, EMAIL);
-  }
-
-  public NotificationsPage shouldNotHaveGlobalNotification(String type, String channel) {
-    return shouldNotBeChecked(globalCheckboxSelector(type, channel));
-  }
-
-  public NotificationsPage shouldHaveProjectNotification(String project, String type, String channel) {
-    return shouldBeChecked(projectCheckboxSelector(project, type, channel));
-  }
-
-  public NotificationsPage shouldNotHaveProjectNotification(String project, String type, String channel) {
-    return shouldNotBeChecked(projectCheckboxSelector(project, type, channel));
-  }
-
-  public NotificationsPage addGlobalNotification(String type) {
-    return addGlobalNotification(type, EMAIL);
-  }
-
-  public NotificationsPage addGlobalNotification(String type, String channel) {
-    shouldNotHaveGlobalNotification(type, channel);
-    toggleCheckbox(globalCheckboxSelector(type, channel));
-    shouldHaveGlobalNotification(type, channel);
-    return this;
-  }
-
-  public NotificationsPage removeGlobalNotification(String type) {
-    return removeGlobalNotification(type, EMAIL);
-  }
-
-  public NotificationsPage removeGlobalNotification(String type, String channel) {
-    shouldHaveGlobalNotification(type, channel);
-    toggleCheckbox(globalCheckboxSelector(type, channel));
-    shouldNotHaveGlobalNotification(type, channel);
-    return this;
-  }
-
-  public NotificationsPage addProjectNotification(String project, String type, String channel) {
-    shouldNotHaveProjectNotification(project, type, channel);
-    toggleCheckbox(projectCheckboxSelector(project, type, channel));
-    shouldHaveProjectNotification(project, type, channel);
-    return this;
-  }
-
-  public NotificationsPage removeProjectNotification(String project, String type, String channel) {
-    shouldHaveProjectNotification(project, type, channel);
-    toggleCheckbox(projectCheckboxSelector(project, type, channel));
-    shouldNotHaveProjectNotification(project, type, channel);
-    return this;
-  }
-
-  private String globalCheckboxSelector(String type, String channel) {
-    return "#global-notification-" + type + "-" + channel;
-  }
-
-  private String projectCheckboxSelector(String project, String type, String channel) {
-    return "#project-notification-" + project + "-" + type + "-" + channel;
-  }
-
-  private NotificationsPage shouldBeChecked(String selector) {
-    $(selector)
-      .shouldBe(visible)
-      .shouldHave(cssClass("icon-checkbox-checked"));
-    return this;
-  }
-
-  private NotificationsPage shouldNotBeChecked(String selector) {
-    $(selector)
-      .shouldBe(visible)
-      .shouldNotHave(cssClass("icon-checkbox-checked"));
-    return this;
-  }
-
-  private void toggleCheckbox(String selector) {
-    $(selector).click();
-  }
-}
diff --git a/tests/src/test/java/org/sonarqube/pageobjects/ProjectActivityPage.java b/tests/src/test/java/org/sonarqube/pageobjects/ProjectActivityPage.java
deleted file mode 100644 (file)
index 05479cb..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2017 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.pageobjects;
-
-import com.codeborne.selenide.Condition;
-import com.codeborne.selenide.ElementsCollection;
-import java.util.List;
-import java.util.stream.Collectors;
-
-import static com.codeborne.selenide.Condition.hasText;
-import static com.codeborne.selenide.Selenide.$;
-import static com.codeborne.selenide.Selenide.$$;
-
-public class ProjectActivityPage {
-
-  public ProjectActivityPage() {
-    $("#project-activity").should(Condition.exist);
-  }
-
-  public ElementsCollection getAnalyses() {
-    return $$(".project-activity-analysis");
-  }
-
-  public List<ProjectAnalysisItem> getAnalysesAsItems() {
-    return getAnalyses()
-      .stream()
-      .map(ProjectAnalysisItem::new)
-      .collect(Collectors.toList());
-  }
-
-  public ProjectAnalysisItem getLastAnalysis() {
-    return new ProjectAnalysisItem($(".project-activity-analysis"));
-  }
-
-  public ProjectAnalysisItem getFirstAnalysis() {
-    return new ProjectAnalysisItem($$(".project-activity-analysis").last());
-  }
-
-  public ProjectActivityPage assertFirstAnalysisOfTheDayHasText(String day, String text) {
-    $("#project-activity")
-      .find(".project-activity-day[data-day=\"" + day + "\"]")
-      .find(".project-activity-analysis")
-      .should(hasText(text));
-    return this;
-  }
-}
diff --git a/tests/src/test/java/org/sonarqube/pageobjects/ProjectAnalysisItem.java b/tests/src/test/java/org/sonarqube/pageobjects/ProjectAnalysisItem.java
deleted file mode 100644 (file)
index dfd1520..0000000
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2017 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.pageobjects;
-
-import com.codeborne.selenide.SelenideElement;
-
-import static com.codeborne.selenide.Condition.text;
-import static com.codeborne.selenide.Condition.visible;
-import static com.codeborne.selenide.Selenide.$;
-
-public class ProjectAnalysisItem {
-
-  private final SelenideElement elt;
-
-  public ProjectAnalysisItem(SelenideElement elt) {
-    this.elt = elt;
-  }
-
-  public ProjectAnalysisItem shouldHaveEventWithText(String text) {
-    elt.find(".project-activity-events").shouldHave(text(text));
-    return this;
-  }
-
-  public ProjectAnalysisItem shouldHaveDeleteButton() {
-    elt.find(".js-analysis-actions").click();
-    elt.find(".js-delete-analysis").shouldBe(visible);
-    return this;
-  }
-
-  public ProjectAnalysisItem shouldNotHaveDeleteButton() {
-    elt.find(".js-analysis-actions").click();
-    elt.find(".js-delete-analysis").shouldNotBe(visible);
-    return this;
-  }
-
-  public void delete() {
-    elt.find(".js-analysis-actions").click();
-    elt.find(".js-delete-analysis").click();
-
-    SelenideElement modal = $(".modal");
-    modal.shouldBe(visible);
-    modal.find("button[type=\"submit\"]").click();
-
-    elt.shouldNotBe(visible);
-  }
-
-  public ProjectAnalysisItem addCustomEvent(String name) {
-    elt.find(".js-analysis-actions").click();
-    elt.find(".js-add-event").click();
-
-    SelenideElement modal = $(".modal");
-    modal.shouldBe(visible);
-    modal.find("input").setValue(name);
-    modal.find("button[type=\"submit\"]").click();
-
-    elt.find(".project-activity-event:first-child").shouldHave(text(name));
-    return this;
-  }
-
-  public ProjectAnalysisItem changeFirstEvent(String newName) {
-    SelenideElement firstEvent = elt.find(".project-activity-event:first-child");
-    firstEvent.find(".js-change-event").click();
-
-    SelenideElement modal = $(".modal");
-    modal.shouldBe(visible);
-    modal.find("input").setValue(newName);
-    modal.find("button[type=\"submit\"]").click();
-
-    firstEvent.shouldHave(text(newName));
-    return this;
-  }
-
-  public ProjectAnalysisItem deleteFirstEvent() {
-    int eventsCount = elt.findAll(".project-activity-event").size();
-
-    SelenideElement firstEvent = elt.find(".project-activity-event:first-child");
-    firstEvent.find(".js-delete-event").click();
-
-    SelenideElement modal = $(".modal");
-    modal.shouldBe(visible);
-    modal.find("button[type=\"submit\"]").click();
-
-    elt.findAll(".project-activity-event").shouldHaveSize(eventsCount - 1);
-
-    return this;
-  }
-}
diff --git a/tests/src/test/java/org/sonarqube/pageobjects/ProjectCodePage.java b/tests/src/test/java/org/sonarqube/pageobjects/ProjectCodePage.java
deleted file mode 100644 (file)
index 466ba60..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2017 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.pageobjects;
-
-import static com.codeborne.selenide.Condition.text;
-import static com.codeborne.selenide.Selenide.$;
-import static com.codeborne.selenide.Selenide.$$;
-
-public class ProjectCodePage {
-
-  public ProjectCodePage() {}
-
-  public ProjectCodePage openFirstComponent() {
-    $$(".code-name-cell a").first().click();
-    return this;
-  }
-
-  public ProjectCodePage search(String query) {
-    $(".code-search .search-box-input").val(query);
-    return this;
-  }
-
-  public ProjectCodePage shouldHaveComponent(String name) {
-    $(".code-components").shouldHave(text(name));
-    return this;
-  }
-
-  public ProjectCodePage shouldHaveCode(String code) {
-    $(".code-components .source-viewer").shouldHave(text(code));
-    return this;
-  }
-
-  public ProjectCodePage shouldHaveBreadcrumbs(String... breadcrumbs) {
-    for (String breadcrumb : breadcrumbs) {
-      $(".code-breadcrumbs").shouldHave(text(breadcrumb));
-    }
-    return this;
-  }
-
-  public ProjectCodePage shouldSearchResult(String name) {
-    $(".code-search-with-results").shouldHave(text(name));
-    return this;
-  }
-}
diff --git a/tests/src/test/java/org/sonarqube/pageobjects/ProjectDashboardPage.java b/tests/src/test/java/org/sonarqube/pageobjects/ProjectDashboardPage.java
deleted file mode 100644 (file)
index f1d150e..0000000
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2017 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.pageobjects;
-
-import com.codeborne.selenide.ElementsCollection;
-import com.codeborne.selenide.SelenideElement;
-import java.util.Arrays;
-import org.openqa.selenium.By;
-
-import static com.codeborne.selenide.Condition.exist;
-import static com.codeborne.selenide.Condition.hasText;
-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.$$;
-import static org.assertj.core.api.Assertions.assertThat;
-
-public class ProjectDashboardPage {
-
-  public ProjectDashboardPage() {
-    $(".overview").shouldBe(visible);
-  }
-
-  public SelenideElement getLinesOfCode() {
-    SelenideElement element = $("#overview-ncloc");
-    element.shouldBe(visible);
-    return element;
-  }
-
-  public SelenideElement getLanguageDistribution() {
-    SelenideElement element = $("#overview-language-distribution");
-    element.shouldBe(visible);
-    return element;
-  }
-
-  public SelenideElement getOverviewMeasure(String measure) {
-    ElementsCollection measures = $$(".overview-domain-measure");
-    SelenideElement element = measures.find(text(measure)).shouldBe(visible);
-    return element;
-  }
-
-  private SelenideElement getTagsMeta() {
-    SelenideElement element = $(".overview-meta-tags");
-    element.shouldBe(visible);
-    return element;
-  }
-
-  public ProjectDashboardPage shouldHaveTags(String... tags) {
-    String tagsList = String.join(", ", Arrays.asList(tags));
-    this.getTagsMeta().$(".tags-list > span").should(hasText(tagsList));
-    return this;
-  }
-
-  public ProjectDashboardPage shouldNotBeEditable() {
-    SelenideElement tagsElem = this.getTagsMeta();
-    tagsElem.$("button").shouldNot(exist);
-    tagsElem.$("div.multi-select").shouldNot(exist);
-    return this;
-  }
-
-  public ProjectDashboardPage shouldBeEditable() {
-    SelenideElement tagsElem = this.getTagsMeta();
-    tagsElem.$("button").shouldBe(visible);
-    return this;
-  }
-
-  public ProjectDashboardPage openTagEditor() {
-    SelenideElement tagsElem = this.getTagsMeta();
-    tagsElem.$("button").shouldBe(visible).click();
-    tagsElem.$("div.multi-select").shouldBe(visible);
-    return this;
-  }
-
-  public SelenideElement getTagAtIdx(Integer idx) {
-    SelenideElement tagsElem = this.getTagsMeta();
-    tagsElem.$("div.multi-select").shouldBe(visible);
-    return tagsElem.$$("ul.menu a").get(idx);
-  }
-
-  public ProjectDashboardPage sendKeysToTagsInput(CharSequence... charSequences) {
-    SelenideElement tagsInput = this.getTagsMeta().find("input");
-    tagsInput.sendKeys(charSequences);
-    return this;
-  }
-
-  public ProjectDashboardPage hasQualityGateLink(String name, String link) {
-    SelenideElement elem = $$(".overview-meta-card")
-      .findBy(text("Quality Gate")).should(exist)
-      .find(By.linkText(name)).should(exist);
-    assertThat(elem.attr("href")).endsWith(link);
-    return this;
-  }
-}
diff --git a/tests/src/test/java/org/sonarqube/pageobjects/ProjectKeyPage.java b/tests/src/test/java/org/sonarqube/pageobjects/ProjectKeyPage.java
deleted file mode 100644 (file)
index cf72bda..0000000
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2017 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.pageobjects;
-
-import com.codeborne.selenide.SelenideElement;
-
-import static com.codeborne.selenide.Condition.exist;
-import static com.codeborne.selenide.Condition.hasText;
-import static com.codeborne.selenide.Condition.visible;
-import static com.codeborne.selenide.Selenide.$;
-
-public class ProjectKeyPage {
-
-  public ProjectKeyPage() {
-    $("#project-key").should(exist);
-  }
-
-  public ProjectKeyPage assertSimpleUpdate() {
-    $("#update-key-new-key").shouldBe(visible);
-    $("#update-key-submit").shouldBe(visible);
-    return this;
-  }
-
-  public ProjectKeyPage trySimpleUpdate(String newKey) {
-    $("#update-key-new-key").val(newKey);
-    $("#update-key-submit").click();
-    $("#update-key-confirm").click();
-    return this;
-  }
-
-  public ProjectKeyPage openFineGrainedUpdate() {
-    $("#update-key-tab-fine").click();
-    $("#project-key-fine-grained-update").shouldBe(visible);
-    return this;
-  }
-
-  public ProjectKeyPage tryFineGrainedUpdate(String key, String newKey) {
-    SelenideElement form = $(".js-fine-grained-update[data-key=\"" + key + "\"]");
-    form.shouldBe(visible);
-
-    form.$("input").val(newKey);
-    form.$("button").click();
-
-    $("#update-key-confirm").click();
-    return this;
-  }
-
-  public ProjectKeyPage assertBulkChange() {
-    $("#bulk-update-replace").shouldBe(visible);
-    $("#bulk-update-by").shouldBe(visible);
-    $("#bulk-update-see-results").shouldBe(visible);
-    return this;
-  }
-
-  public ProjectKeyPage simulateBulkChange(String replace, String by) {
-    $("#bulk-update-replace").val(replace);
-    $("#bulk-update-by").val(by);
-    $("#bulk-update-see-results").click();
-
-    $("#bulk-update-simulation").shouldBe(visible);
-    return this;
-  }
-
-  public ProjectKeyPage assertBulkChangeSimulationResult(String oldKey, String newKey) {
-    SelenideElement row = $("#bulk-update-results").$("[data-key=\"" + oldKey + "\"]");
-    row.$(".js-old-key").should(hasText(oldKey));
-    row.$(".js-new-key").should(hasText(newKey));
-    return this;
-  }
-
-  public ProjectKeyPage assertDuplicated(String oldKey) {
-    SelenideElement row = $("#bulk-update-results").$("[data-key=\"" + oldKey + "\"]");
-    row.$(".js-new-key").$(".badge-danger").shouldBe(visible);
-    return this;
-  }
-
-  public ProjectKeyPage confirmBulkUpdate() {
-    $("#bulk-update-confirm").click();
-    return this;
-  }
-
-  public ProjectKeyPage assertSuccessfulBulkUpdate() {
-    $("#project-key-bulk-update").$(".alert.alert-success").shouldBe(visible);
-    return this;
-  }
-}
diff --git a/tests/src/test/java/org/sonarqube/pageobjects/ProjectLinkItem.java b/tests/src/test/java/org/sonarqube/pageobjects/ProjectLinkItem.java
deleted file mode 100644 (file)
index c652e01..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2017 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.pageobjects;
-
-import com.codeborne.selenide.SelenideElement;
-import org.openqa.selenium.NoSuchElementException;
-
-public class ProjectLinkItem {
-
-  private final SelenideElement elt;
-
-  public ProjectLinkItem(SelenideElement elt) {
-    this.elt = elt;
-  }
-
-  public SelenideElement getName() {
-    return elt.$(".js-name");
-  }
-
-  public SelenideElement getType() {
-    try {
-      return elt.$(".js-type");
-    } catch (NoSuchElementException e) {
-      return null;
-    }
-  }
-
-  public SelenideElement getUrl() {
-    return elt.$(".js-url");
-  }
-
-  public SelenideElement getDeleteButton() {
-    return elt.$(".js-delete-button");
-  }
-}
diff --git a/tests/src/test/java/org/sonarqube/pageobjects/ProjectLinksPage.java b/tests/src/test/java/org/sonarqube/pageobjects/ProjectLinksPage.java
deleted file mode 100644 (file)
index a4adbf3..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2017 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.pageobjects;
-
-import com.codeborne.selenide.Condition;
-import com.codeborne.selenide.ElementsCollection;
-
-import java.util.List;
-import java.util.stream.Collectors;
-
-import static com.codeborne.selenide.Selenide.$;
-import static com.codeborne.selenide.Selenide.$$;
-
-public class ProjectLinksPage {
-
-  public ProjectLinksPage() {
-    $("#project-links").should(Condition.exist);
-  }
-
-  public ElementsCollection getLinks() {
-    return $$("#project-links tr[data-name]");
-  }
-
-  public List<ProjectLinkItem> getLinksAsItems() {
-    return getLinks()
-      .stream()
-      .map(ProjectLinkItem::new)
-      .collect(Collectors.toList());
-  }
-}
diff --git a/tests/src/test/java/org/sonarqube/pageobjects/ProjectPermissionsPage.java b/tests/src/test/java/org/sonarqube/pageobjects/ProjectPermissionsPage.java
deleted file mode 100644 (file)
index 954ad77..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2017 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.pageobjects;
-
-import static com.codeborne.selenide.Condition.cssClass;
-import static com.codeborne.selenide.Condition.exist;
-import static com.codeborne.selenide.Condition.visible;
-import static com.codeborne.selenide.Selenide.$;
-
-public class ProjectPermissionsPage {
-
-  public ProjectPermissionsPage() {
-    $("#project-permissions-page").should(exist);
-  }
-
-  public ProjectPermissionsPage shouldBePublic() {
-    $("#visibility-public .icon-radio.is-checked").shouldBe(visible);
-    return this;
-  }
-
-  public ProjectPermissionsPage shouldBePrivate() {
-    $("#visibility-private .icon-radio.is-checked").shouldBe(visible);
-    return this;
-  }
-
-  public ProjectPermissionsPage turnToPublic() {
-    $("#visibility-public").click();
-    $("#confirm-turn-to-public").click();
-    shouldBePublic();
-    return this;
-  }
-
-  public ProjectPermissionsPage turnToPrivate() {
-    $("#visibility-private").click();
-    shouldBePrivate();
-    return this;
-  }
-
-  public ProjectPermissionsPage shouldNotAllowPrivate() {
-    $("#visibility-private").shouldHave(cssClass("text-muted"));
-    $(".upgrade-organization-box").shouldBe(visible);
-    return this;
-  }
-}
diff --git a/tests/src/test/java/org/sonarqube/pageobjects/ProjectQualityGatePage.java b/tests/src/test/java/org/sonarqube/pageobjects/ProjectQualityGatePage.java
deleted file mode 100644 (file)
index 58e28ac..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2017 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.pageobjects;
-
-import com.codeborne.selenide.SelenideElement;
-
-import static com.codeborne.selenide.Condition.exist;
-import static com.codeborne.selenide.Selenide.$;
-
-public class ProjectQualityGatePage {
-
-  public ProjectQualityGatePage() {
-    $("#project-quality-gate").should(exist);
-  }
-
-  public SelenideElement getSelectedQualityGate() {
-    return $(".Select-value-label");
-  }
-
-  public void assertNotSelected() {
-    $(".Select-placeholder").should(exist);
-    $(".Select-value-label").shouldNot(exist);
-  }
-
-  public void setQualityGate(String name) {
-    $(".Select-input input").val(name).pressEnter();
-  }
-}
diff --git a/tests/src/test/java/org/sonarqube/pageobjects/ProjectsManagementPage.java b/tests/src/test/java/org/sonarqube/pageobjects/ProjectsManagementPage.java
deleted file mode 100644 (file)
index c2031a8..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2017 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.pageobjects;
-
-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 ProjectsManagementPage {
-
-  public ProjectsManagementPage() {
-    $("#projects-management-page").should(exist);
-  }
-
-  public ProjectsManagementPage shouldHaveProjectsCount(int count) {
-    $$("#projects-management-page-projects tbody tr").shouldHaveSize(count);
-    return this;
-  }
-
-  public ProjectsManagementPage shouldHaveProject(String key) {
-    $("#projects-management-page-projects").shouldHave(text(key));
-    return this;
-  }
-
-  public ProjectsManagementPage createProject(String key, String name, String visibility) {
-    $("#create-project").click();
-    $("#create-project-name").val(key);
-    $("#create-project-key").val(name);
-    $("#visibility-" + visibility).click();
-    $("#create-project-submit").submit();
-    return this;
-  }
-
-  public ProjectsManagementPage bulkApplyPermissionTemplate(String template) {
-    $(".js-bulk-apply-permission-template").click();
-    $(".modal .Select-value").click();
-    $$(".modal .Select-option").findBy(text(template)).click();
-    $(".modal-foot button").click();
-    $(".modal-body .alert-success").shouldBe(visible);
-    return this;
-  }
-}
diff --git a/tests/src/test/java/org/sonarqube/pageobjects/QualityGatePage.java b/tests/src/test/java/org/sonarqube/pageobjects/QualityGatePage.java
deleted file mode 100644 (file)
index 4133bbf..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2017 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.pageobjects;
-
-import com.codeborne.selenide.Condition;
-
-import static com.codeborne.selenide.Selenide.$;
-import static com.codeborne.selenide.Selenide.$$;
-
-public class QualityGatePage {
-  public QualityGatePage() {
-    $("#quality-gates-page").shouldBe(Condition.visible);
-  }
-
-  public QualityGatePage countQualityGates(Integer count) {
-    $$("#quality-gates-page .list-group-item").shouldHaveSize(count);
-    return this;
-  }
-
-  public QualityGatePage canCreateQG() {
-    $("#quality-gate-add").should(Condition.exist).shouldBe(Condition.visible);
-    return this;
-  }
-
-  public QualityGatePage canNotCreateQG() {
-    $("#quality-gate-add").shouldNot(Condition.exist);
-    return this;
-  }
-
-  public QualityGatePage displayIntro() {
-    $(".search-navigator-intro").should(Condition.exist).shouldBe(Condition.visible);
-    return this;
-  }
-
-  public QualityGatePage displayQualityGateDetail(String qualityGateName) {
-    $(".layout-page-main-header").shouldHave(Condition.text(qualityGateName));
-    return this;
-  }
-}
diff --git a/tests/src/test/java/org/sonarqube/pageobjects/QualityProfilePage.java b/tests/src/test/java/org/sonarqube/pageobjects/QualityProfilePage.java
deleted file mode 100644 (file)
index 803f553..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2017 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.pageobjects;
-
-import com.codeborne.selenide.Condition;
-
-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.page;
-
-public class QualityProfilePage {
-  public QualityProfilePage() {
-    $("#quality-profile").shouldBe(Condition.visible);
-  }
-
-  public QualityProfilePage shouldHaveMissingSonarWayRules(Integer nbRules) {
-    $(".quality-profile-rules-sonarway-missing")
-      .shouldBe(Condition.visible)
-      .$("a").shouldHave(text(nbRules.toString()));
-    return this;
-  }
-
-  public RulesPage showMissingSonarWayRules() {
-    $(".quality-profile-rules-sonarway-missing")
-      .shouldBe(Condition.visible).$("a").click();
-    $(".coding-rules").shouldBe(Condition.visible);
-    return page(RulesPage.class);
-  }
-
-  public QualityProfilePage shouldHaveAssociatedProject(String projectName) {
-    $(".js-profile-project").shouldHave(text(projectName));
-    return this;
-  }
-
-  public QualityProfilePage shouldAllowToChangeProjects() {
-    $(".js-change-projects").shouldBe(visible).click();
-    $("#profile-projects .select-list-list").shouldBe(visible);
-    return this;
-  }
-}
diff --git a/tests/src/test/java/org/sonarqube/pageobjects/RuleDetails.java b/tests/src/test/java/org/sonarqube/pageobjects/RuleDetails.java
deleted file mode 100644 (file)
index fda58de..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2017 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.pageobjects;
-
-import com.codeborne.selenide.SelenideElement;
-
-import static com.codeborne.selenide.Condition.text;
-import static com.codeborne.selenide.Selenide.$;
-
-public class RuleDetails {
-
-  private final SelenideElement elt;
-
-  public RuleDetails(SelenideElement elt) {
-    this.elt = elt;
-  }
-
-  public RuleDetails shouldBeActivatedOn(String profileName) {
-    $("#coding-rules-detail-quality-profiles").shouldHave(text(profileName));
-    return this;
-  }
-
-}
diff --git a/tests/src/test/java/org/sonarqube/pageobjects/RuleItem.java b/tests/src/test/java/org/sonarqube/pageobjects/RuleItem.java
deleted file mode 100644 (file)
index b311f35..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2017 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.pageobjects;
-
-import com.codeborne.selenide.SelenideElement;
-
-public class RuleItem {
-
-  private final SelenideElement elt;
-
-  public RuleItem(SelenideElement elt) {
-    this.elt = elt;
-  }
-
-  public SelenideElement getTitle() {
-    return elt.$(".coding-rule-title");
-  }
-
-  public SelenideElement getMetadata() {
-    return elt.$(".coding-rule-meta");
-  }
-
-
-}
diff --git a/tests/src/test/java/org/sonarqube/pageobjects/RulesPage.java b/tests/src/test/java/org/sonarqube/pageobjects/RulesPage.java
deleted file mode 100644 (file)
index e3f5afb..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2017 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.pageobjects;
-
-import com.codeborne.selenide.Condition;
-import com.codeborne.selenide.ElementsCollection;
-import com.codeborne.selenide.SelenideElement;
-import org.openqa.selenium.By;
-
-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 RulesPage extends Navigation {
-
-  public RulesPage() {
-    $(By.cssSelector(".coding-rules")).should(Condition.exist);
-  }
-
-  public int getTotal() {
-    // warning - number is localized
-    return Integer.parseInt($("#coding-rules-total").text());
-  }
-
-  public ElementsCollection getSelectedFacetItems(String facetName) {
-    SelenideElement facet = $(".search-navigator-facet-box[data-property='"+ facetName+"']").shouldBe(Condition.visible);
-    return facet.$$(".js-facet.active");
-  }
-
-  public RulesPage shouldHaveTotalRules(Integer total) {
-    $("#coding-rules-total").shouldHave(text(total.toString()));
-    return this;
-  }
-
-  public RulesPage openFacet(String facet) {
-    $(".search-navigator-facet-box[data-property=\"" + facet + "\"] .js-facet-toggle").click();
-    return this;
-  }
-
-  public RulesPage selectFacetItemByText(String facet, String itemText) {
-    $$(".search-navigator-facet-box[data-property=\"" + facet + "\"] .js-facet")
-      .findBy(text(itemText)).click();
-    return this;
-  }
-
-  public RuleDetails openFirstRule() {
-    $$(".js-rule").first().click();
-    $(".coding-rules-details").shouldBe(visible);
-    return new RuleDetails($(".coding-rules-details"));
-  }
-
-}
diff --git a/tests/src/test/java/org/sonarqube/pageobjects/SelenideConfig.java b/tests/src/test/java/org/sonarqube/pageobjects/SelenideConfig.java
deleted file mode 100644 (file)
index 32c6850..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2017 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.pageobjects;
-
-import com.codeborne.selenide.Configuration;
-import com.codeborne.selenide.WebDriverRunner;
-import com.sonar.orchestrator.Orchestrator;
-import java.util.stream.Collectors;
-import org.openqa.selenium.WebDriver;
-
-import static java.util.Arrays.stream;
-
-public class SelenideConfig {
-
-  private enum Browser {
-    firefox("(v46 and lower)"),
-    marionette("(recent Firefox, require Geckodriver)"),
-    chrome("(require Chromedriver)");
-
-    private final String label;
-
-    Browser(String label) {
-      this.label = label;
-    }
-
-    static Browser of(String s) {
-      try {
-        return Browser.valueOf(s);
-      } catch (Exception e) {
-        throw new IllegalArgumentException("Invalid browser: " + s + ". Supported values are " +
-          stream(values()).map(b -> b.name() + " " + b.label).collect(Collectors.joining(", ")));
-      }
-    }
-  }
-
-  public static WebDriver configure(Orchestrator orchestrator) {
-    String browserKey = orchestrator.getConfiguration().getString("orchestrator.browser", Browser.firefox.name());
-    Browser browser = Browser.of(browserKey);
-    Configuration.browser = browser.name();
-    Configuration.baseUrl = orchestrator.getServer().getUrl();
-    Configuration.timeout = 8_000;
-    Configuration.reportsFolder = "target/screenshots";
-    Configuration.screenshots = true;
-    Configuration.captureJavascriptErrors = true;
-    Configuration.savePageSource = true;
-    Configuration.browserSize = "1280x1024";
-    return getWebDriver();
-  }
-
-  static WebDriver getWebDriver() {
-    return WebDriverRunner.getWebDriver();
-  }
-}
diff --git a/tests/src/test/java/org/sonarqube/pageobjects/SystemInfoPage.java b/tests/src/test/java/org/sonarqube/pageobjects/SystemInfoPage.java
deleted file mode 100644 (file)
index 64d3576..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2017 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.pageobjects;
-
-import com.codeborne.selenide.CollectionCondition;
-import com.codeborne.selenide.SelenideElement;
-
-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 SystemInfoPage {
-  public SystemInfoPage() {
-    $(".page-title").should(exist).shouldHave(text("System Info"));
-  }
-
-  public SystemInfoPage shouldHaveCard(String title) {
-    $$(".system-info-health-card-title").find(text(title)).should(exist);
-    return this;
-  }
-
-  public SystemInfoPage shouldHaveCards(String... titles) {
-    $$(".system-info-health-card-title").shouldHave(CollectionCondition.texts(titles));
-    return this;
-  }
-
-  public SystemInfoPageItem getCardItem(String card) {
-    SelenideElement cardTitle = $$(".system-info-health-card-title").find(text(card)).should(exist);
-    return new SystemInfoPageItem(cardTitle.parent().parent());
-  }
-}
\ No newline at end of file
diff --git a/tests/src/test/java/org/sonarqube/pageobjects/SystemInfoPageItem.java b/tests/src/test/java/org/sonarqube/pageobjects/SystemInfoPageItem.java
deleted file mode 100644 (file)
index c477c87..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2017 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.pageobjects;
-
-import com.codeborne.selenide.SelenideElement;
-
-import static com.codeborne.selenide.Condition.exactText;
-import static com.codeborne.selenide.Condition.exist;
-import static com.codeborne.selenide.Condition.text;
-
-public class SystemInfoPageItem {
-  private final SelenideElement elt;
-
-  public SystemInfoPageItem(SelenideElement elt) {
-      this.elt = elt;
-    }
-
-  public SystemInfoPageItem shouldHaveHealth() {
-    elt.$(".system-info-health-info .status-indicator").should(exist);
-    return this;
-  }
-
-  public SystemInfoPageItem shouldHaveSection(String section) {
-    ensureOpen();
-    elt.$$("h4").findBy(text(section)).should(exist);
-    return this;
-  }
-
-  public SystemInfoPageItem shouldNotHaveSection(String section) {
-    ensureOpen();
-    elt.$$("h4").findBy(text(section)).shouldNot(exist);
-    return this;
-  }
-
-  public SystemInfoPageItem shouldHaveMainSection() {
-    ensureOpen();
-    elt.$$(".system-info-section").get(0).find("h4").shouldNot(exist);
-    return this;
-  }
-
-  public SystemInfoPageItem shouldHaveField(String field) {
-    ensureOpen();
-    elt.$$(".system-info-section-item-name").findBy(text(field)).should(exist);
-    return this;
-  }
-
-  public SystemInfoPageItem shouldNotHaveField(String field) {
-    ensureOpen();
-    elt.$$(".system-info-section-item-name").findBy(exactText(field)).shouldNot(exist);
-    return this;
-  }
-
-  public SystemInfoPageItem shouldHaveFieldWithValue(String field, String value) {
-    ensureOpen();
-    SelenideElement fieldElem = elt.$$(".system-info-section-item-name").findBy(text(field)).should(exist);
-    fieldElem.parent().parent().$$("td").shouldHaveSize(2).get(1).shouldHave(text(value));
-    return this;
-  }
-
-  public SystemInfoPageItem ensureOpen() {
-    if(!isOpen()) {
-      elt.click();
-      elt.$(".boxed-group-inner").should(exist);
-    }
-    return this;
-  }
-
-  private boolean isOpen() {
-    return elt.$(".boxed-group-inner").exists();
-  }
-}
diff --git a/tests/src/test/java/org/sonarqube/pageobjects/issues/Issue.java b/tests/src/test/java/org/sonarqube/pageobjects/issues/Issue.java
deleted file mode 100644 (file)
index a2c6e64..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2017 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.pageobjects.issues;
-
-import com.codeborne.selenide.SelenideElement;
-
-import static com.codeborne.selenide.Condition.exist;
-import static com.codeborne.selenide.Condition.visible;
-import static com.codeborne.selenide.Selenide.$;
-
-public class Issue {
-
-  private final SelenideElement elt;
-
-  public Issue(SelenideElement elt) {
-    this.elt = elt;
-  }
-
-  public Issue shouldAllowAssign() {
-    elt.find(".js-issue-assign").shouldBe(visible);
-    return this;
-  }
-
-  public Issue shouldAllowChangeType() {
-    elt.find(".js-issue-set-type").shouldBe(visible);
-    return this;
-  }
-
-  public Issue shouldNotAllowAssign() {
-    elt.find(".js-issue-assign").shouldNotBe(visible);
-    return this;
-  }
-
-  public Issue shouldNotAllowChangeType() {
-    elt.find(".js-issue-set-type").shouldNotBe(visible);
-    return this;
-  }
-
-  public Issue assigneeSearchResultCount(String query, Integer count) {
-    SelenideElement assignLink = elt.find(".js-issue-assign");
-    assignLink.click();
-    SelenideElement popupMenu = $(".bubble-popup ul.menu").shouldBe(visible);
-    $(".bubble-popup input.search-box-input").shouldBe(visible).val("").sendKeys(query);
-    popupMenu.$("li a[data-text='Not assigned']").shouldNot(exist);
-    popupMenu.$$("li").shouldHaveSize(count);
-    assignLink.click();
-    return this;
-  }
-}
diff --git a/tests/src/test/java/org/sonarqube/pageobjects/issues/IssuesPage.java b/tests/src/test/java/org/sonarqube/pageobjects/issues/IssuesPage.java
deleted file mode 100644 (file)
index 0918af6..0000000
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2017 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.pageobjects.issues;
-
-import com.codeborne.selenide.ElementsCollection;
-import java.util.List;
-import java.util.stream.Collectors;
-
-import static com.codeborne.selenide.CollectionCondition.sizeGreaterThan;
-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 IssuesPage {
-
-  public IssuesPage() {
-    $(".issues").should(exist);
-  }
-
-  private ElementsCollection getIssuesElements() {
-    return $$(".issues .issue");
-  }
-
-  private ElementsCollection getIssuesPathComponents() {
-    return $$(".issues-workspace-list-component");
-  }
-
-  public List<Issue> getIssues() {
-    return getIssuesElements()
-      .stream()
-      .map(Issue::new)
-      .collect(Collectors.toList());
-  }
-
-  public IssuesPage issuesCount(Integer count) {
-    this.getIssuesElements().shouldHaveSize(count);
-    return this;
-  }
-
-  public Issue getFirstIssue() {
-    getIssuesElements().shouldHave(sizeGreaterThan(0));
-    return new Issue(getIssuesElements().first());
-  }
-
-  public IssuesPage componentsShouldContain(String path) {
-    this.getIssuesPathComponents().forEach(element -> element.shouldHave(text(path)));
-    return this;
-  }
-
-  public IssuesPage componentsShouldNotContain(String path) {
-    this.getIssuesPathComponents().forEach(element -> element.shouldNotHave(text(path)));
-    return this;
-  }
-
-  public IssuesPage bulkChangeOpen() {
-    $("#issues-bulk-change").shouldBe(visible).click();
-    $("#bulk-change-form").shouldBe(visible);
-    return this;
-  }
-
-  public IssuesPage bulkChangeAssigneeSearchCount(String query, Integer count) {
-    $("#issues-bulk-change-assignee .Select-input input").val(query);
-    $$("#issues-bulk-change-assignee .Select-option").shouldHaveSize(count);
-    $("#issues-bulk-change-assignee .Select-input input").pressEscape();
-    return this;
-  }
-}
diff --git a/tests/src/test/java/org/sonarqube/pageobjects/measures/MeasureContent.java b/tests/src/test/java/org/sonarqube/pageobjects/measures/MeasureContent.java
deleted file mode 100644 (file)
index 6c8e738..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2017 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.pageobjects.measures;
-
-import com.codeborne.selenide.ElementsCollection;
-import com.codeborne.selenide.SelenideElement;
-
-import static com.codeborne.selenide.Condition.exist;
-import static com.codeborne.selenide.Condition.text;
-
-public class MeasureContent {
-  private final SelenideElement elt;
-
-  public MeasureContent(SelenideElement elt) {
-    this.elt = elt;
-  }
-
-  public MeasureContent shouldHaveTitle(String title) {
-    this.elt.$(".measure-details-header .measure-details-metric").should(exist).shouldHave(text(title));
-    return this;
-  }
-
-  public MeasureContent shouldHaveHeaderValue(String value) {
-    this.elt.$(".measure-details-header .measure-details-value").should(exist).shouldHave(text(value));
-    return this;
-  }
-
-  public MeasureContent shouldHaveFile(String path) {
-    this.getFiles().find(text(path)).should(exist);
-    return this;
-  }
-
-  public MeasureContent drillDown(String item) {
-    this.getFiles().find(text(item)).should(exist).find("a").click();
-    return this;
-  }
-
-  public MeasureContent shouldDisplayCode() {
-    this.elt.$(".source-line-code").should(exist);
-    return this;
-  }
-
-  private ElementsCollection getFiles() {
-    return this.elt.$$(".measure-details-component-row");
-  }
-}
diff --git a/tests/src/test/java/org/sonarqube/pageobjects/measures/MeasuresPage.java b/tests/src/test/java/org/sonarqube/pageobjects/measures/MeasuresPage.java
deleted file mode 100644 (file)
index 414b7f8..0000000
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2017 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.pageobjects.measures;
-import com.codeborne.selenide.CollectionCondition;
-import com.codeborne.selenide.SelenideElement;
-import org.openqa.selenium.Keys;
-
-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 MeasuresPage {
-  public MeasuresPage() {
-    $("#component-measures").should(exist);
-  }
-
-  public MeasuresPage displayBubbleChart(String title) {
-    SelenideElement bubblechart = $("#component-measures .measure-overview-bubble-chart");
-    bubblechart.$(".measure-overview-bubble-chart-title").shouldHave(text(title));
-    return this;
-  }
-
-  public MeasuresPage measureHasValue(String measure, Integer value) {
-    SelenideElement sidebar = this.getSideBar();
-    sidebar.$("#measure-" + measure + "-name").should(exist);
-    sidebar.$("#measure-" + measure + "-value").should(exist).shouldHave(text(value.toString()));
-    return this;
-  }
-
-  public MeasuresPage measureHasLeak(String measure, Integer value) {
-    SelenideElement sidebar = this.getSideBar();
-    sidebar.$("#measure-" + measure + "-name").should(exist);
-    sidebar.$("#measure-" + measure + "-leak").should(exist).shouldHave(text(value.toString()));
-    return this;
-  }
-
-  public MeasuresPage breadcrumbsShouldHave(String item) {
-    $(".layout-page-header-panel .measure-breadcrumbs").shouldHave(text(item));
-    return this;
-  }
-
-  public MeasuresPage breadcrumbsShouldNotHave(String item) {
-    $(".layout-page-header-panel .measure-breadcrumbs").shouldNotHave(text(item));
-    return this;
-  }
-
-  public MeasuresPage backShortcut() {
-    $(".layout-page-header-panel").sendKeys(Keys.LEFT);
-    return this;
-  }
-
-  public MeasuresPage switchView(String view) {
-    SelenideElement select = $(".measure-view-select").should(exist);
-    select.click();
-    select.$(".Select-menu-outer").should(exist)
-      .$$(".Select-option").shouldHave(CollectionCondition.sizeGreaterThan(1))
-      .find(text(view)).should(exist).click();
-    return this;
-  }
-
-  public MeasuresPage openFacet(String facet) {
-    SelenideElement facetBox = $$(".search-navigator-facet-box").find(text(facet));
-    if(!facetBox.find("search-navigator-facet-list").isDisplayed()) {
-      facetBox.$(".search-navigator-facet-header a").should(exist).click();
-    }
-    return this;
-  }
-
-  public MeasureContent openMeasureContent(String measure) {
-    SelenideElement sidebar = this.getSideBar();
-    SelenideElement facetItem = sidebar.$("#measure-" + measure + "-name");
-    facetItem.click();
-    MeasureContent content = new MeasureContent($("#component-measures .measure-details-content").should(exist));
-    content.shouldHaveTitle(facetItem.getText());
-    return content;
-  }
-
-  private SelenideElement getSideBar() {
-    return $("#component-measures .layout-page-side").should(exist);
-  }
-}
diff --git a/tests/src/test/java/org/sonarqube/pageobjects/organization/MemberItem.java b/tests/src/test/java/org/sonarqube/pageobjects/organization/MemberItem.java
deleted file mode 100644 (file)
index 0de4be4..0000000
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2017 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.pageobjects.organization;
-
-import com.codeborne.selenide.CollectionCondition;
-import com.codeborne.selenide.Condition;
-import com.codeborne.selenide.ElementsCollection;
-import com.codeborne.selenide.SelenideElement;
-
-import static com.codeborne.selenide.Selenide.$;
-
-public class MemberItem {
-  private final SelenideElement elt;
-
-  public MemberItem(SelenideElement elt) {
-    this.elt = elt;
-  }
-
-  public MemberItem shouldBeNamed(String login, String name) {
-    ElementsCollection tds = this.elt.$$("td");
-    tds.get(1).$("strong").shouldHave(Condition.text(name));
-    tds.get(1).$("span").shouldHave(Condition.text(login));
-    return this;
-  }
-
-  public MemberItem shouldHaveGroups(Integer groups) {
-    ElementsCollection tds = this.elt.$$("td");
-    tds.get(2).should(Condition.exist);
-    tds.get(2).shouldHave(Condition.text(groups.toString()));
-    return this;
-  }
-
-  public MemberItem shouldNotHaveActions() {
-    this.elt.$$("td").shouldHave(CollectionCondition.sizeLessThan(3));
-    return this;
-  }
-
-  public MemberItem removeMembership() {
-    ElementsCollection tds = this.elt.$$("td");
-    tds.shouldHave(CollectionCondition.sizeGreaterThan(3));
-    SelenideElement actionTd = tds.get(3);
-    actionTd.$("button").should(Condition.exist).click();
-    actionTd.$$(".dropdown-menu > li").get(2).shouldBe(Condition.visible).click();
-    SelenideElement modal = getModal("Remove user");
-    modal.$("button.button-red").shouldBe(Condition.visible).click();
-    return this;
-  }
-
-  public MemberItem manageGroupsOpen() {
-    ElementsCollection tds = this.elt.$$("td");
-    tds.shouldHave(CollectionCondition.sizeGreaterThan(3));
-    SelenideElement actionTd = tds.get(3);
-    actionTd.$("button").should(Condition.exist).click();
-    actionTd.$$(".dropdown-menu > li").get(0).shouldBe(Condition.visible).click();
-    getModal("Manage groups");
-    return this;
-  }
-
-  public MemberItem manageGroupsSelect(String group) {
-    SelenideElement modal = getModal("Manage groups");
-    modal.$$("li").find(Condition.text(group)).shouldBe(Condition.visible).click();
-    return this;
-  }
-
-  public MemberItem manageGroupsSave() {
-    SelenideElement modal = getModal("Manage groups");
-    modal.$("button[type='submit']").shouldBe(Condition.visible).click();
-    return this;
-  }
-
-  private SelenideElement getModal(String title) {
-    $(".modal-head").should(Condition.exist).shouldHave(Condition.text(title));
-    SelenideElement form = $(".ReactModalPortal form");
-    form.should(Condition.exist);
-    return form;
-  }
-}
diff --git a/tests/src/test/java/org/sonarqube/pageobjects/organization/MembersPage.java b/tests/src/test/java/org/sonarqube/pageobjects/organization/MembersPage.java
deleted file mode 100644 (file)
index a6e6081..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2017 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.pageobjects.organization;
-
-import com.codeborne.selenide.Condition;
-import com.codeborne.selenide.ElementsCollection;
-import com.codeborne.selenide.SelenideElement;
-
-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 MembersPage {
-
-  public MembersPage() {
-    $(".navbar-tabs a.active").shouldBe(visible).shouldHave(text("Members"));
-  }
-
-  public ElementsCollection getMembers() {
-    return $$("table.data tr");
-  }
-
-  public MemberItem getMembersByIdx(Integer idx) {
-    return new MemberItem(getMembers().get(idx));
-  }
-
-  public MembersPage shouldHaveTotal(int total) {
-    $(".panel-vertical > span > strong").shouldHave(text(String.valueOf(total)));
-    return this;
-  }
-
-  public MembersPage searchForMember(String query) {
-    $(".page .search-box-input").shouldBe(visible).val("").sendKeys(query);
-    return this;
-  }
-
-  public MembersPage canAddMember() {
-    $(".page-actions").shouldBe(visible);
-    return this;
-  }
-
-  public MembersPage canNotAddMember() {
-    $(".page-actions").shouldNot(Condition.exist);
-    return this;
-  }
-
-  public MembersPage addMember(String login) {
-    this.canAddMember();
-    $(".page-actions button").click();
-
-    SelenideElement modal = this.getModal("Add user");
-    SelenideElement input = modal.$(".Select-input input");
-    input.val(login);
-    modal.$("div.Select-option.is-focused").should(Condition.exist);
-    input.pressEnter();
-    modal.$("button[type='submit']").click();
-    return this;
-  }
-
-  private SelenideElement getModal(String title) {
-    $(".modal-head").should(Condition.exist).shouldHave(text(title));
-    SelenideElement form = $(".ReactModalPortal form");
-    form.should(Condition.exist);
-    return form;
-  }
-}
diff --git a/tests/src/test/java/org/sonarqube/pageobjects/projects/FacetItem.java b/tests/src/test/java/org/sonarqube/pageobjects/projects/FacetItem.java
deleted file mode 100644 (file)
index ec3197c..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2017 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.pageobjects.projects;
-
-import com.codeborne.selenide.Condition;
-import com.codeborne.selenide.SelenideElement;
-
-public class FacetItem {
-
-  private final SelenideElement elt;
-
-  public FacetItem(SelenideElement elt) {
-    this.elt = elt;
-  }
-
-  public FacetItem shouldHaveValue(String key, String value) {
-    this.elt.$(".facet[data-key=\"" + key + "\"] .facet-stat").shouldHave(Condition.text(value));
-    return this;
-  }
-
-  public void selectValue(String key) {
-    this.elt.$(".facet[data-key=\"" + key + "\"]").click();
-  }
-
-  public FacetItem selectOptionItem(String value) {
-    SelenideElement selectInput = this.elt.$(".Select-input input");
-    selectInput.val(value);
-    this.elt.$("div.Select-option.is-focused").should(Condition.exist);
-    selectInput.pressEnter();
-    return this;
-  }
-}
diff --git a/tests/src/test/java/org/sonarqube/pageobjects/projects/ProjectItem.java b/tests/src/test/java/org/sonarqube/pageobjects/projects/ProjectItem.java
deleted file mode 100644 (file)
index 6261efa..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2017 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.pageobjects.projects;
-
-import com.codeborne.selenide.Condition;
-import com.codeborne.selenide.SelenideElement;
-
-public class ProjectItem {
-
-  private final SelenideElement elt;
-
-  public ProjectItem(SelenideElement elt) {
-    this.elt = elt;
-  }
-
-  public ProjectItem shouldHaveMeasure(String metricKey, String value) {
-    this.elt.$(".project-card-measure[data-key=\"" + metricKey + "\"]").shouldHave(Condition.text(value));
-    return this;
-  }
-}
diff --git a/tests/src/test/java/org/sonarqube/pageobjects/projects/ProjectsPage.java b/tests/src/test/java/org/sonarqube/pageobjects/projects/ProjectsPage.java
deleted file mode 100644 (file)
index 767c2fb..0000000
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2017 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.pageobjects.projects;
-
-import com.codeborne.selenide.Condition;
-import com.codeborne.selenide.ElementsCollection;
-import com.codeborne.selenide.SelenideElement;
-
-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.$$;
-import static com.codeborne.selenide.WebDriverRunner.url;
-import static org.assertj.core.api.Assertions.assertThat;
-
-public class ProjectsPage {
-
-  public ProjectsPage() {
-    $("#projects-page").shouldBe(visible);
-  }
-
-  public ElementsCollection getProjects() {
-    return $$(".projects-list > .boxed-group");
-  }
-
-  public ElementsCollection getFacets() {
-    return $$(".search-navigator-facet-box");
-  }
-
-  public ProjectItem getProjectByKey(String projectKey) {
-    SelenideElement element = getProjects().find(Condition.attribute("data-key", projectKey));
-    return new ProjectItem(element);
-  }
-
-  public ProjectItem getProjectByIdx(Integer idx) {
-    return new ProjectItem(getProjects().get(idx));
-  }
-
-  public FacetItem getFacetByProperty(String facetProperty) {
-    SelenideElement element = getFacets().find(Condition.attribute("data-key", facetProperty));
-    return new FacetItem(element);
-  }
-
-  public ProjectsPage shouldHaveTotal(int total) {
-    // warning - number is localized
-    $("#projects-total").shouldHave(text(String.valueOf(total)));
-    return this;
-  }
-
-  public ProjectsPage shouldDisplayAllProjects() {
-    assertThat(url()).endsWith("/projects");
-    return this;
-  }
-
-  public ProjectsPage shouldDisplayAllProjectsWidthSort(String sort) {
-    assertThat(url()).endsWith("/projects?sort=" + sort);
-    return this;
-  }
-
-  public ProjectsPage shouldDisplayFavoriteProjects() {
-    assertThat(url()).endsWith("/projects/favorite");
-    return this;
-  }
-
-  public ProjectsPage selectAllProjects() {
-    $("#all-projects").click();
-    return shouldDisplayAllProjects();
-  }
-
-  public ProjectsPage selectFavoriteProjects() {
-    $("#favorite-projects").click();
-    return shouldDisplayFavoriteProjects();
-  }
-
-  public ProjectsPage searchProject(String search) {
-    SelenideElement searchInput = $(".projects-topbar-item-search input");
-    searchInput.setValue("").sendKeys(search);
-    return this;
-  }
-
-  public ProjectsPage changePerspective(String perspective) {
-    SelenideElement sortSelect = getOpenTopBar().$(".js-projects-perspective-select");
-    sortSelect.$(".Select-value").should(Condition.exist).click();
-    sortSelect.$(".Select-option[title='" + perspective + "']").should(Condition.exist).click();
-    return this;
-  }
-
-  public ProjectsPage sortProjects(String sort) {
-    SelenideElement sortSelect = getOpenTopBar().$(".js-projects-sorting-select");
-    sortSelect.$(".Select-value").should(Condition.exist).click();
-    sortSelect.$(".Select-option[title='" + sort + "']").should(Condition.exist).click();
-    return this;
-  }
-
-  public ProjectsPage invertSorting() {
-    getOpenTopBar().$(".js-projects-sorting-invert").should(Condition.exist).click();
-    return this;
-  }
-
-  private SelenideElement getOpenTopBar() {
-    return $(".projects-topbar-items").should(Condition.exist);
-  }
-}
diff --git a/tests/src/test/java/org/sonarqube/pageobjects/settings/PropertySetInput.java b/tests/src/test/java/org/sonarqube/pageobjects/settings/PropertySetInput.java
deleted file mode 100644 (file)
index 4f1c7db..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2017 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.pageobjects.settings;
-
-import com.codeborne.selenide.SelenideElement;
-
-import static com.codeborne.selenide.Condition.exist;
-
-public class PropertySetInput {
-
-  private final SelenideElement elt;
-
-  public PropertySetInput(SelenideElement elt) {
-    this.elt = elt;
-  }
-
-  public PropertySetInput setFieldValue(int index, String fieldKey, String value) {
-    elt.findAll("input[name$=\"[" + fieldKey + "]\"]").get(index).val(value);
-    return this;
-  }
-
-  public PropertySetInput setFieldValue(String fieldKey, String value) {
-    return setFieldValue(0, fieldKey, value);
-  }
-
-  public PropertySetInput save() {
-    elt.find(".js-save-changes").click();
-    elt.find(".js-save-changes").shouldNot(exist);
-    return this;
-  }
-}
diff --git a/tests/src/test/java/org/sonarqube/pageobjects/settings/SettingsPage.java b/tests/src/test/java/org/sonarqube/pageobjects/settings/SettingsPage.java
deleted file mode 100644 (file)
index 1d1af88..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2017 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.pageobjects.settings;
-
-import com.codeborne.selenide.SelenideElement;
-import org.openqa.selenium.By;
-
-import static com.codeborne.selenide.Condition.cssClass;
-import static com.codeborne.selenide.Condition.exactValue;
-import static com.codeborne.selenide.Condition.exist;
-import static com.codeborne.selenide.Condition.visible;
-import static com.codeborne.selenide.Selenide.$;
-
-public class SettingsPage {
-
-  public SettingsPage() {
-    $("#settings-page").shouldBe(visible);
-  }
-
-  public SettingsPage assertMenuContains(String categoryName) {
-    $(".side-tabs-menu").$(By.linkText(categoryName)).shouldBe(visible);
-    return this;
-  }
-
-  public SettingsPage assertSettingDisplayed(String settingKey) {
-    $(".settings-definition[data-key='" + settingKey + "']").shouldBe(visible);
-    return this;
-  }
-
-  public SettingsPage assertSettingNotDisplayed(String settingKey) {
-    $(".settings-definition[data-key='" + settingKey + "']").shouldNotBe(visible);
-    return this;
-  }
-
-  public SettingsPage openCategory(String categoryName) {
-    $(".side-tabs-menu").$(By.linkText(categoryName)).click();
-    return this;
-  }
-
-  public SettingsPage assertStringSettingValue(String settingKey, String value) {
-    $("input[name=\"settings[" + settingKey + "]\"]").shouldHave(exactValue(value));
-    return this;
-  }
-
-  public SettingsPage assertBooleanSettingValue(String settingKey, boolean value) {
-    SelenideElement toggle = $("button[name=\"settings[" + settingKey + "]\"]");
-    if (value) {
-      toggle.shouldHave(cssClass("boolean-toggle-on"));
-    } else {
-      toggle.shouldNotHave(cssClass("boolean-toggle-on"));
-    }
-    return this;
-  }
-
-  public SettingsPage setStringValue(String settingKey, String value) {
-    SelenideElement setting = $(".settings-definition[data-key=\"" + settingKey + "\"]");
-    setting.find("input").val(value);
-    setting.find(".js-save-changes").click();
-    setting.find(".js-save-changes").shouldNot(exist);
-    return this;
-  }
-
-  public PropertySetInput getPropertySetInput(String settingKey) {
-    SelenideElement setting = $(".settings-definition[data-key=\"" + settingKey + "\"]");
-    return new PropertySetInput(setting);
-  }
-}
index 43ea1fe380bc2e2ab237ab10ad2210d3729dc1e0..8f5e58ffbbc59fdcfee228e891c29758a8cc12f7 100644 (file)
@@ -23,7 +23,7 @@ import com.sonar.orchestrator.Orchestrator;
 import javax.annotation.Nullable;
 import org.apache.commons.lang.StringUtils;
 import org.junit.rules.ExternalResource;
-import org.sonarqube.pageobjects.Navigation;
+import org.sonarqube.qa.util.pageobjects.Navigation;
 import org.sonarqube.ws.client.WsClient;
 import util.selenium.Selenese;
 
index cc3829b78e253931bd0afc8bc1567c5e5207dc05..e3065647298e0a51e0035b7c969232f3df202016 100644 (file)
@@ -26,9 +26,9 @@ import org.junit.BeforeClass;
 import org.junit.ClassRule;
 import org.junit.Rule;
 import org.junit.Test;
-import org.sonarqube.pageobjects.Navigation;
-import org.sonarqube.pageobjects.issues.Issue;
-import org.sonarqube.pageobjects.issues.IssuesPage;
+import org.sonarqube.qa.util.pageobjects.Navigation;
+import org.sonarqube.qa.util.pageobjects.issues.Issue;
+import org.sonarqube.qa.util.pageobjects.issues.IssuesPage;
 import util.ItUtils;
 import util.user.UserRule;
 
index 683b808fbbed334760636b57320649f71a1ad753..a9e5bcf3eee8bc7cf14072444dfabbdb7134fac7 100644 (file)
@@ -38,7 +38,7 @@ import org.sonarqube.ws.client.issue.BulkChangeRequest;
 import org.sonarqube.ws.client.issue.SearchWsRequest;
 import org.sonarqube.ws.client.project.CreateRequest;
 import org.sonarqube.ws.client.qualityprofile.AddProjectRequest;
-import org.sonarqube.pageobjects.issues.IssuesPage;
+import org.sonarqube.qa.util.pageobjects.issues.IssuesPage;
 import util.issue.IssueRule;
 
 import static java.lang.String.format;
index 979467ee6935fa5347400e906a7b664471bcd27f..df0e4c58dd9bc5de6f7c752285f5397ffa5777b5 100644 (file)
@@ -25,7 +25,7 @@ import org.junit.Before;
 import org.junit.ClassRule;
 import org.junit.Rule;
 import org.junit.Test;
-import org.sonarqube.pageobjects.Navigation;
+import org.sonarqube.qa.util.pageobjects.Navigation;
 import org.sonarqube.tests.Category6Suite;
 import org.sonarqube.tests.Tester;
 import org.sonarqube.ws.Organizations;
index 220be947dcdbabc961d891b27c2d80ef01b9f34f..83dc231470c92872820173411cf200cf2dd75aee 100644 (file)
@@ -24,8 +24,8 @@ import org.junit.After;
 import org.junit.ClassRule;
 import org.junit.Rule;
 import org.junit.Test;
-import org.sonarqube.pageobjects.MarketplacePage;
-import org.sonarqube.pageobjects.Navigation;
+import org.sonarqube.qa.util.pageobjects.MarketplacePage;
+import org.sonarqube.qa.util.pageobjects.Navigation;
 import util.user.UserRule;
 
 import static util.ItUtils.pluginArtifact;
index 8df93be6cf6d9caa70fda18383ef9a56522305f4..a9b2b814ea3c7e7d12cd9a86fb141f2bb07995f7 100644 (file)
@@ -29,7 +29,7 @@ import org.junit.ClassRule;
 import org.junit.Rule;
 import org.junit.Test;
 import org.sonarqube.ws.client.WsClient;
-import org.sonarqube.pageobjects.Navigation;
+import org.sonarqube.qa.util.pageobjects.Navigation;
 import util.ItUtils;
 import util.user.UserRule;
 
index 956c8e7f109dcd43a5ae45f36d9959881fc0b6f0..02d59fa72226fdc0960cac3d5154a7a804c9fa2b 100644 (file)
@@ -30,14 +30,13 @@ import org.junit.Test;
 import org.openqa.selenium.Keys;
 import org.sonarqube.ws.client.PostRequest;
 import org.sonarqube.ws.client.WsClient;
-import org.sonarqube.pageobjects.Navigation;
-import org.sonarqube.pageobjects.ProjectDashboardPage;
+import org.sonarqube.qa.util.pageobjects.Navigation;
+import org.sonarqube.qa.util.pageobjects.ProjectDashboardPage;
 import util.user.UserRule;
 
 import static com.codeborne.selenide.Condition.exist;
 import static com.codeborne.selenide.Condition.hasText;
 import static com.codeborne.selenide.Condition.text;
-import static com.codeborne.selenide.Condition.visible;
 import static util.ItUtils.newAdminWsClient;
 import static util.ItUtils.projectDir;
 import static util.selenium.Selenese.runSelenese;
index f2466a2b3d724a273e525fc925129b17b4168345..2ea1009b617e71dc5cebe0f8b393978716e2986c 100644 (file)
@@ -25,9 +25,9 @@ import org.junit.Before;
 import org.junit.ClassRule;
 import org.junit.Rule;
 import org.junit.Test;
-import org.sonarqube.pageobjects.Navigation;
-import org.sonarqube.pageobjects.measures.MeasureContent;
-import org.sonarqube.pageobjects.measures.MeasuresPage;
+import org.sonarqube.qa.util.pageobjects.Navigation;
+import org.sonarqube.qa.util.pageobjects.measures.MeasureContent;
+import org.sonarqube.qa.util.pageobjects.measures.MeasuresPage;
 import org.sonarqube.tests.Category1Suite;
 import org.sonarqube.tests.Tester;
 
index 22d209954e3c9f4f0489b356c2ecb2f00a532a3c..730298db1e6ef59c5ee7fafecf18abe9af8c475f 100644 (file)
@@ -36,7 +36,7 @@ import org.sonarqube.ws.client.WsResponse;
 import org.sonarqube.ws.client.organization.UpdateProjectVisibilityWsRequest;
 import org.sonarqube.ws.client.project.CreateRequest;
 import org.sonarqube.ws.client.project.UpdateVisibilityRequest;
-import org.sonarqube.pageobjects.Navigation;
+import org.sonarqube.qa.util.pageobjects.Navigation;
 import util.ItUtils;
 
 import static java.lang.String.format;
index a3a47279ed7c0159f9f810bd0fa5d3bbc9c0602a..817248a14fb54eb83f035614d630957af721b671 100644 (file)
@@ -26,7 +26,7 @@ import org.junit.Before;
 import org.junit.ClassRule;
 import org.junit.Rule;
 import org.junit.Test;
-import org.sonarqube.pageobjects.organization.MembersPage;
+import org.sonarqube.qa.util.pageobjects.organization.MembersPage;
 import org.sonarqube.tests.Category6Suite;
 import org.sonarqube.tests.Tester;
 import org.sonarqube.ws.Organizations.Organization;
index 0c4e916ebf783dd37e36cf1ae641ac5a71361613..0e7eee2e78341a9219657b642493a708cfb3f6f8 100644 (file)
@@ -28,9 +28,9 @@ import org.junit.BeforeClass;
 import org.junit.ClassRule;
 import org.junit.Rule;
 import org.junit.Test;
-import org.sonarqube.pageobjects.BackgroundTaskItem;
-import org.sonarqube.pageobjects.BackgroundTasksPage;
-import org.sonarqube.pageobjects.Navigation;
+import org.sonarqube.qa.util.pageobjects.BackgroundTaskItem;
+import org.sonarqube.qa.util.pageobjects.BackgroundTasksPage;
+import org.sonarqube.qa.util.pageobjects.Navigation;
 import util.user.UserRule;
 
 import static com.codeborne.selenide.CollectionCondition.sizeGreaterThan;
index b2f72b1017c152b118f5045e84328983e13326fa..88f75d55db56dbd520229f11a5dfa931ffafb68f 100644 (file)
@@ -38,9 +38,9 @@ import org.openqa.selenium.By;
 import org.sonar.wsclient.SonarClient;
 import org.sonar.wsclient.base.HttpException;
 import org.sonar.wsclient.user.UserParameters;
-import org.sonarqube.pageobjects.Navigation;
-import org.sonarqube.pageobjects.ProjectsManagementPage;
-import org.sonarqube.pageobjects.settings.SettingsPage;
+import org.sonarqube.qa.util.pageobjects.Navigation;
+import org.sonarqube.qa.util.pageobjects.ProjectsManagementPage;
+import org.sonarqube.qa.util.pageobjects.settings.SettingsPage;
 import org.sonarqube.tests.Category1Suite;
 import org.sonarqube.tests.Tester;
 import org.sonarqube.ws.WsPermissions;
index fb9572d374818f7b3a16a7f2afde4b679891f87d..b907898c6eebe9286371f4c2b2b6815635f1e054 100644 (file)
@@ -28,8 +28,8 @@ import org.junit.ClassRule;
 import org.junit.Test;
 import org.sonarqube.ws.client.PostRequest;
 import org.sonarqube.ws.client.WsClient;
-import org.sonarqube.pageobjects.Navigation;
-import org.sonarqube.pageobjects.ProjectKeyPage;
+import org.sonarqube.qa.util.pageobjects.Navigation;
+import org.sonarqube.qa.util.pageobjects.ProjectKeyPage;
 
 import static com.codeborne.selenide.Condition.visible;
 import static com.codeborne.selenide.Selenide.$;
index 5cb04c3b4e80fee17c067d5428cb331008bc0695..b6ad18a16b5814595f832bf972808e41fce34044 100644 (file)
@@ -34,9 +34,9 @@ import org.sonarqube.ws.WsProjectLinks.CreateWsResponse;
 import org.sonarqube.ws.client.WsClient;
 import org.sonarqube.ws.client.projectlinks.CreateWsRequest;
 import org.sonarqube.ws.client.projectlinks.DeleteWsRequest;
-import org.sonarqube.pageobjects.Navigation;
-import org.sonarqube.pageobjects.ProjectLinkItem;
-import org.sonarqube.pageobjects.ProjectLinksPage;
+import org.sonarqube.qa.util.pageobjects.Navigation;
+import org.sonarqube.qa.util.pageobjects.ProjectLinkItem;
+import org.sonarqube.qa.util.pageobjects.ProjectLinksPage;
 import util.user.UserRule;
 
 import static com.codeborne.selenide.Condition.hasText;
index 2184a9a950649e3dcf1fb19eaa5094053eea5151..410df9fa17136237270e957bd62e0fe0b19ede61 100644 (file)
@@ -27,8 +27,8 @@ import org.junit.BeforeClass;
 import org.junit.ClassRule;
 import org.junit.Rule;
 import org.junit.Test;
-import org.sonarqube.pageobjects.Navigation;
-import org.sonarqube.pageobjects.ProjectPermissionsPage;
+import org.sonarqube.qa.util.pageobjects.Navigation;
+import org.sonarqube.qa.util.pageobjects.ProjectPermissionsPage;
 import util.user.UserRule;
 
 import static util.ItUtils.projectDir;
index 438d239d6c91878d67932ef351935e1ee78d8ce6..6a3bdbbe8bcfeaa91184186b8cdd36b487b1db76 100644 (file)
@@ -33,8 +33,8 @@ import org.sonar.wsclient.qualitygate.QualityGateClient;
 import org.sonarqube.ws.client.PostRequest;
 import org.sonarqube.ws.client.WsClient;
 import org.sonarqube.ws.client.qualitygate.SelectWsRequest;
-import org.sonarqube.pageobjects.Navigation;
-import org.sonarqube.pageobjects.ProjectQualityGatePage;
+import org.sonarqube.qa.util.pageobjects.Navigation;
+import org.sonarqube.qa.util.pageobjects.ProjectQualityGatePage;
 
 import static util.ItUtils.newAdminWsClient;
 
index 438d2ea7a369ce0bf39118a321f6e04634cf7fff..d5b4b12baaf93c4a05b84ca6ecd3e6c240394d4b 100644 (file)
@@ -31,8 +31,8 @@ import org.sonarqube.ws.WsComponents;
 import org.sonarqube.ws.client.component.SearchProjectsRequest;
 import org.sonarqube.ws.client.permission.RemoveGroupWsRequest;
 import org.sonarqube.ws.client.project.UpdateVisibilityRequest;
-import org.sonarqube.pageobjects.Navigation;
-import org.sonarqube.pageobjects.ProjectsManagementPage;
+import org.sonarqube.qa.util.pageobjects.Navigation;
+import org.sonarqube.qa.util.pageobjects.ProjectsManagementPage;
 import util.user.UserRule;
 
 import static org.assertj.core.api.Assertions.assertThat;
index d6514a930f0d570797a3589bc36b30562ec30785..7261e43d0834b27dbc811244082cf6da12261a2c 100644 (file)
@@ -27,9 +27,9 @@ import org.junit.Before;
 import org.junit.ClassRule;
 import org.junit.Rule;
 import org.junit.Test;
-import org.sonarqube.pageobjects.Navigation;
-import org.sonarqube.pageobjects.ProjectActivityPage;
-import org.sonarqube.pageobjects.ProjectAnalysisItem;
+import org.sonarqube.qa.util.pageobjects.Navigation;
+import org.sonarqube.qa.util.pageobjects.ProjectActivityPage;
+import org.sonarqube.qa.util.pageobjects.ProjectAnalysisItem;
 import util.user.UserRule;
 
 import static util.ItUtils.projectDir;
index 3bbe47d117457b3c882a5868795b05ad4bc9d4de..b09816c222cc4acb96ee3b0cd352f9125dec01e6 100644 (file)
@@ -33,7 +33,7 @@ import org.junit.Rule;
 import org.junit.Test;
 import org.sonarqube.tests.Tester;
 import org.sonarqube.ws.Organizations.Organization;
-import org.sonarqube.pageobjects.projects.ProjectsPage;
+import org.sonarqube.qa.util.pageobjects.projects.ProjectsPage;
 
 import static com.codeborne.selenide.WebDriverRunner.url;
 import static java.util.Arrays.asList;
index cdd2e9b97d2139c2f7020ccb9a49b2a17f5c4078..1a9b5a4a0a4439ef34d70949037afd33328bf154 100644 (file)
@@ -27,8 +27,8 @@ import org.junit.BeforeClass;
 import org.junit.ClassRule;
 import org.junit.Test;
 import org.junit.rules.RuleChain;
-import org.sonarqube.pageobjects.Navigation;
-import org.sonarqube.pageobjects.projects.ProjectsPage;
+import org.sonarqube.qa.util.pageobjects.Navigation;
+import org.sonarqube.qa.util.pageobjects.projects.ProjectsPage;
 import org.sonarqube.tests.Category1Suite;
 import org.sonarqube.tests.Tester;
 import org.sonarqube.ws.WsUsers;
index fc846cb244f054755fef03a08cf3fe99a588e276..02e99e90a8878771bd0edec4ef75373259bca332 100644 (file)
@@ -27,8 +27,8 @@ import org.junit.ClassRule;
 import org.junit.Rule;
 import org.junit.Test;
 import org.openqa.selenium.By;
-import org.sonarqube.pageobjects.ProjectDashboardPage;
-import org.sonarqube.pageobjects.QualityGatePage;
+import org.sonarqube.qa.util.pageobjects.ProjectDashboardPage;
+import org.sonarqube.qa.util.pageobjects.QualityGatePage;
 import org.sonarqube.tests.Category6Suite;
 import org.sonarqube.tests.Tester;
 import org.sonarqube.ws.Organizations;
index 132e081054c1f1758c2857cebc2e614c9c0e9583..5c342390d41fd2390790006690bdc597dddacd0c 100644 (file)
@@ -31,8 +31,8 @@ import org.junit.ClassRule;
 import org.junit.Rule;
 import org.junit.Test;
 import org.openqa.selenium.By;
-import org.sonarqube.pageobjects.Navigation;
-import org.sonarqube.pageobjects.ProjectActivityPage;
+import org.sonarqube.qa.util.pageobjects.Navigation;
+import org.sonarqube.qa.util.pageobjects.ProjectActivityPage;
 import org.sonarqube.tests.Category1Suite;
 import org.sonarqube.tests.Tester;
 import org.sonarqube.ws.WsProjects.CreateWsResponse.Project;
index 1414b129683f2de0475440added5d3c23b47c2ba..5a55561549cb582a38bcc18509d7861e6db210ee 100644 (file)
@@ -27,9 +27,9 @@ import org.junit.ClassRule;
 import org.junit.Ignore;
 import org.junit.Rule;
 import org.junit.Test;
-import org.sonarqube.pageobjects.Navigation;
-import org.sonarqube.pageobjects.QualityProfilePage;
-import org.sonarqube.pageobjects.RulesPage;
+import org.sonarqube.qa.util.pageobjects.Navigation;
+import org.sonarqube.qa.util.pageobjects.QualityProfilePage;
+import org.sonarqube.qa.util.pageobjects.RulesPage;
 import org.sonarqube.tests.Category6Suite;
 import org.sonarqube.tests.Tester;
 import org.sonarqube.ws.Organizations.Organization;
index f67a20b0acd60f99d864661c1f8c31190cba9065..5ad0041e602a66e6d43008897cb4c0fed72845d3 100644 (file)
@@ -28,7 +28,7 @@ import org.junit.ClassRule;
 import org.junit.Ignore;
 import org.junit.Rule;
 import org.junit.Test;
-import org.sonarqube.pageobjects.Navigation;
+import org.sonarqube.qa.util.pageobjects.Navigation;
 import org.sonarqube.tests.Category4Suite;
 import org.sonarqube.tests.Tester;
 import org.sonarqube.ws.client.PostRequest;
index 07e76dcc2c6131cc8ecd830d1190681c6b06e58e..527dbe423ce5bb2fe07bbc5266a5f8c6f79dbd7d 100644 (file)
@@ -23,7 +23,7 @@ import com.sonar.orchestrator.Orchestrator;
 import org.junit.ClassRule;
 import org.junit.Rule;
 import org.junit.Test;
-import org.sonarqube.pageobjects.RulesPage;
+import org.sonarqube.qa.util.pageobjects.RulesPage;
 import org.sonarqube.tests.Category2Suite;
 import org.sonarqube.tests.Tester;
 
index ae11a552e858f2aedc934d727450852d9f79a3d6..60065d7195487969924d9d5d31d4db8077e7d833 100644 (file)
@@ -27,7 +27,7 @@ import org.apache.commons.io.FileUtils;
 import org.junit.ClassRule;
 import org.junit.Rule;
 import org.junit.Test;
-import org.sonarqube.pageobjects.SystemInfoPage;
+import org.sonarqube.qa.util.pageobjects.SystemInfoPage;
 import org.sonarqube.tests.Category4Suite;
 import org.sonarqube.tests.Tester;
 import org.sonarqube.ws.client.GetRequest;
index d30b68168e33766bbbc4703d16c1159d5d346e29..a6241c793742fe894f3cafc7c994c64c1d4ea15a 100644 (file)
@@ -34,8 +34,8 @@ import org.sonarqube.ws.Settings;
 import org.sonarqube.ws.client.setting.SetRequest;
 import org.sonarqube.ws.client.setting.SettingsService;
 import org.sonarqube.ws.client.setting.ValuesRequest;
-import org.sonarqube.pageobjects.Navigation;
-import org.sonarqube.pageobjects.settings.SettingsPage;
+import org.sonarqube.qa.util.pageobjects.Navigation;
+import org.sonarqube.qa.util.pageobjects.settings.SettingsPage;
 import util.user.UserRule;
 
 import static com.google.common.collect.Lists.newArrayList;
index 60d690257e95f51168f96c540a47304c488bf2da..19c40338289d5e536d439361a4bd4a5ce2d5c215 100644 (file)
@@ -27,8 +27,8 @@ import org.junit.After;
 import org.junit.Rule;
 import org.junit.Test;
 import org.junit.rules.ExpectedException;
-import org.sonarqube.pageobjects.EncryptionPage;
-import org.sonarqube.pageobjects.Navigation;
+import org.sonarqube.qa.util.pageobjects.EncryptionPage;
+import org.sonarqube.qa.util.pageobjects.Navigation;
 import util.user.UserRule;
 
 import static com.codeborne.selenide.Condition.visible;
index 64ff14517406230807d9bb3322196022a236dab5..f37daa3229f4ba2b4119b4ae008593d267ef6c42 100644 (file)
@@ -25,7 +25,7 @@ import org.sonarqube.tests.Category4Suite;
 import org.junit.BeforeClass;
 import org.junit.ClassRule;
 import org.junit.Test;
-import org.sonarqube.pageobjects.Navigation;
+import org.sonarqube.qa.util.pageobjects.Navigation;
 
 import static com.codeborne.selenide.Condition.exist;
 import static com.codeborne.selenide.Selenide.$;
index 040498df101addd2f3fa50f814018e0a034501ac..050960d843fc44281a0177bb5ab8865456050cf0 100644 (file)
@@ -29,7 +29,7 @@ import org.junit.ClassRule;
 import org.junit.Test;
 import org.sonarqube.ws.client.GetRequest;
 import org.sonarqube.ws.client.WsResponse;
-import org.sonarqube.pageobjects.Navigation;
+import org.sonarqube.qa.util.pageobjects.Navigation;
 import util.ItUtils;
 
 import static com.codeborne.selenide.Condition.exist;
index 65cd095d28516dc795af7271e37b5fea0388ded0..bcd7384dfaeda1020774586dd32f3e473fb407d8 100644 (file)
@@ -22,7 +22,6 @@ package org.sonarqube.tests.user;
 import com.google.common.base.Joiner;
 import com.google.common.base.Optional;
 import com.sonar.orchestrator.Orchestrator;
-import org.sonarqube.tests.Category4Suite;
 import java.io.File;
 import org.apache.commons.io.FileUtils;
 import org.junit.After;
@@ -30,10 +29,11 @@ import org.junit.Before;
 import org.junit.BeforeClass;
 import org.junit.ClassRule;
 import org.junit.Test;
+import org.sonarqube.qa.util.pageobjects.Navigation;
+import org.sonarqube.tests.Category4Suite;
 import org.sonarqube.ws.client.GetRequest;
 import org.sonarqube.ws.client.WsClient;
 import org.sonarqube.ws.client.user.CreateRequest;
-import org.sonarqube.pageobjects.Navigation;
 import util.user.UserRule;
 import util.user.Users;
 
index 1f0ae8f71eea0ec1d2fff50221969f0026a929cf..7d731b7b773ef3619ec7af09e1a929207cc53510 100644 (file)
@@ -34,7 +34,7 @@ import org.sonarqube.ws.client.WsClient;
 import org.sonarqube.ws.client.WsConnector;
 import org.sonarqube.ws.client.WsRequest;
 import org.sonarqube.ws.client.WsResponse;
-import org.sonarqube.pageobjects.Navigation;
+import org.sonarqube.qa.util.pageobjects.Navigation;
 
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.sonarqube.ws.client.WsRequest.Method.GET;
index 7c17b06599a5e7f19932ad65b6805074313003e3..8dc84a3ad2e4c0a0ac18067ee2c221c29db8f17c 100644 (file)
@@ -26,8 +26,8 @@ import org.junit.After;
 import org.junit.ClassRule;
 import org.junit.Rule;
 import org.junit.Test;
-import org.sonarqube.pageobjects.LoginPage;
-import org.sonarqube.pageobjects.Navigation;
+import org.sonarqube.qa.util.pageobjects.LoginPage;
+import org.sonarqube.qa.util.pageobjects.Navigation;
 import org.sonarqube.tests.Category4Suite;
 import org.sonarqube.tests.Tester;
 import org.sonarqube.ws.WsUserTokens;
index de2c4a992d3f98c583adc223a437102586f411b2..58877d221e269a925eadd6afbfd7b6f3c0d95ca5 100644 (file)
@@ -21,15 +21,15 @@ package org.sonarqube.tests.user;
 
 import com.sonar.orchestrator.Orchestrator;
 import com.sonar.orchestrator.build.SonarScanner;
-import org.sonarqube.tests.Category4Suite;
 import org.junit.Before;
 import org.junit.ClassRule;
 import org.junit.Rule;
 import org.junit.Test;
+import org.sonarqube.qa.util.pageobjects.Navigation;
+import org.sonarqube.tests.Category4Suite;
 import org.sonarqube.tests.Tester;
 import org.sonarqube.ws.WsUsers.CreateWsResponse.User;
 import org.sonarqube.ws.client.PostRequest;
-import org.sonarqube.pageobjects.Navigation;
 
 import static com.codeborne.selenide.Condition.text;
 import static com.codeborne.selenide.Condition.visible;
index 65312825703defa12dec68500954953a881e0b77..62eb79412c2a2d223f46a78f2a12c5e600c981dc 100644 (file)
@@ -32,7 +32,7 @@ import org.junit.Before;
 import org.junit.ClassRule;
 import org.junit.Rule;
 import org.junit.Test;
-import org.sonarqube.pageobjects.Navigation;
+import org.sonarqube.qa.util.pageobjects.Navigation;
 import org.sonarqube.tests.Category4Suite;
 import org.sonarqube.tests.Tester;
 import org.sonarqube.ws.WsUsers.SearchWsResponse.User;
index 12de1b740af2679f996a4697e8b7a1b30e8914d6..f1ed633686cba3ec448b72198e33cebe65218d24 100644 (file)
@@ -36,7 +36,7 @@ import org.sonar.wsclient.base.HttpException;
 import org.sonar.wsclient.connectors.HttpClient4Connector;
 import org.sonar.wsclient.services.AuthenticationQuery;
 import org.sonar.wsclient.user.UserParameters;
-import org.sonarqube.pageobjects.SystemInfoPage;
+import org.sonarqube.qa.util.pageobjects.SystemInfoPage;
 import org.sonarqube.tests.Tester;
 import org.sonarqube.ws.client.GetRequest;
 import org.sonarqube.ws.client.WsResponse;
index 96cc4e609a2c2e0fcf99200148966469a461b0e0..67b2ad67fe82202de450e125a47479ce0ac6497e 100644 (file)
@@ -39,7 +39,7 @@ import org.openqa.selenium.WebElement;
 import org.openqa.selenium.logging.LogEntries;
 import org.openqa.selenium.logging.LogEntry;
 import org.openqa.selenium.logging.LogType;
-import org.sonarqube.pageobjects.SelenideConfig;
+import org.sonarqube.qa.util.SelenideConfig;
 
 import static java.nio.charset.StandardCharsets.UTF_8;
 import static java.util.Objects.requireNonNull;