From 319c2659440bbfa09b57b122a1a4384e3d7ca143 Mon Sep 17 00:00:00 2001 From: honchar Date: Wed, 6 Jul 2016 09:20:31 +0200 Subject: [PATCH] more gui selenide tests update --- .../resources/csvfile/midpoint-flatfile.csv | 6 +- testing/selenidetest/basic-tests-suite.xml | 30 ++--- .../selenide/tests/AbstractSelenideTest.java | 17 ++- .../account/ResourceUserAccountTests.java | 125 ++++++++++-------- .../tests/basictests/EndUserTests.java | 23 ++-- .../tests/basictests/SuperUserTests.java | 52 +++----- 6 files changed, 130 insertions(+), 123 deletions(-) diff --git a/samples/resources/csvfile/midpoint-flatfile.csv b/samples/resources/csvfile/midpoint-flatfile.csv index 62c8054230e..943c09c1def 100644 --- a/samples/resources/csvfile/midpoint-flatfile.csv +++ b/samples/resources/csvfile/midpoint-flatfile.csv @@ -1,3 +1,7 @@ "id","firstname","lastname","disabled","password" "user01","Firstname","Lastname","false","secret" -"user02","Test","Lastname","false","secret" \ No newline at end of file +"user02","Test","Lastname","false","secret" +"honchar","Kate","last name","false", +"csv1",,,"false", +"SuperUser",,,"false","password" +"ifarinic","Igor","Farinič","false", diff --git a/testing/selenidetest/basic-tests-suite.xml b/testing/selenidetest/basic-tests-suite.xml index 9ec98a68b2a..f0d0a83a6e5 100644 --- a/testing/selenidetest/basic-tests-suite.xml +++ b/testing/selenidetest/basic-tests-suite.xml @@ -18,16 +18,16 @@ - - - - - - - - - - + + + + + + + + + + @@ -40,11 +40,11 @@ - - - - - + + + + + diff --git a/testing/selenidetest/src/test/java/com/evolveum/midpoint/testing/selenide/tests/AbstractSelenideTest.java b/testing/selenidetest/src/test/java/com/evolveum/midpoint/testing/selenide/tests/AbstractSelenideTest.java index 6808ef2c0b3..c2ae47e27a4 100644 --- a/testing/selenidetest/src/test/java/com/evolveum/midpoint/testing/selenide/tests/AbstractSelenideTest.java +++ b/testing/selenidetest/src/test/java/com/evolveum/midpoint/testing/selenide/tests/AbstractSelenideTest.java @@ -235,7 +235,7 @@ public void openListUsersPage(){ * @param objectName the name of the object to be assigned */ public void assignObjectToUser(String linkText, String objectName){ - $(byAttribute("class", "tab2")).shouldBe(visible).click(); + openAssignmentsTab(); $(byAttribute("about", "dropdownMenu")).click(); //click Assign menu item with the specified linkText $(By.linkText(linkText)).shouldBe(visible).click(); @@ -249,12 +249,17 @@ public void assignObjectToUser(String linkText, String objectName){ $(By.linkText("Add")).shouldBe(visible).click(); $(By.linkText("Add")).should(disappear); - //switch to main window -// switchTo().defaultContent(); //click Save button $(By.linkText("Save")).click(); } + protected void openAssignmentsTab(){ + $(byAttribute("class", "tab2")).shouldBe(visible).click(); + } + + protected void openProjectionsTab(){ + $(byAttribute("class", "tab1")).shouldBe(visible).click(); + } /** * opens Edit page for the specified user with userName * @param userName @@ -314,7 +319,7 @@ public void importObjectFromFile(String filePath){ $(byAttribute("about", "importFileButton")).shouldBe(visible).click(); //check if Success message appears after resource importing - $(byText("Success")).shouldBe(visible); + $(byText("Import file (Gui)")).shouldBe(visible); } @@ -373,8 +378,8 @@ protected void checkOperationStatusOk(String message) { } protected void checkLoginIsPerformed(){ - $(byText("Personal info")).shouldBe(visible); - $(byText("System status")).shouldBe(visible); + $(By.partialLinkText("Home")).click(); + $(byText("My work items")).shouldBe(visible); } protected SelenideElement findAttributeValueFiledByDisplayName(String displayName, String fieldTagName){ diff --git a/testing/selenidetest/src/test/java/com/evolveum/midpoint/testing/selenide/tests/account/ResourceUserAccountTests.java b/testing/selenidetest/src/test/java/com/evolveum/midpoint/testing/selenide/tests/account/ResourceUserAccountTests.java index 6e63c3f4dc9..fb524b58967 100644 --- a/testing/selenidetest/src/test/java/com/evolveum/midpoint/testing/selenide/tests/account/ResourceUserAccountTests.java +++ b/testing/selenidetest/src/test/java/com/evolveum/midpoint/testing/selenide/tests/account/ResourceUserAccountTests.java @@ -9,13 +9,16 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import org.testng.annotations.Test; +import static org.testng.Assert.assertEquals; import java.util.HashMap; +import java.util.Map; import static com.codeborne.selenide.Condition.*; import static com.codeborne.selenide.Selectors.byAttribute; import static com.codeborne.selenide.Selectors.byText; import static com.codeborne.selenide.Selenide.$; +import static com.codeborne.selenide.Selenide.$$; import static com.codeborne.selenide.Selenide.close; import static com.codeborne.selenide.Selenide.switchTo; @@ -23,8 +26,8 @@ public class ResourceUserAccountTests extends AbstractSelenideTest { public static final String USER_NAME = "UserWithOpendjAccount"; - public static final String OPENDJ_RESOURCE_NAME = "Localhost OpenDJ (no extension schema)"; - public static final String OPENDJ_RESOURCE_PATH = "../../samples/resources/opendj/opendj-localhost-resource-sync-no-extension-advanced.xml"; + public static final String OPENDJ_RESOURCE_NAME = "Localhost OpenDJ"; + public static final String OPENDJ_RESOURCE_PATH = "../../samples/resources/opendj/opendj-localhost-resource-sync-advanced.xml"; public static final String USER_ADMINISTRATOR_ROLE_NAME = "User Administrator"; public static final String AUTHORIZATION_ROLES_XML_PATH = "../../samples/roles/authorization-roles.xml"; public static final String END_USER_ROLE_NAME = "End user"; @@ -39,10 +42,7 @@ public class ResourceUserAccountTests extends AbstractSelenideTest { public void test001importResourceTest(){ close(); login(); - - //check if welcome message appears after user logged in - $(byText("welcome to midPoint")).shouldBe(visible); - + checkLoginIsPerformed(); //import resource xml file importObjectFromFile(OPENDJ_RESOURCE_PATH); @@ -62,24 +62,26 @@ public void test001importResourceTest(){ */ @Test(priority = 1, dependsOnMethods = {"test001importResourceTest"}) public void test002checkResourceConnectionTest(){ - //open Resources -> List Resources -// $(By.partialLinkText("Resources")).shouldBe(visible).click(); // clicked in previous test + close(); + login(); + checkLoginIsPerformed(); + $(By.partialLinkText("Resources")).shouldBe(visible).click(); $(By.partialLinkText("List resources")).click(); //search for resource in resources list searchForElement(OPENDJ_RESOURCE_NAME); //click on resource link - $(By.partialLinkText(OPENDJ_RESOURCE_NAME)).click(); + $(By.linkText(OPENDJ_RESOURCE_NAME)).click(); //click Test connection button $(By.linkText("Test connection")).click(); //check if all statuses are succeeded - $(By.xpath("/html/body/div/div/section[2]/form/div[2]/div[2]/div/div[2]/table/tbody/tr[1]/td[2]/i")).shouldHave(hasAttribute("title", "Success")); - $(By.xpath("/html/body/div/div/section[2]/form/div[2]/div[2]/div/div[2]/table/tbody/tr[2]/td[2]/i")).shouldHave(hasAttribute("title", "Success")); - $(By.xpath("/html/body/div/div/section[2]/form/div[2]/div[2]/div/div[2]/table/tbody/tr[3]/td[2]/i")).shouldHave(hasAttribute("title", "Success")); - $(By.xpath("/html/body/div/div/section[2]/form/div[2]/div[2]/div/div[2]/table/tbody/tr[4]/td[2]/i")).shouldHave(hasAttribute("title", "Success")); - $(By.xpath("/html/body/div/div/section[2]/form/div[2]/div[2]/div/div[2]/table/tbody/tr[5]/td[2]/i")).shouldHave(hasAttribute("title", "Success")); + assertEquals(4, $$(byAttribute("class", "feedback-message box box-solid box-success")).size()); +// $(byText("Configuration validation")).parent().find(byAttribute("class", "feedback-message box box-solid box-success")).find.shouldBe(visible); +// $(byText("Connector initialization")).parent().find(byAttribute("class", "feedback-message box box-solid box-success")).shouldBe(visible); +// $(byText("Connector connection test")).parent().find(byAttribute("class", "feedback-message box box-solid box-success")).shouldBe(visible); +// $(byText("Connector schema")).parent().find(byAttribute("class", "feedback-message box box-solid box-success")).shouldBe(visible); } @@ -91,23 +93,25 @@ public void test002checkResourceConnectionTest(){ public void test003createAccountTest() { close(); login(); + checkLoginIsPerformed(); //create user with filled user name only createUser(USER_NAME, new HashMap()); //open user's Edit page openUsersEditPage(USER_NAME); - + openProjectionsTab(); //click on the menu icon in the Projection section - $(By.xpath("/html/body/div[1]/div/section[2]/form/div[4]/div/div/div[7]/div[2]/div[1]/div/div[2]/ul/li/a")) - .shouldBe(visible).click(); + $(byAttribute("about", "dropdownMenu")).shouldBe(visible).click(); //click on the Add projection menu item $(By.linkText("Add projection")).shouldBe(visible).click(); - //switch to the opened modal window - switchToInnerFrame(); +// //switch to the opened modal window +// switchToInnerFrame(); //search for resource in resources list in the opened Select resource(s) window - $(byText(OPENDJ_RESOURCE_NAME)).shouldBe(visible).parent().parent().findElementByTagName("input").click(); -// searchForElement(OPENDJ_RESOURCE_NAME); +// $(byText(OPENDJ_RESOURCE_NAME)).shouldBe(visible).parent().parent().findElementByTagName("input").click(); + searchForElement(OPENDJ_RESOURCE_NAME); + $(byAttribute("about", "table")).find(By.tagName("tbody")).find(By.tagName("input")).shouldBe(visible).setSelected(true); + // //check if Localhost OpenDJ resource was found // $(byText(OPENDJ_RESOURCE_NAME)).shouldBe(visible); // @@ -119,31 +123,34 @@ public void test003createAccountTest() { // .shouldBe(selected); //click Add resource(s) button - $(By.linkText("Add resource(s)")).shouldBe(enabled).click(); + $(By.linkText("Add")).shouldBe(enabled).click(); - //switch to main window - switchTo().defaultContent(); +// //switch to main window +// switchTo().defaultContent(); //Fill in account fields: Common name, Surname, first and second password fields - $(By.name("tabPanel:panel:shadows:shadowList:0:shadow:body:containers:0:container:properties:3:property:values:0:value:valueContainer:input:input")) - .shouldBe(visible).setValue(ACCOUNT_COMMON_NAME_VALUE); - $(By.name("tabPanel:panel:shadows:shadowList:0:shadow:body:containers:0:container:properties:42:property:values:0:value:valueContainer:input:input")) - .shouldBe(visible).setValue(ACCOUNT_SURNAME_VALUE); - $(By.name("tabPanel:panel:shadows:shadowList:0:shadow:body:containers:6:container:properties:0:property:values:0:value:valueContainer:input:inputContainer:password1")) - .shouldBe(visible).setValue(ACCOUNT_PASSWORD_VALUE); - $(By.name("tabPanel:panel:shadows:shadowList:0:shadow:body:containers:6:container:properties:0:property:values:0:value:valueContainer:input:inputContainer:password2")) - .shouldBe(visible).setValue(ACCOUNT_PASSWORD_VALUE); + Map fieldsMap = new HashMap(); + fieldsMap.put("Common name", ACCOUNT_COMMON_NAME_VALUE); + fieldsMap.put("Surname", ACCOUNT_SURNAME_VALUE); + fieldsMap.put(PASSWORD1_FIELD_NAME, ACCOUNT_PASSWORD_VALUE); + fieldsMap.put(PASSWORD2_FIELD_NAME, ACCOUNT_PASSWORD_VALUE); + setFieldValues(fieldsMap); +// $(By.name("tabPanel:panel:shadows:shadowList:0:shadow:body:containers:0:container:properties:3:property:values:0:value:valueContainer:input:input")) +// .shouldBe(visible).setValue(ACCOUNT_COMMON_NAME_VALUE); +// $(By.name("tabPanel:panel:shadows:shadowList:0:shadow:body:containers:0:container:properties:42:property:values:0:value:valueContainer:input:input")) +// .shouldBe(visible).setValue(ACCOUNT_SURNAME_VALUE); +// $(By.name("tabPanel:panel:shadows:shadowList:0:shadow:body:containers:6:container:properties:0:property:values:0:value:valueContainer:input:inputContainer:password1")) +// .shouldBe(visible).setValue(ACCOUNT_PASSWORD_VALUE); +// $(By.name("tabPanel:panel:shadows:shadowList:0:shadow:body:containers:6:container:properties:0:property:values:0:value:valueContainer:input:inputContainer:password2")) +// .shouldBe(visible).setValue(ACCOUNT_PASSWORD_VALUE); //click Save button $(By.linkText("Save")).shouldBe(visible).click(); - - //check if Success message appears after user saving - $(byText("Success")).shouldBe(visible); + checkOperationStatusOk("Save (GUI)"); //search for user in users list - searchForElement(USER_NAME); - $(By.linkText(USER_NAME)).shouldBe(visible).click(); - + openUsersEditPage(USER_NAME); + openProjectionsTab(); //check if the created account is displayed in the Accounts section $(By.linkText(OPENDJ_RESOURCE_NAME)).shouldBe(visible); } @@ -155,42 +162,52 @@ public void test003createAccountTest() { */ @Test (priority = 4, dependsOnMethods = {"test003createAccountTest"}) public void test004updateAccountAttributesTest(){ + close(); + login(); + checkLoginIsPerformed(); //open user's Edit page openUsersEditPage(USER_NAME); + openProjectionsTab(); //click on the account link to expand its fields $(By.linkText(OPENDJ_RESOURCE_NAME)).shouldBe(visible).click(); - //update Common Name field - $(By.name("tabPanel:panel:shadows:shadowList:0:shadow:body:containers:0:container:properties:3:property:values:0:value:valueContainer:input:input")) - .shouldBe(visible).setValue(ACCOUNT_COMMON_NAME_VALUE + UPDATED_VALUE); + Map fieldsMap = new HashMap(); + fieldsMap.put("Common name", ACCOUNT_COMMON_NAME_VALUE + UPDATED_VALUE); + fieldsMap.put("Surname", ACCOUNT_SURNAME_VALUE + UPDATED_VALUE); + setFieldValues(fieldsMap); - //update Surname field - $(By.name("tabPanel:panel:shadows:shadowList:0:shadow:body:containers:0:container:properties:42:property:values:0:value:valueContainer:input:input")) - .shouldBe(visible).setValue(ACCOUNT_SURNAME_VALUE + UPDATED_VALUE); +// //update Common Name field +// $(By.name("tabPanel:panel:shadows:shadowList:0:shadow:body:containers:0:container:properties:3:property:values:0:value:valueContainer:input:input")) +// .shouldBe(visible).setValue(ACCOUNT_COMMON_NAME_VALUE + UPDATED_VALUE); +// +// //update Surname field +// $(By.name("tabPanel:panel:shadows:shadowList:0:shadow:body:containers:0:container:properties:42:property:values:0:value:valueContainer:input:input")) +// .shouldBe(visible).setValue(ACCOUNT_SURNAME_VALUE + UPDATED_VALUE); +// //click Save button $(By.linkText("Save")).shouldBe(visible).click(); - - //check if Success message appears after user saving - $(byText("Success")).shouldBe(visible); - + checkOperationStatusOk("Save (GUI)"); +// +// //check if Success message appears after user saving +// $(byText("Success")).shouldBe(visible); +// //search for user in users list searchForElement(USER_NAME); //check if users attributes were updated - $(By.xpath("/html/body/div[1]/div/section[2]/form/div[2]/div/div[2]/table/tbody/tr/td[5]/div")).shouldHave(text(ACCOUNT_SURNAME_VALUE + UPDATED_VALUE)); - $(By.xpath("/html/body/div[1]/div/section[2]/form/div[2]/div/div[2]/table/tbody/tr/td[6]/div")).shouldHave(text(ACCOUNT_COMMON_NAME_VALUE + UPDATED_VALUE)); + $(byText(ACCOUNT_SURNAME_VALUE + UPDATED_VALUE)).shouldBe(visible); + $(byText(ACCOUNT_COMMON_NAME_VALUE + UPDATED_VALUE)).shouldBe(visible); //open user's Edit page $(By.linkText(USER_NAME)).shouldBe(visible).click(); + openProjectionsTab(); //click on the account link to expand its fields $(By.linkText(OPENDJ_RESOURCE_NAME)).shouldBe(visible).click(); //check if account's attributes were updated - $(By.name("tabPanel:panel:shadows:shadowList:0:shadow:body:containers:0:container:properties:3:property:values:0:value:valueContainer:input:input")) - .shouldHave(value(ACCOUNT_COMMON_NAME_VALUE + UPDATED_VALUE)); - $(By.name("tabPanel:panel:shadows:shadowList:0:shadow:body:containers:0:container:properties:42:property:values:0:value:valueContainer:input:input")) - .shouldHave(value(ACCOUNT_SURNAME_VALUE + UPDATED_VALUE)); + $(byText(ACCOUNT_SURNAME_VALUE + UPDATED_VALUE)).shouldBe(visible); + $(byText(ACCOUNT_COMMON_NAME_VALUE + UPDATED_VALUE)).shouldBe(visible); } diff --git a/testing/selenidetest/src/test/java/com/evolveum/midpoint/testing/selenide/tests/basictests/EndUserTests.java b/testing/selenidetest/src/test/java/com/evolveum/midpoint/testing/selenide/tests/basictests/EndUserTests.java index 41549deb23b..b44f77a32a3 100644 --- a/testing/selenidetest/src/test/java/com/evolveum/midpoint/testing/selenide/tests/basictests/EndUserTests.java +++ b/testing/selenidetest/src/test/java/com/evolveum/midpoint/testing/selenide/tests/basictests/EndUserTests.java @@ -30,8 +30,7 @@ public void test001createEndUserTest() { //log in to midPoint login(); - //check if welcome message appears after user logged in - $(byText("welcome to midPoint")).shouldBe(visible); + checkLoginIsPerformed(); //create user, set password fields for him Map userAttributes = new HashMap<>(); userAttributes.put(PASSWORD1_FIELD_NAME, PASSWORD1_FIELD_VALUE); @@ -50,7 +49,8 @@ public void test001createEndUserTest() { //click on the found user link $(By.linkText(END_USER_NAME)).shouldBe(visible).click(); - //check if assigned role is displayed in the Assignments section + //check if assigned role is displayed on the Assignments tab + openAssignmentsTab(); $(By.linkText(ENDUSER_ROLE_NAME)); } @@ -59,38 +59,39 @@ public void test001createEndUserTest() { public void test002loginAsEnduserTest() { close(); login(END_USER_NAME, PASSWORD1_FIELD_VALUE); - //check if welcome message appears after user logged in - $(byText("SELF SERVICE")).shouldBe(visible); + checkLoginIsPerformed(); //click to Profile $(By.partialLinkText("Profile")).shouldBe(visible).click(); //check if End user role s displayed in My Assignments section + openAssignmentsTab(); $(byText(ENDUSER_ROLE_NAME)).shouldBe(visible); } @Test(dependsOnMethods = {"test002loginAsEnduserTest"}, priority = 2) public void test003changePasswordAndLoginTest() { - //select Reset passwords menu item + close(); + login(END_USER_NAME, PASSWORD1_FIELD_VALUE); + checkLoginIsPerformed(); + //select Credentials menu item $(byText("Credentials")).shouldBe(visible).click(); //set new password value $(byAttribute("name", "tabPanel:panel:oldPassword")).shouldBe(visible).setValue(PASSWORD1_FIELD_VALUE); $(byAttribute("about", "password2")).shouldBe(visible).setValue(NEW_PASSWORD_VALUE); $(byAttribute("about", "password1")).shouldBe(visible).setValue(NEW_PASSWORD_VALUE); - //select MidPoint account // default is selected -// $(By.name("accounts:table:body:rows:1:cells:1:cell:check")).shouldBe(visible).click(); //click Save button $(By.linkText("Save")).shouldBe(visible).click(); //check if Success message appears - $(byText("Success")).shouldBe(visible); + $(byText("Password is successfully changed")).shouldBe(visible); //log out logout(); //log in with new password login(END_USER_NAME, NEW_PASSWORD_VALUE); - //check if welcome message appears after user logged in - $(byText("SELF SERVICE")).shouldBe(visible); + checkLoginIsPerformed(); //click to Profile $(By.partialLinkText("Profile")).shouldBe(visible).click(); //check if End user role s displayed in My Assignments section + openAssignmentsTab(); $(byText(ENDUSER_ROLE_NAME)).shouldBe(visible); } diff --git a/testing/selenidetest/src/test/java/com/evolveum/midpoint/testing/selenide/tests/basictests/SuperUserTests.java b/testing/selenidetest/src/test/java/com/evolveum/midpoint/testing/selenide/tests/basictests/SuperUserTests.java index c38733f7997..d0c771e90eb 100644 --- a/testing/selenidetest/src/test/java/com/evolveum/midpoint/testing/selenide/tests/basictests/SuperUserTests.java +++ b/testing/selenidetest/src/test/java/com/evolveum/midpoint/testing/selenide/tests/basictests/SuperUserTests.java @@ -6,6 +6,7 @@ import org.testng.annotations.Test; import java.util.HashMap; +import java.util.Map; import static com.codeborne.selenide.Selectors.byAttribute; import static com.codeborne.selenide.Selectors.byText; @@ -20,7 +21,6 @@ public class SuperUserTests extends AbstractSelenideTest { public static final String SUPER_ROLE_NAME = "Superuser"; public static final String SUPER_USER_NAME = "SuperUser"; - public static final String ASSIGN_ROLE_LINKTEXT = "Assign Role"; /** * Create user with assigned Superuser role. @@ -28,36 +28,20 @@ public class SuperUserTests extends AbstractSelenideTest { @Test(priority = 0) public void test001createSuperUserTest() { close(); - //log in to midPoint login(); - //check if welcome message appears after user logged in - $(byText("welcome to midPoint")).shouldBe(visible); - //create user - createUser(SUPER_USER_NAME, new HashMap()); - //search for the created user in users list - searchForElement(SUPER_USER_NAME); - //click on the found user link - $(By.linkText(SUPER_USER_NAME)).shouldBe(visible).click(); - - //click on the menu icon in the User details section - $(byText("Details")).parent().parent().find(byAttribute("about", "dropdownMenu")) - .shouldBe(visible).click(); - //click on Show empty fields menu item - $(By.linkText("Show empty fields")).shouldBe(visible).click(); - //set Password fields with value - $(By.name(AbstractSelenideTest.PASSWORD1_FIELD_NAME)) - .shouldBe(visible).setValue(PASSWORD1_FIELD_VALUE); - $(By.name(AbstractSelenideTest.PASSWORD2_FIELD_NAME)) - .shouldBe(visible).setValue(PASSWORD1_FIELD_VALUE); + checkLoginIsPerformed(); + Map userAttributes = new HashMap(); + userAttributes.put(PASSWORD1_FIELD_NAME, PASSWORD1_FIELD_VALUE); + userAttributes.put(PASSWORD2_FIELD_NAME, PASSWORD2_FIELD_VALUE); + createUser(SUPER_USER_NAME, userAttributes); + //open user's Edit page + openUsersEditPage(SUPER_USER_NAME); //assign Superuser role to user assignObjectToUser(ASSIGN_ROLE_LINKTEXT, SUPER_ROLE_NAME); - //search for the user in users list - searchForElement(SUPER_USER_NAME); - //click on the found user link - $(By.linkText(SUPER_USER_NAME)).shouldBe(visible).click(); - + openUsersEditPage(SUPER_USER_NAME); + openAssignmentsTab(); //check if assigned role is displayed in the Assignments section $(By.linkText(SUPER_ROLE_NAME)).shouldBe(visible); @@ -68,8 +52,7 @@ public void test001createSuperUserTest() { public void test002loginAsSuperuserTest() { close(); login(SUPER_USER_NAME, PASSWORD1_FIELD_VALUE); - //check if welcome message appears after user logged in - $(byText("welcome to midPoint")).shouldBe(visible); + checkLoginIsPerformed(); } @@ -77,8 +60,7 @@ public void test002loginAsSuperuserTest() { public void test003disableSuperuserAndLoginTest() { close(); login(); - //check if welcome message appears after user logged in - $(byText("welcome to midPoint")).shouldBe(visible); + checkLoginIsPerformed(); //open Users list page openListUsersPage(); //search for the super user in users list @@ -92,7 +74,7 @@ public void test003disableSuperuserAndLoginTest() { //click on Disable menu item $(By.linkText("Disable")).shouldBe(visible).click(); //check if success operation messages are shown - $(byText("Success")).shouldBe(visible); + $(byText("Disable users (Gui)")).shouldBe(visible); //log out logout(); @@ -108,8 +90,7 @@ public void test003disableSuperuserAndLoginTest() { public void test004enableSuperuserAndLoginTest() { close(); login(); - //check if welcome message appears after user logged in - $(byText("welcome to midPoint")).shouldBe(visible); + checkLoginIsPerformed(); //open Users list page openListUsersPage(); //search for the super user in users list @@ -123,7 +104,7 @@ public void test004enableSuperuserAndLoginTest() { //click on Disable menu item $(By.linkText("Enable")).shouldBe(visible).click(); //check if success operation messages are shown - $(byText("Success")).shouldBe(visible); + $(byText("Enable users (Gui)")).shouldBe(visible); //log out logout(); @@ -131,8 +112,7 @@ public void test004enableSuperuserAndLoginTest() { //log in to the system after super user was enabled login(SUPER_USER_NAME, PASSWORD1_FIELD_VALUE); - //check if welcome message appears after user logged in - $(byText("welcome to midPoint")).shouldBe(visible); + checkLoginIsPerformed(); } }