Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/Evolveum/midpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
katkav committed Mar 5, 2019
2 parents 589fd0f + 96e1716 commit 94a5624
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 22 deletions.
Expand Up @@ -57,8 +57,8 @@ public void configureArchetypeObjectListView(){
SelenideElement newGuiObjectListViewPropertiesPanel = prismForm.getPrismPropertiesPanel(NEW_OBJECT_LIST_VIEW_CONTAINER_KEY);
newGuiObjectListViewPropertiesPanel
.$(Schrodinger.byDataResourceKey("Type"))
.$(Schrodinger.byElementAttributeValue("select", "data-s-id", "input"))
.selectOption("User");
.$(By.tagName("select"))
.selectOptionContainingText("User");

//set archetypeRef
SelenideElement collectionRefPropertyPanel = prismForm.findProperty(COLLECTION_REF_ATTRIBUTE_NAME);
Expand Down Expand Up @@ -157,15 +157,16 @@ public void checkNewObjectButtonWithDropdown(){
SelenideElement newObjectButton = userListPage
.table()
.getToolbarButton("fa fa-plus");
newObjectButton.click();

newObjectButton.waitUntil(Condition.appears, MidPoint.TIMEOUT_DEFAULT_2_S).click();

newObjectButton
.$(By.tagName("ul"))
.shouldBe(Condition.visible)
.waitUntil(Condition.visible, MidPoint.TIMEOUT_DEFAULT_2_S)
.$(Schrodinger.byElementAttributeValue("i", "class", ARCHETYPE_ICON_CSS_STYLE))
.$(Schrodinger.byElementAttributeValue("i", "class", "fa fa-user")); //standard user icon
.exists();

newObjectButton
.$(Schrodinger.byElementAttributeValue("i", "class", "fa fa-user")) //standard user icon
.exists();
}

}
Expand Down
Expand Up @@ -34,7 +34,7 @@ public class SynchronizationTests extends TestBase {
private static final String FILE_RESOUCE_NAME = "midpoint-advanced-sync.csv";
private static final String DIRECTORY_CURRENT_TEST = "synchronizationTests";

@Test
@Test(priority = 0)
public void setUpResourceAndSynchronizationTask() throws ConfigurationException, IOException {

initTestDirectory(DIRECTORY_CURRENT_TEST);
Expand Down Expand Up @@ -71,7 +71,7 @@ public void setUpResourceAndSynchronizationTask() throws ConfigurationException,
}


@Test (dependsOnMethods = {RESOURCE_AND_SYNC_TASK_SETUP_DEPENDENCY})
@Test (priority = 1, dependsOnMethods = {RESOURCE_AND_SYNC_TASK_SETUP_DEPENDENCY})
public void newResourceAccountUserCreated() throws IOException {

FileUtils.copyFile(ScenariosCommons.CSV_SOURCE_FILE,CSV_TARGET_FILE);
Expand All @@ -90,7 +90,7 @@ public void newResourceAccountUserCreated() throws IOException {
);
}

@Test (dependsOnMethods = {NEW_USER_AND_ACCOUNT_CREATED_DEPENDENCY})
@Test (priority = 2, dependsOnMethods = {NEW_USER_AND_ACCOUNT_CREATED_DEPENDENCY})
public void protectedAccountAdded(){

ListUsersPage usersPage = basicPage.listUsers();
Expand Down Expand Up @@ -125,7 +125,7 @@ public void protectedAccountAdded(){
}


@Test (dependsOnMethods = {NEW_USER_AND_ACCOUNT_CREATED_DEPENDENCY})
@Test (priority = 3, dependsOnMethods = {NEW_USER_AND_ACCOUNT_CREATED_DEPENDENCY})
public void newResourceAccountCreatedLinked() throws IOException {

ListUsersPage usersPage = basicPage.listUsers();
Expand Down Expand Up @@ -170,7 +170,7 @@ public void newResourceAccountCreatedLinked() throws IOException {

}

@Test (dependsOnMethods = {NEW_USER_ACCOUNT_CREATED_LINKED_DEPENDENCY})
@Test (priority = 4, dependsOnMethods = {NEW_USER_ACCOUNT_CREATED_LINKED_DEPENDENCY})
public void alreadyLinkedResourceAccountModified() throws IOException {

FileUtils.copyFile(CSV_UPDATED_SOURCE_FILE,CSV_TARGET_FILE);
Expand All @@ -192,7 +192,7 @@ public void alreadyLinkedResourceAccountModified() throws IOException {
);
}

@Test (dependsOnMethods = {LINKED_USER_ACCOUNT_MODIFIED})
@Test (priority = 5, dependsOnMethods = {LINKED_USER_ACCOUNT_MODIFIED})
public void alreadyLinkedResourceAccountDeleted() throws IOException {

FileUtils.copyFile(CSV_INITIAL_SOURCE_FILE,CSV_TARGET_FILE);
Expand All @@ -211,7 +211,7 @@ public void alreadyLinkedResourceAccountDeleted() throws IOException {
);
}

@Test (dependsOnMethods = {RESOURCE_AND_SYNC_TASK_SETUP_DEPENDENCY})
@Test (priority = 6, dependsOnMethods = {RESOURCE_AND_SYNC_TASK_SETUP_DEPENDENCY})
public void resourceAccountDeleted(){

ListUsersPage usersPage = basicPage.listUsers();
Expand Down Expand Up @@ -270,7 +270,7 @@ public void resourceAccountDeleted(){



@Test(dependsOnMethods = {LINKED_USER_ACCOUNT_DELETED})
@Test(priority = 7, dependsOnMethods = {LINKED_USER_ACCOUNT_DELETED})
public void resourceAccountCreatedWhenResourceUnreachable() throws IOException {

changeResourceAttribute(ScenariosCommons.RESOURCE_CSV_GROUPS_AUTHORITATIVE_NAME, ScenariosCommons.CSV_RESOURCE_ATTR_FILE_PATH, CSV_TARGET_FILE.getAbsolutePath()+"err", false);
Expand Down Expand Up @@ -316,7 +316,7 @@ public void resourceAccountCreatedWhenResourceUnreachable() throws IOException {
);
}

@Test (dependsOnMethods = {RESOURCE_ACCOUNT_CREATED_WHEN_UNREACHABLE})
@Test (priority = 8, dependsOnMethods = {RESOURCE_ACCOUNT_CREATED_WHEN_UNREACHABLE})
public void resourceAccountCreatedWhenResourceUnreachableToBeLinked() throws IOException {

ListUsersPage listUsersPage= basicPage.listUsers();
Expand Down
Expand Up @@ -17,6 +17,7 @@
package com.evolveum.midpoint.schrodinger.component.user;

import com.codeborne.selenide.Condition;
import com.codeborne.selenide.ElementsCollection;
import com.codeborne.selenide.SelenideElement;
import com.evolveum.midpoint.schrodinger.MidPoint;
import com.evolveum.midpoint.schrodinger.component.modal.ConfirmationModal;
Expand Down Expand Up @@ -96,17 +97,22 @@ public UsersTableDropDown<UsersPageTable<T>> clickActionDropDown() {

public SelenideElement getToolbarButton(String iconCssClass){
SelenideElement buttonToolbar = getButtonToolbar();
return buttonToolbar
.$(Schrodinger.byElementAttributeValue("i", "class", iconCssClass));
SelenideElement buttonElement = null;
ElementsCollection toolbarButtonsList = buttonToolbar
.findAll(By.tagName("button"));
for (SelenideElement button : toolbarButtonsList) {
if (button.$(Schrodinger.byElementAttributeValue("i", "class", iconCssClass)).exists()) {
buttonElement = button;
}
}
return buttonElement;
}

public UserPage newObjectButtonClickPerformed(String iconCssClass){
getToolbarButton(iconCssClass)
.waitUntil(Condition.appears, MidPoint.TIMEOUT_DEFAULT_2_S)
.click();

$(Schrodinger.byDataId("tabPanel"))
.shouldBe(Condition.visible)
.waitUntil(Condition.visible, MidPoint.TIMEOUT_MEDIUM_6_S);
return new UserPage();
}
}
Expand Up @@ -75,7 +75,8 @@ public ProgressPage clickSave() {
}

private TabPanel findTabPanel() {
SelenideElement tabPanelElement = $(Schrodinger.byDataId("div", "tabPanel"));
SelenideElement tabPanelElement = $(Schrodinger.byDataId("div", "tabPanel"))
.waitUntil(Condition.appear, MidPoint.TIMEOUT_DEFAULT_2_S);
return new TabPanel<>(this, tabPanelElement);
}

Expand Down

0 comments on commit 94a5624

Please sign in to comment.