From 5621d8574ce58ad669f1b928403fa138c876912e Mon Sep 17 00:00:00 2001 From: kate Date: Thu, 7 Feb 2019 17:15:14 +0100 Subject: [PATCH] more schrodinger test fixes --- .../resources/localization/schema.properties | 1 + .../testing/schrodinger/TestBase.java | 2 ++ .../schrodinger/scenarios/AccountTests.java | 19 ++++++++----------- .../scenarios/OrganizationStructureTests.java | 12 +++++++----- .../scenarios/SynchronizationTests.java | 6 +++--- .../page/resource/ViewResourcePage.java | 2 +- 6 files changed, 22 insertions(+), 20 deletions(-) diff --git a/infra/schema/src/main/resources/localization/schema.properties b/infra/schema/src/main/resources/localization/schema.properties index 1075f92095b..9560c93b2c3 100755 --- a/infra/schema/src/main/resources/localization/schema.properties +++ b/infra/schema/src/main/resources/localization/schema.properties @@ -1227,3 +1227,4 @@ ArchetypePolicyType.display=Display ArchetypePolicyType.conflictResolution=Conflict resolution ArchetypePolicyType.lifecycleStateModel=Lifecycle state model ArchetypePolicyType.applicablePolicies=Applicable policies +ConfigurationType.configurationProperties=Configuration properties \ No newline at end of file diff --git a/testing/schrodingertest/src/test/java/com/evolveum/midpoint/testing/schrodinger/TestBase.java b/testing/schrodingertest/src/test/java/com/evolveum/midpoint/testing/schrodinger/TestBase.java index 89bff2abc67..564925ad7be 100644 --- a/testing/schrodingertest/src/test/java/com/evolveum/midpoint/testing/schrodinger/TestBase.java +++ b/testing/schrodingertest/src/test/java/com/evolveum/midpoint/testing/schrodinger/TestBase.java @@ -47,6 +47,8 @@ public abstract class TestBase { public static final String PROPERTY_NAME_USER_HOME = "user.home"; public static final String PROPERTY_NAME_FILE_SEPARATOR = "file.separator"; + protected static final String CSV_RESOURCE_ATTR_UNIQUE= "Unique attribute name"; + private static final Logger LOG = LoggerFactory.getLogger(TestBase.class); protected static File CSV_TARGET_DIR; diff --git a/testing/schrodingertest/src/test/java/com/evolveum/midpoint/testing/schrodinger/scenarios/AccountTests.java b/testing/schrodingertest/src/test/java/com/evolveum/midpoint/testing/schrodinger/scenarios/AccountTests.java index f9b350c9687..18d2d1299a2 100644 --- a/testing/schrodingertest/src/test/java/com/evolveum/midpoint/testing/schrodinger/scenarios/AccountTests.java +++ b/testing/schrodingertest/src/test/java/com/evolveum/midpoint/testing/schrodinger/scenarios/AccountTests.java @@ -38,9 +38,6 @@ public class AccountTests extends TestBase { protected static final String CSV_RESOURCE_ATTR_FILE_PATH= "File path"; - //TODO seems that some problems with property files in the csv resource which is being used for tests, replace value after resolution - protected static final String CSV_RESOURCE_ATTR_UNIQUE= "UI_CSV_NAME_ATTRIBUTE"; - protected static final String TEST_USER_MIKE_NAME= "michelangelo"; protected static final String TEST_USER_MIKE_LAST_NAME_OLD= "di Lodovico Buonarroti Simoni"; protected static final String TEST_USER_MIKE_LAST_NAME_NEW= "di Lodovico Buonarroti Simoni Il Divino"; @@ -73,7 +70,7 @@ public void createMidpointUser() throws IOException, ConfigurationException { ); } - @Test(groups = TEST_GROUP_BEFORE_USER_DELETION) + @Test(priority = 2, groups = TEST_GROUP_BEFORE_USER_DELETION) public void importCsvResource(){ ImportObjectPage importPage = basicPage.importObject(); @@ -89,7 +86,7 @@ public void importCsvResource(){ } - @Test (dependsOnMethods = {IMPORT_CSV_RESOURCE_DEPENDENCY},groups = TEST_GROUP_BEFORE_USER_DELETION) + @Test (priority = 3, dependsOnMethods = {IMPORT_CSV_RESOURCE_DEPENDENCY},groups = TEST_GROUP_BEFORE_USER_DELETION) public void changeResourceFilePath(){ ListResourcesPage listResourcesPage = basicPage.listResources(); @@ -108,7 +105,7 @@ public void changeResourceFilePath(){ refreshResourceSchema(CSV_RESOURCE_NAME); } - @Test(dependsOnMethods = {CREATE_MP_USER_DEPENDENCY,CHANGE_RESOURCE_FILE_PATH_DEPENDENCY},groups = TEST_GROUP_BEFORE_USER_DELETION) + @Test(priority = 4, dependsOnMethods = {CREATE_MP_USER_DEPENDENCY,CHANGE_RESOURCE_FILE_PATH_DEPENDENCY},groups = TEST_GROUP_BEFORE_USER_DELETION) public void addAccount() { ListUsersPage users = basicPage.listUsers(); Assert.assertTrue( @@ -135,7 +132,7 @@ public void addAccount() { ); } - @Test (dependsOnMethods = {ADD_ACCOUNT_DEPENDENCY},groups = TEST_GROUP_BEFORE_USER_DELETION) + @Test (priority = 5, dependsOnMethods = {ADD_ACCOUNT_DEPENDENCY},groups = TEST_GROUP_BEFORE_USER_DELETION) public void modifyAccountAttribute(){ ListUsersPage users = basicPage.listUsers(); users @@ -159,7 +156,7 @@ public void modifyAccountAttribute(){ ; } - @Test (dependsOnMethods = {ADD_ACCOUNT_DEPENDENCY},groups = TEST_GROUP_BEFORE_USER_DELETION) + @Test (priority = 6, dependsOnMethods = {ADD_ACCOUNT_DEPENDENCY},groups = TEST_GROUP_BEFORE_USER_DELETION) public void modifyAccountPassword(){ ListUsersPage users = basicPage.listUsers(); users @@ -184,7 +181,7 @@ public void modifyAccountPassword(){ .isSuccess(); } - @Test (dependsOnMethods = {ADD_ACCOUNT_DEPENDENCY},groups = TEST_GROUP_BEFORE_USER_DELETION) + @Test (priority = 7, dependsOnMethods = {ADD_ACCOUNT_DEPENDENCY},groups = TEST_GROUP_BEFORE_USER_DELETION) public void disableAccount(){ ListUsersPage users = basicPage.listUsers(); users @@ -208,7 +205,7 @@ public void disableAccount(){ .isSuccess(); } - @Test (dependsOnMethods = {ADD_ACCOUNT_DEPENDENCY, DISABLE_ACCOUNT_DEPENDENCY},groups = TEST_GROUP_BEFORE_USER_DELETION) + @Test (priority = 8, dependsOnMethods = {ADD_ACCOUNT_DEPENDENCY, DISABLE_ACCOUNT_DEPENDENCY},groups = TEST_GROUP_BEFORE_USER_DELETION) public void enableAccount(){ ListUsersPage users = basicPage.listUsers(); users @@ -232,7 +229,7 @@ public void enableAccount(){ .isSuccess(); } - @Test(dependsOnMethods = {ENABLE_ACCOUNT_DEPENDENCY},groups = TEST_GROUP_BEFORE_USER_DELETION) + @Test(priority = 9, dependsOnMethods = {ENABLE_ACCOUNT_DEPENDENCY},groups = TEST_GROUP_BEFORE_USER_DELETION) public void deleteAccount(){ ListUsersPage users = basicPage.listUsers(); users diff --git a/testing/schrodingertest/src/test/java/com/evolveum/midpoint/testing/schrodinger/scenarios/OrganizationStructureTests.java b/testing/schrodingertest/src/test/java/com/evolveum/midpoint/testing/schrodinger/scenarios/OrganizationStructureTests.java index 497ee55ef07..c36cb5d191f 100644 --- a/testing/schrodingertest/src/test/java/com/evolveum/midpoint/testing/schrodinger/scenarios/OrganizationStructureTests.java +++ b/testing/schrodingertest/src/test/java/com/evolveum/midpoint/testing/schrodinger/scenarios/OrganizationStructureTests.java @@ -41,9 +41,6 @@ public class OrganizationStructureTests extends TestBase { private static final String DIRECTORY_CURRENT_TEST = "organizationStructureTests"; private static final String FILE_RESOUCE_NAME = "midpoint-advanced-sync.csv"; - //TODO seems that some problems with property files in the csv resource which is being used for tests, replace value after resolution - protected static final String CSV_RESOURCE_ATTR_UNIQUE= "UI_CSV_NAME_ATTRIBUTE"; - @Test public void importOrgStructure() throws IOException, ConfigurationException { @@ -121,7 +118,7 @@ public void unassignOrgUnit(){ public void orgUnitAccountInducement(){ importObject(CSV_RESOURCE_ADVANCED_SYNC,true); importObject(ORG_ACCOUNT_INDUCEMENT_FILE); - importObject(ScenariosCommons.USER_TEST_RAPHAEL_FILE); + importObject(ScenariosCommons.USER_TEST_RAPHAEL_FILE, true); changeResourceFilePath(); @@ -160,7 +157,12 @@ public void changeResourceFilePath(){ Assert.assertTrue(listResourcesPage .table() - .clickByName("CSV (target with groups)") + .search() + .byName() + .inputValue(NAME_CSV_RESOURCE_ADVANCED_SYNC) + .updateSearch() + .and() + .clickByName(NAME_CSV_RESOURCE_ADVANCED_SYNC) .clickEditResourceConfiguration() .form() .changeAttributeValue("File path", "", CSV_TARGET_FILE.getAbsolutePath()) diff --git a/testing/schrodingertest/src/test/java/com/evolveum/midpoint/testing/schrodinger/scenarios/SynchronizationTests.java b/testing/schrodingertest/src/test/java/com/evolveum/midpoint/testing/schrodinger/scenarios/SynchronizationTests.java index 8798212af05..88fce5336f0 100644 --- a/testing/schrodingertest/src/test/java/com/evolveum/midpoint/testing/schrodinger/scenarios/SynchronizationTests.java +++ b/testing/schrodingertest/src/test/java/com/evolveum/midpoint/testing/schrodinger/scenarios/SynchronizationTests.java @@ -55,7 +55,7 @@ public void setUpResourceAndSynchronizationTask() throws ConfigurationException, listResourcesPage .table() .clickByName(ScenariosCommons.RESOURCE_CSV_GROUPS_AUTHORITATIVE_NAME) - .clicAccountsTab() + .clickAccountsTab() .liveSyncTask() .clickCreateNew() .basicTable() @@ -116,7 +116,7 @@ public void protectedAccountAdded(){ .updateSearch() .and() .clickByName(ScenariosCommons.RESOURCE_CSV_GROUPS_AUTHORITATIVE_NAME) - .clicAccountsTab() + .clickAccountsTab() .clickSearchInResource() .table() .currentTableContains(ScenariosCommons.TEST_USER_PROTECTED_NAME) @@ -239,7 +239,7 @@ public void resourceAccountDeleted(){ .updateSearch() .and() .clickByName(ScenariosCommons.RESOURCE_CSV_GROUPS_AUTHORITATIVE_NAME) - .clicAccountsTab() + .clickAccountsTab() .clickSearchInResource() .table() .selectCheckboxByName("raphael") diff --git a/tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/page/resource/ViewResourcePage.java b/tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/page/resource/ViewResourcePage.java index f100d8e2530..2413983dc4d 100644 --- a/tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/page/resource/ViewResourcePage.java +++ b/tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/page/resource/ViewResourcePage.java @@ -33,7 +33,7 @@ public ResourceWizardPage clickShowUsingWizard() { return new ResourceWizardPage(); } - public ResourceAccountsTab clicAccountsTab() { + public ResourceAccountsTab clickAccountsTab() { $(Schrodinger.byDataResourceKey("schrodinger", "PageResource.tab.content.account")).parent() .waitUntil(Condition.visible, MidPoint.TIMEOUT_DEFAULT_2_S).click();