Skip to content

Commit

Permalink
more schrodinger test fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
KaterynaHonchar committed Feb 7, 2019
1 parent caf359b commit 5621d85
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 20 deletions.
Expand Up @@ -1227,3 +1227,4 @@ ArchetypePolicyType.display=Display
ArchetypePolicyType.conflictResolution=Conflict resolution
ArchetypePolicyType.lifecycleStateModel=Lifecycle state model
ArchetypePolicyType.applicablePolicies=Applicable policies
ConfigurationType.configurationProperties=Configuration properties
Expand Up @@ -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;

Expand Down
Expand Up @@ -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";
Expand Down Expand Up @@ -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();

Expand All @@ -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();

Expand All @@ -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(
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
Expand Up @@ -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 {

Expand Down Expand Up @@ -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();

Expand Down Expand Up @@ -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())
Expand Down
Expand Up @@ -55,7 +55,7 @@ public void setUpResourceAndSynchronizationTask() throws ConfigurationException,
listResourcesPage
.table()
.clickByName(ScenariosCommons.RESOURCE_CSV_GROUPS_AUTHORITATIVE_NAME)
.clicAccountsTab()
.clickAccountsTab()
.liveSyncTask()
.clickCreateNew()
.basicTable()
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -239,7 +239,7 @@ public void resourceAccountDeleted(){
.updateSearch()
.and()
.clickByName(ScenariosCommons.RESOURCE_CSV_GROUPS_AUTHORITATIVE_NAME)
.clicAccountsTab()
.clickAccountsTab()
.clickSearchInResource()
.table()
.selectCheckboxByName("raphael")
Expand Down
Expand Up @@ -33,7 +33,7 @@ public ResourceWizardPage clickShowUsingWizard() {
return new ResourceWizardPage();
}

public ResourceAccountsTab<ViewResourcePage> clicAccountsTab() {
public ResourceAccountsTab<ViewResourcePage> clickAccountsTab() {

$(Schrodinger.byDataResourceKey("schrodinger", "PageResource.tab.content.account")).parent()
.waitUntil(Condition.visible, MidPoint.TIMEOUT_DEFAULT_2_S).click();
Expand Down

0 comments on commit 5621d85

Please sign in to comment.