Skip to content

Commit

Permalink
Merge pull request #4418 from will-moore/robot_fix_dialog_button
Browse files Browse the repository at this point in the history
Robot fix xpath to dialog button
  • Loading branch information
jburel committed Feb 22, 2016
2 parents 01b8342 + 69ec2b2 commit 8f24bb2
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 18 deletions.
6 changes: 4 additions & 2 deletions components/tests/ui/resources/web/tree.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ ${plateIcon} webclient/image/folder_plate16.png
Click Dialog Button
[Arguments] ${buttonText}
# Confirm dialog (make sure we pick the currently visible dialog)
Click Element xpath=//div[contains(@class,'ui-dialog')][contains(@style,'display: block')]//button/span[contains(text(), '${buttonText}')]
# jQuery UI buttons sometimes are <button>text and sometimes <button><span>text so we use *
Wait Until Page Contains Element xpath=//div[contains(@class,'ui-dialog')][contains(@style,'display: block')]//div[contains(@class, 'ui-dialog-buttonset')]//*[contains(text(), '${buttonText}')]
Click Element xpath=//div[contains(@class,'ui-dialog')][contains(@style,'display: block')]//div[contains(@class, 'ui-dialog-buttonset')]//*[contains(text(), '${buttonText}')]

Xpath Should Have Class
[Arguments] ${identifier} ${className}
Expand Down Expand Up @@ -101,7 +103,7 @@ Create Container
Input Text name ${newName}
# Make sure we pick 'OK' button from visible dialog

Click Element xpath=//div[contains(@class,'ui-dialog')][contains(@style,'display: block')]//button/span[contains(text(), 'OK')]
Click Dialog Button OK
# Wait until metadata panel reloads based on status.
# This is work arround as unfortunately there is no Wait Until Page NOT Contains Element
# This is important when two the same objects are created in a row.
Expand Down
1 change: 0 additions & 1 deletion components/tests/ui/testcases/web/delete_test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ Test Delete Images in Share
Submit Form create_share_form
Wait Until Element Is Visible id=share_dialog_form
${shareId}= Get Text id=shareCreatedId
Wait Until Element Is Visible xpath=//button[contains(@class,'ui-button')]/span[contains(text(), 'OK')]
Click Dialog Button OK

# Delete Image in share
Expand Down
5 changes: 2 additions & 3 deletions components/tests/ui/testcases/web/forms_test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ Test Share
Submit Form create_share_form
Wait Until Element Is Visible id=share_dialog_form ${WAIT}
${shareId}= Get Text id=shareCreatedId
Wait Until Element Is Visible xpath=//button[contains(@class,'ui-button')]/span[contains(text(), 'OK')] ${WAIT}
Click Dialog Button OK

# Check Share has been created
Expand Down Expand Up @@ -122,7 +121,7 @@ Test Annotate

Input Text id_tag testSeleniumTag${pid}
Click Element id_add_new_tag
Click Element xpath=//button/span[contains(text(),'Save')]
Click Dialog Button Save
Wait Until Page Contains Element xpath=//div[@class='tag']/a[contains(text(), testSeleniumTag${pid})] ${WAIT}

# Files
Expand Down Expand Up @@ -157,7 +156,7 @@ Test Batch Annotate
Wait Until Keyword Succeeds ${TIMEOUT} ${INTERVAL} Page Should Not Contain Element xpath=//div[@class='progress-label']
Input Text id_tag testSeleniumTag${pid}
Click Element id_add_new_tag
Click Element xpath=//button/span[contains(text(),'Save')]
Click Dialog Button Save
Wait Until Page Contains Element xpath=//div[@class='tag']/a[contains(text(), testSeleniumTag${pid})] ${WAIT}

# Files
Expand Down
2 changes: 1 addition & 1 deletion components/tests/ui/testcases/web/search.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ ${XpathTable} xpath=//table[@id='dataTable']
${XpathTableColumn} xpath=//table[@id='dataTable']//tr/td[position()=3]
${XPathAlertText} xpath=//div[contains(@class,'ui-dialog')][contains(@style,'display: block')]//p
${RandomClick} xpath=//form[@id="searching_form"]/h2
${AlertWindow} xpath=//div[contains(@class,'ui-dialog')][contains(@style,'display: block')]//button/span[contains(text(),"OK")]
${AlertWindow} xpath=//div[contains(@class,'ui-dialog')][contains(@style,'display: block')]//div[contains(@class, 'ui-dialog-buttonset')]//*[contains(text(),"OK")]
${SearchInProgress} xpath=//div[@id='content_details']//img[contains(@src,'webgateway/img/spinner.gif')]
${QueryError} xpath=//div[@id='content_details']//div[contains(@class,'error')]
${NoResultsFound} xpath=//div[@id='content_details']//p[contains(@class,'center_message message_nodata')]
Expand Down
8 changes: 4 additions & 4 deletions components/tests/ui/testcases/web/tagging_test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Test Tag
Sleep 5 # allow tags to load
Input Text id_tag robotTagTest${pid}TagOne
Click Element id_add_new_tag
Click Element xpath=//button/span[contains(text(),'Save')]
Click Dialog Button Save
Wait Until Page Contains Element xpath=//div[@class='tag']/a[contains(text(), 'robotTagTest${pid}TagOne')] 10
# Refresh, check and add another Tag, remove first one
Go To ${WELCOME URL}?show=project-${pId}
Expand All @@ -45,7 +45,7 @@ Test Tag
Click Element id=id_tag_deselect_button
Page Should Not Contain Element xpath=//div[@id='id_selected_tags']/div[contains(text(),'robotTagTest${pid}TagOne')]
# Save - check Tag added and Tag removed
Click Element xpath=//button/span[contains(text(),'Save')]
Click Dialog Button Save
Wait Until Page Contains Element xpath=//div[@class='tag']/a[contains(text(), 'robotTagTest${pid}TagTwo')] 10
Page Should Not Contain Element xpath=//div[@class='tag']/a[contains(text(), 'robotTagTest${pid}TagOne')]

Expand All @@ -71,7 +71,7 @@ Test Tag
Page Should Contain Element xpath=//div[@id='id_selected_tags']/div[contains(text(),'robotTagTest${pid}TagOne')]
Page Should Not Contain Element xpath=//div[@id='id_selected_tags']/div[contains(text(),'robotTagTest${pid}TagTwo')]
# Save - check Tag added and Tag removed
Click Element xpath=//button/span[contains(text(),'Save')]
Click Dialog Button Save
# Right panel Tag tooltip should indicate one tag is on BOTH Projects 'Can remove Tag from <b>2 objects</b>'
Wait Until Page Contains Element xpath=//span[@class='tooltip_html']/b[contains(text(),'2 objects')]
# Other tag is still on one Project
Expand All @@ -92,7 +92,7 @@ Test Tag
# Create a third Tag
Input Text id_tag robotTagTest${pid}TagThree
Click Element id_add_new_tag
Click Element xpath=//button/span[contains(text(),'Save')]
Click Dialog Button Save
# After Save, Tags Two and Three should be added, Tag One removed
# Seems we need a proper refresh here to be sure that TagOne is removed.
Go To ${WELCOME URL}?show=project-${projectId}|project-${pId}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Documentation A test suite with a single test for valid login.
... the imported resource file.

Resource ../../resources/web/webadmin.txt
Resource ../../resources/web/tree.txt
Resource ../../resources/config.txt

Suite Setup Open Browser To Webadmin And Log In As Root
Expand Down Expand Up @@ -98,9 +99,8 @@ Create Edit Group


Create Edit User
Click Link link=Users

Click Link link=Add new User
Go To ${USERS URL}
Click Link link=Add new User

${user_name} Unique name test_user
Input Text omename ${user_name}
Expand Down Expand Up @@ -131,7 +131,7 @@ Create Edit User
Input Text id_old_password ${ROOT PASSWORD}
Input Text id_password ${user_name}new
Input Text id_confirmation ${user_name}new
Click Element xpath=//button[contains(@class, "ui-button")]/span[contains(text(), "OK")]
Click Dialog Button OK
Wait Until Page Contains Password reset OK

Input Text first_name ${user_name}-Edited
Expand All @@ -141,7 +141,7 @@ Create Edit User

Check Admin Edit Self

Click Link link=Users
Go To ${USERS URL}
Click Element xpath=//table[@id="experimenterTable"]/tbody/tr[descendant::td[contains(text(), '${ROOT FULL NAME}')]]//a[contains(@class, "btn_edit")]

Wait Until Page Contains Element id=id_administrator
Expand Down
5 changes: 3 additions & 2 deletions components/tests/ui/testcases/web/webadmin_user_settings.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Documentation A test suite with a single test for valid login.
... the imported resource file.

Resource ../../resources/web/webadmin.txt
Resource ../../resources/web/tree.txt
Resource ../../resources/config.txt

Suite Setup Run Keywords Open Browser And Log In As User Maximize Browser Window
Expand Down Expand Up @@ -35,7 +36,7 @@ User Settings
Input Text id_old_password ${PASSWORD}
Input Text id_password ${temp_password}
Input Text id_confirmation ${temp_password}
Click Element xpath=//button[contains(@class, "ui-button")]/span[contains(text(), "OK")]
Click Dialog Button OK
Wait Until Page Contains Password reset OK

# Reset Password back to original
Expand All @@ -44,7 +45,7 @@ User Settings
Input Text id_old_password ${temp_password}
Input Text id_password ${PASSWORD}
Input Text id_confirmation ${PASSWORD}
Click Element xpath=//button[contains(@class, "ui-button")]/span[contains(text(), "OK")]
Click Dialog Button OK
Wait Until Page Contains Password reset OK


Expand Down

0 comments on commit 8f24bb2

Please sign in to comment.