aboutsummaryrefslogtreecommitdiffstats
path: root/it
diff options
context:
space:
mode:
Diffstat (limited to 'it')
-rw-r--r--it/it-tests/src/test/java/it/ui/UiTest.java62
-rw-r--r--it/it-tests/src/test/java/pageobjects/LoginPage.java2
-rw-r--r--it/it-tests/src/test/java/pageobjects/ServerIdPage.java2
3 files changed, 64 insertions, 2 deletions
diff --git a/it/it-tests/src/test/java/it/ui/UiTest.java b/it/it-tests/src/test/java/it/ui/UiTest.java
index c4960f9192e..a2e71ebc4ef 100644
--- a/it/it-tests/src/test/java/it/ui/UiTest.java
+++ b/it/it-tests/src/test/java/it/ui/UiTest.java
@@ -20,6 +20,7 @@
package it.ui;
import com.sonar.orchestrator.Orchestrator;
+import com.sonar.orchestrator.build.SonarScanner;
import it.Category4Suite;
import java.util.Map;
import org.junit.ClassRule;
@@ -31,6 +32,12 @@ import pageobjects.Navigation;
import util.ItUtils;
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.WebDriverRunner.url;
+import static org.assertj.core.api.Assertions.assertThat;
+import static util.ItUtils.projectDir;
public class UiTest {
@@ -54,4 +61,59 @@ public class UiTest {
nav.getFooter().should(hasText((String) statusMap.get("version")));
}
+
+ @Test
+ public void many_page_transitions() {
+ analyzeSampleProject();
+
+ nav.open("/about");
+
+ // on about page
+ $(".about-page-projects-link")
+ .shouldBe(visible)
+ .shouldHave(text("1"))
+ .click();
+
+ // on projects page
+ assertThat(url()).contains("/projects");
+ $(".project-card-name")
+ .shouldBe(visible)
+ .shouldHave(text("Sample"))
+ .find("a")
+ .click();
+
+ // on project dashboard
+ assertThat(url()).contains("/dashboard?id=sample");
+ $(".overview-quality-gate")
+ .shouldBe(visible)
+ .shouldHave(text("Passed"));
+ $("a[href=\"/component_issues?id=sample#resolved=false|types=CODE_SMELL\"]")
+ .shouldBe(visible)
+ .shouldHave(text("0"))
+ .click();
+
+ // on project issues page
+ assertThat(url()).contains("/component_issues?id=sample#resolved=false|types=CODE_SMELL");
+ $(".facet.active[data-unresolved]").shouldBe(visible);
+
+ $("#global-navigation").find("a[href=\"/profiles\"]").click();
+
+ // on quality profiles page
+ assertThat(url()).contains("/profiles");
+ $("table[data-language=xoo]").find("tr[data-name=Basic]").find(".quality-profiles-table-name")
+ .shouldBe(visible)
+ .shouldHave(text("Basic"))
+ .find("a")
+ .click();
+
+ // on profile page
+ assertThat(url()).contains("/profiles/show?key=xoo-basic");
+ $(".quality-profile-inheritance")
+ .shouldBe(visible)
+ .shouldHave(text("1 active rules"));
+ }
+
+ private static void analyzeSampleProject() {
+ ORCHESTRATOR.executeBuild(SonarScanner.create(projectDir("shared/xoo-sample")));
+ }
}
diff --git a/it/it-tests/src/test/java/pageobjects/LoginPage.java b/it/it-tests/src/test/java/pageobjects/LoginPage.java
index 98e95b01df8..74d311409ab 100644
--- a/it/it-tests/src/test/java/pageobjects/LoginPage.java
+++ b/it/it-tests/src/test/java/pageobjects/LoginPage.java
@@ -48,7 +48,7 @@ public class LoginPage {
}
public SelenideElement getErrorMessage() {
- return $(By.cssSelector("#login_form .alert"));
+ return $(".process-spinner-failed");
}
private <T> T submitCredentials(String login, String password, Class<T> expectedResultPage) {
diff --git a/it/it-tests/src/test/java/pageobjects/ServerIdPage.java b/it/it-tests/src/test/java/pageobjects/ServerIdPage.java
index b7a9990a306..4b7db4c87b6 100644
--- a/it/it-tests/src/test/java/pageobjects/ServerIdPage.java
+++ b/it/it-tests/src/test/java/pageobjects/ServerIdPage.java
@@ -43,7 +43,7 @@ public class ServerIdPage {
}
public ServerIdPage assertError() {
- $(".alert-danger").shouldBe(visible);
+ $(".process-spinner-failed").shouldBe(visible);
return this;
}