aboutsummaryrefslogtreecommitdiffstats
path: root/it/it-tests
diff options
context:
space:
mode:
authorStas Vilchik <stas-vilchik@users.noreply.github.com>2017-05-09 17:53:29 +0200
committerGitHub <noreply@github.com>2017-05-09 17:53:29 +0200
commit72e45fffdea16673f257cb80b40269e73ccffaba (patch)
tree5684e5790e20da795b6f4f10c4343e42386364fb /it/it-tests
parent56fd51b9750c20b1c502789c37632d3e60012b0f (diff)
downloadsonarqube-72e45fffdea16673f257cb80b40269e73ccffaba.tar.gz
sonarqube-72e45fffdea16673f257cb80b40269e73ccffaba.zip
MMF-661 rework search (#2030)
Diffstat (limited to 'it/it-tests')
-rw-r--r--it/it-tests/src/test/java/it/user/BaseIdentityProviderTest.java3
-rw-r--r--it/it-tests/src/test/java/it/user/LocalAuthenticationTest.java9
-rw-r--r--it/it-tests/src/test/java/it/user/MyAccountPageTest.java11
-rw-r--r--it/it-tests/src/test/java/it/user/OAuth2IdentityProviderTest.java3
-rw-r--r--it/it-tests/src/test/java/pageobjects/LoginPage.java5
-rw-r--r--it/it-tests/src/test/resources/user/BaseIdentityProviderTest/authenticate_user.html29
-rw-r--r--it/it-tests/src/test/resources/user/LocalAuthenticationTest/force-authentication.html5
-rw-r--r--it/it-tests/src/test/resources/user/LocalAuthenticationTest/login_successful.html7
-rw-r--r--it/it-tests/src/test/resources/user/LocalAuthenticationTest/redirect_to_original_url_after_direct_login.html5
-rw-r--r--it/it-tests/src/test/resources/user/LocalAuthenticationTest/redirect_to_original_url_after_indirect_login.html5
-rw-r--r--it/it-tests/src/test/resources/user/LocalAuthenticationTest/redirect_to_original_url_with_parameters_after_direct_login.html5
-rw-r--r--it/it-tests/src/test/resources/user/LocalAuthenticationTest/should_not_be_unlogged_when_going_to_login_page.html4
-rw-r--r--it/it-tests/src/test/resources/user/MyAccountPageTest/should_change_password.html110
-rw-r--r--it/it-tests/src/test/resources/user/OAuth2IdentityProviderTest/authenticate_user.html29
14 files changed, 24 insertions, 206 deletions
diff --git a/it/it-tests/src/test/java/it/user/BaseIdentityProviderTest.java b/it/it-tests/src/test/java/it/user/BaseIdentityProviderTest.java
index b173f0b023c..36dc82ec7a9 100644
--- a/it/it-tests/src/test/java/it/user/BaseIdentityProviderTest.java
+++ b/it/it-tests/src/test/java/it/user/BaseIdentityProviderTest.java
@@ -32,6 +32,7 @@ import org.junit.Test;
import org.sonarqube.ws.client.GetRequest;
import org.sonarqube.ws.client.WsClient;
import org.sonarqube.ws.client.user.CreateRequest;
+import pageobjects.Navigation;
import util.user.UserRule;
import util.user.Users;
@@ -103,7 +104,7 @@ public class BaseIdentityProviderTest {
enablePlugin();
setUserCreatedByAuthPlugin(USER_LOGIN, USER_PROVIDER_ID, USER_NAME, USER_EMAIL);
- runSelenese(ORCHESTRATOR, "/user/BaseIdentityProviderTest/authenticate_user.html");
+ Navigation.get(ORCHESTRATOR).openLogin().useOAuth2().shouldBeLoggedIn();
userRule.verifyUserExists(USER_LOGIN, USER_NAME, USER_EMAIL);
}
diff --git a/it/it-tests/src/test/java/it/user/LocalAuthenticationTest.java b/it/it-tests/src/test/java/it/user/LocalAuthenticationTest.java
index feb2c6c4550..b0825c67179 100644
--- a/it/it-tests/src/test/java/it/user/LocalAuthenticationTest.java
+++ b/it/it-tests/src/test/java/it/user/LocalAuthenticationTest.java
@@ -98,13 +98,8 @@ public class LocalAuthenticationTest {
@Test
public void log_in_with_correct_credentials_then_log_out() {
nav.shouldNotBeLoggedIn();
-
- Navigation page = nav.logIn().submitCredentials(LOGIN, "123456");
- page.getRightBar().shouldHave(Condition.text(LOGIN));
- nav.shouldBeLoggedIn();
-
- nav.logOut();
- nav.shouldNotBeLoggedIn();
+ nav.logIn().submitCredentials(LOGIN, "123456").shouldBeLoggedIn();
+ nav.logOut().shouldNotBeLoggedIn();
}
@Test
diff --git a/it/it-tests/src/test/java/it/user/MyAccountPageTest.java b/it/it-tests/src/test/java/it/user/MyAccountPageTest.java
index 5faccd0e466..2539c9f0551 100644
--- a/it/it-tests/src/test/java/it/user/MyAccountPageTest.java
+++ b/it/it-tests/src/test/java/it/user/MyAccountPageTest.java
@@ -32,6 +32,8 @@ import org.sonarqube.ws.client.PostRequest;
import org.sonarqube.ws.client.WsClient;
import pageobjects.Navigation;
+import static com.codeborne.selenide.Condition.visible;
+import static com.codeborne.selenide.Selenide.$;
import static util.ItUtils.newAdminWsClient;
import static util.ItUtils.projectDir;
import static util.selenium.Selenese.runSelenese;
@@ -67,7 +69,14 @@ public class MyAccountPageTest {
@Test
public void should_change_password() throws Exception {
- runSelenese(orchestrator, "/user/MyAccountPageTest/should_change_password.html");
+ nav.openLogin().submitCredentials("account-user", "password").shouldBeLoggedIn();
+ nav.open("/account/security");
+ $("#old_password").val("password");
+ $("#password").val("new_password");
+ $("#password_confirmation").val("new_password");
+ $("#change-password").click();
+ $(".alert-success").shouldBe(visible);
+ nav.logOut().logIn().submitCredentials("account-user", "new_password").shouldBeLoggedIn();
}
@Test
diff --git a/it/it-tests/src/test/java/it/user/OAuth2IdentityProviderTest.java b/it/it-tests/src/test/java/it/user/OAuth2IdentityProviderTest.java
index 303e78b4474..fa91d6cfefb 100644
--- a/it/it-tests/src/test/java/it/user/OAuth2IdentityProviderTest.java
+++ b/it/it-tests/src/test/java/it/user/OAuth2IdentityProviderTest.java
@@ -36,6 +36,7 @@ import org.sonarqube.ws.client.GetRequest;
import org.sonarqube.ws.client.WsClient;
import org.sonarqube.ws.client.WsResponse;
import org.sonarqube.ws.client.user.CreateRequest;
+import pageobjects.Navigation;
import util.user.UserRule;
import util.user.Users;
@@ -112,7 +113,7 @@ public class OAuth2IdentityProviderTest {
simulateRedirectionToCallback();
enablePlugin();
- runSelenese(ORCHESTRATOR,"/user/OAuth2IdentityProviderTest/authenticate_user.html");
+ Navigation.get(ORCHESTRATOR).openLogin().useOAuth2().shouldBeLoggedIn();
userRule.verifyUserExists(USER_LOGIN, USER_NAME, USER_EMAIL);
}
diff --git a/it/it-tests/src/test/java/pageobjects/LoginPage.java b/it/it-tests/src/test/java/pageobjects/LoginPage.java
index 0168350a7c0..f9afa6a289b 100644
--- a/it/it-tests/src/test/java/pageobjects/LoginPage.java
+++ b/it/it-tests/src/test/java/pageobjects/LoginPage.java
@@ -40,6 +40,11 @@ public class LoginPage {
return submitCredentials("admin", "admin");
}
+ public Navigation useOAuth2() {
+ $(".oauth-providers a").click();
+ return page(Navigation.class);
+ }
+
public LoginPage submitWrongCredentials(String login, String password) {
$("#login").val(login);
$("#password").val(password);
diff --git a/it/it-tests/src/test/resources/user/BaseIdentityProviderTest/authenticate_user.html b/it/it-tests/src/test/resources/user/BaseIdentityProviderTest/authenticate_user.html
deleted file mode 100644
index adb819dd425..00000000000
--- a/it/it-tests/src/test/resources/user/BaseIdentityProviderTest/authenticate_user.html
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-
-<body>
-<table cellpadding="1" cellspacing="1" border="1">
- <tr>
- <td>open</td>
- <td>/sessions/new</td>
- <td></td>
- </tr>
- <tr>
- <td>waitForText</td>
- <td>content</td>
- <td>*Log in with Fake base identity provider*</td>
- </tr>
- <tr>
- <td>click</td>
- <td>css=.oauth-providers a</td>
- <td></td>
- </tr>
- <tr>
- <td>waitForText</td>
- <td>id=global-navigation</td>
- <td>*John*</td>
- </tr>
-</table>
-</body>
-</html>
diff --git a/it/it-tests/src/test/resources/user/LocalAuthenticationTest/force-authentication.html b/it/it-tests/src/test/resources/user/LocalAuthenticationTest/force-authentication.html
index 1b542e5360c..47468b46c6b 100644
--- a/it/it-tests/src/test/resources/user/LocalAuthenticationTest/force-authentication.html
+++ b/it/it-tests/src/test/resources/user/LocalAuthenticationTest/force-authentication.html
@@ -49,11 +49,6 @@
<td></td>
</tr>
<tr>
- <td>waitForText</td>
- <td>css=.navbar</td>
- <td>*Administrator*</td>
- </tr>
- <tr>
<td>open</td>
<td>/sessions/logout</td>
<td></td>
diff --git a/it/it-tests/src/test/resources/user/LocalAuthenticationTest/login_successful.html b/it/it-tests/src/test/resources/user/LocalAuthenticationTest/login_successful.html
index 68257d74485..3e146e2d49f 100644
--- a/it/it-tests/src/test/resources/user/LocalAuthenticationTest/login_successful.html
+++ b/it/it-tests/src/test/resources/user/LocalAuthenticationTest/login_successful.html
@@ -44,13 +44,8 @@
<td></td>
</tr>
<tr>
- <td>waitForText</td>
- <td>css=.navbar</td>
- <td>*Administrator*</td>
- </tr>
- <tr>
<td>click</td>
- <td>Link=Administrator</td>
+ <td>css=.js-user-authenticated</td>
<td></td>
</tr>
<tr>
diff --git a/it/it-tests/src/test/resources/user/LocalAuthenticationTest/redirect_to_original_url_after_direct_login.html b/it/it-tests/src/test/resources/user/LocalAuthenticationTest/redirect_to_original_url_after_direct_login.html
index a54eb0b3fd6..a28731b9516 100644
--- a/it/it-tests/src/test/resources/user/LocalAuthenticationTest/redirect_to_original_url_after_direct_login.html
+++ b/it/it-tests/src/test/resources/user/LocalAuthenticationTest/redirect_to_original_url_after_direct_login.html
@@ -49,11 +49,6 @@
<td></td>
</tr>
<tr>
- <td>waitForText</td>
- <td>css=.navbar</td>
- <td>*Administrator*</td>
- </tr>
- <tr>
<td>assertLocation</td>
<td>glob:*/settings?category=general*</td>
<td></td>
diff --git a/it/it-tests/src/test/resources/user/LocalAuthenticationTest/redirect_to_original_url_after_indirect_login.html b/it/it-tests/src/test/resources/user/LocalAuthenticationTest/redirect_to_original_url_after_indirect_login.html
index ca6fdd194fe..3862aa147b9 100644
--- a/it/it-tests/src/test/resources/user/LocalAuthenticationTest/redirect_to_original_url_after_indirect_login.html
+++ b/it/it-tests/src/test/resources/user/LocalAuthenticationTest/redirect_to_original_url_after_indirect_login.html
@@ -48,11 +48,6 @@
<td></td>
</tr>
<tr>
- <td>waitForText</td>
- <td>css=.navbar</td>
- <td>*Administrator*</td>
- </tr>
- <tr>
<td>assertLocation</td>
<td>*/settings</td>
<td></td>
diff --git a/it/it-tests/src/test/resources/user/LocalAuthenticationTest/redirect_to_original_url_with_parameters_after_direct_login.html b/it/it-tests/src/test/resources/user/LocalAuthenticationTest/redirect_to_original_url_with_parameters_after_direct_login.html
index c1c94de3ac6..c8f55d12641 100644
--- a/it/it-tests/src/test/resources/user/LocalAuthenticationTest/redirect_to_original_url_with_parameters_after_direct_login.html
+++ b/it/it-tests/src/test/resources/user/LocalAuthenticationTest/redirect_to_original_url_with_parameters_after_direct_login.html
@@ -58,11 +58,6 @@
<td></td>
</tr>
<tr>
- <td>waitForText</td>
- <td>css=.navbar</td>
- <td>*Administrator*</td>
- </tr>
- <tr>
<td>assertLocation</td>
<td>*/projects?gate=OK&reliability=1&security=1</td>
<td></td>
diff --git a/it/it-tests/src/test/resources/user/LocalAuthenticationTest/should_not_be_unlogged_when_going_to_login_page.html b/it/it-tests/src/test/resources/user/LocalAuthenticationTest/should_not_be_unlogged_when_going_to_login_page.html
index 66a0ab89a51..a0f759e19cc 100644
--- a/it/it-tests/src/test/resources/user/LocalAuthenticationTest/should_not_be_unlogged_when_going_to_login_page.html
+++ b/it/it-tests/src/test/resources/user/LocalAuthenticationTest/should_not_be_unlogged_when_going_to_login_page.html
@@ -54,9 +54,9 @@
<td></td>
</tr>
<tr>
- <td>waitForText</td>
+ <td>waitForElementPresent</td>
<td>css=.js-user-authenticated</td>
- <td>*simple-user*</td>
+ <td></td>
</tr>
</tbody>
</table>
diff --git a/it/it-tests/src/test/resources/user/MyAccountPageTest/should_change_password.html b/it/it-tests/src/test/resources/user/MyAccountPageTest/should_change_password.html
deleted file mode 100644
index 58ad7b8b089..00000000000
--- a/it/it-tests/src/test/resources/user/MyAccountPageTest/should_change_password.html
+++ /dev/null
@@ -1,110 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head profile="http://selenium-ide.openqa.org/profiles/test-case">
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
- <link rel="selenium.base" href="http://localhost:49506"/>
- <title>should_change_password</title>
-</head>
-<body>
-<table cellpadding="1" cellspacing="1" border="1">
-<thead>
-<tr>
-<td rowspan="1" colspan="3">should_change_password</td>
-</tr>
-</thead>
-<tbody>
-<tr>
- <td>open</td>
- <td>/sonar/sessions/login</td>
- <td></td>
-</tr>
-<tr>
- <td>type</td>
- <td>id=login</td>
- <td>account-user</td>
-</tr>
-<tr>
- <td>type</td>
- <td>id=password</td>
- <td>password</td>
-</tr>
-<tr>
- <td>clickAndWait</td>
- <td>commit</td>
- <td></td>
-</tr>
-<tr>
- <td>waitForElementPresent</td>
- <td>css=.js-user-authenticated</td>
- <td></td>
-</tr>
-<tr>
- <td>open</td>
- <td>/sonar/account/security</td>
- <td></td>
-</tr>
-<tr>
- <td>waitForElementPresent</td>
- <td>id=change-password</td>
- <td></td>
-</tr>
-<tr>
- <td>type</td>
- <td>id=old_password</td>
- <td>password</td>
-</tr>
-<tr>
- <td>type</td>
- <td>id=password</td>
- <td>new_password</td>
-</tr>
-<tr>
- <td>type</td>
- <td>id=password_confirmation</td>
- <td>new_password</td>
-</tr>
-<tr>
- <td>click</td>
- <td>id=change-password</td>
- <td></td>
-</tr>
-<tr>
- <td>waitForElementPresent</td>
- <td>css=.alert-success</td>
- <td></td>
-</tr>
-<tr>
- <td>open</td>
- <td>/sonar/sessions/logout</td>
- <td></td>
-</tr>
-<tr>
- <td>open</td>
- <td>/sonar/sessions/login</td>
- <td></td>
-</tr>
-<tr>
- <td>type</td>
- <td>id=login</td>
- <td>account-user</td>
-</tr>
-<tr>
- <td>type</td>
- <td>id=password</td>
- <td>new_password</td>
-</tr>
-<tr>
- <td>clickAndWait</td>
- <td>commit</td>
- <td></td>
-</tr>
-<tr>
- <td>waitForText</td>
- <td>id=global-navigation</td>
- <td>*User With Account*</td>
-</tr>
-</tbody>
-</table>
-</body>
-</html>
diff --git a/it/it-tests/src/test/resources/user/OAuth2IdentityProviderTest/authenticate_user.html b/it/it-tests/src/test/resources/user/OAuth2IdentityProviderTest/authenticate_user.html
deleted file mode 100644
index 22b34ba03c9..00000000000
--- a/it/it-tests/src/test/resources/user/OAuth2IdentityProviderTest/authenticate_user.html
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-
-<body>
-<table cellpadding="1" cellspacing="1" border="1">
- <tr>
- <td>open</td>
- <td>/sessions/new</td>
- <td></td>
- </tr>
- <tr>
- <td>waitForText</td>
- <td>content</td>
- <td>*Log in with Fake oauth2 identity provider*</td>
- </tr>
- <tr>
- <td>click</td>
- <td>css=.oauth-providers a</td>
- <td></td>
- </tr>
- <tr>
- <td>waitForText</td>
- <td>id=global-navigation</td>
- <td>*John*</td>
- </tr>
-</table>
-</body>
-</html>