Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: 2.6 xpath fixes #1114

Merged
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -823,7 +823,7 @@ Handle Deletion Confirmation Modal
IF "${additional_msg}" != "${NONE}"
Run Keyword And Continue On Failure Page Should Contain ${additional_msg}
END
Run Keyword And Continue On Failure Page Should Contain Confirm deletion by typing ${item_title} below:
Run Keyword And Continue On Failure Page Should Contain Type ${item_title} to confirm deletion.
Run Keyword And Continue On Failure Element Should Be Disabled ${delete_btn_xp}
Input Text xpath=//input[@id="delete-modal-input"] ${item_title}
Wait Until Element Is Enabled ${delete_btn_xp}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
[Documentation] Checks if the owner of a DS project is displayed and corresponds to the expected one
[Arguments] ${project_title} ${expected_username}
Run Keyword And Continue On Failure
... Page Should Contain Element xpath=//td[div/div/a[text()="${project_title}"]]/small[text()="${expected_username}"]
... Page Should Contain Element xpath=//a[text()="${project_title}"]/ancestor::td[@data-label='Name']//small[text()="${expected_username}"]

Check warning

Code scanning / Robocop

Line is too long ({{ line_length }}/{{ allowed_length }}) Warning test

Line is too long (149/120)

Create Data Science Project
[Documentation] Creates a DS Project with the given ${title}, ${description} and ${resource_name}
Expand Down Expand Up @@ -185,7 +185,7 @@
${namespace}= Get Openshift Namespace From Data Science Project project_title=${project_title}
${_} ${workbench_cr_name}= Get Openshift Notebook CR From Workbench workbench_title=${workbench_title}
... namespace=${namespace}
Run Keyword And Continue On Failure Page Should Contain Element xpath=//tr[td/div/div/a[text()="${project_title}"]]/td[@data-label="Status"]//div[div/label[contains(@for,"${workbench_cr_name}")]]/div//p[text()="${status}"] # robocop: disable
Run Keyword And Continue On Failure Page Should Contain Element xpath=//a[text()="${project_title}"]/ancestor::tr/td[@data-label="Status"]//p[text()="${status}"] # robocop: disable

Start Workbench From Projects Home Page
[Documentation] Triggers the workbench "start" process from DS Projects home page.
Expand All @@ -205,7 +205,8 @@
... Get Openshift Notebook CR From Workbench workbench_title=${workbench_title}
... namespace=${namespace}
END
Click Element xpath=//tr[td/div/div/a[text()="${project_title}"]]/td/div//label[contains(@for,"${workbench_cr_name}")]/span[@class="pf-c-switch__toggle"] # robocop: disable
Click Element xpath=//a[text()="${workbench_title}"]/ancestor::tr//a[text()="${project_title}"]/ancestor::tr//td[@data-label="Status"]//label[@class="pf-v5-c-switch"] # robocop: disable

ELSE
Fail msg=Cannot start ${workbench_title} workbench because it is not stopped.
END
Expand Down Expand Up @@ -233,7 +234,7 @@
END
${_} ${workbench_cr_name}= Get Openshift Notebook CR From Workbench workbench_title=${workbench_title} namespace=${namespace}
END
Click Element xpath=//tr[td/div/div/a[text()="${project_title}"]]/td/div//label[contains(@for,"${workbench_cr_name}")]/span[@class="pf-c-switch__toggle"] # robocop: disable
Click Element xpath=//a[text()="${workbench_title}"]/ancestor::tr//a[text()="${project_title}"]/ancestor::tr//td[@data-label="Status"]//label[@class="pf-v5-c-switch"] # robocop: disable
Handle Stop Workbench Confirmation Modal press_cancel=${press_cancel}
ELSE
Fail msg=Cannot stop ${workbench_title} workbench because it is neither starting nor running.
Expand All @@ -260,7 +261,7 @@
${is_started}= Run Keyword And Return Status Workbench Status Should Be From Projects Home Page
... workbench_title=${workbench_title} status=${WORKBENCH_STATUS_RUNNING} project_title=${project_title}
IF ${is_started} == ${TRUE}
Click Element xpath=//tr[td/div/div/a[text()="${project_title}"]]/td//a[text()="${workbench_title}"]
Click Element xpath=//tr//a[text()="${project_title}"]/ancestor::tr/td[@data-label="Workbench"]//a[text()="${workbench_title}"]

Check warning

Code scanning / Robocop

Line is too long ({{ line_length }}/{{ allowed_length }}) Warning test

Line is too long (141/120)
Switch Window NEW
Access To Workbench username=${username} password=${password}
... auth_type=${auth_type}
Expand All @@ -272,7 +273,7 @@
[Documentation] Checks the workbench launch link is disabled from DS Projects home page.
[Arguments] ${workbench_title} ${project_title}
${link_status}= Get Element Attribute
... xpath=//tr[td/div/div/a[text()="${project_title}"]]/td//a[text()="${workbench_title}"] aria-disabled
... xpath=//tr//a[text()="${project_title}"]/ancestor::tr/td[@data-label="Workbench"]//a[text()="${workbench_title}"] aria-disabled

Check warning

Code scanning / Robocop

Line is too long ({{ line_length }}/{{ allowed_length }}) Warning test

Line is too long (141/120)
Should Be Equal As Strings ${link_status} true
... msg=Workbench launch link should be disabled for workbench ${workbench_title} in project ${project_title}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Resource Projects.resource
${STORAGE_SECTION_XP}= xpath=//div[@id="cluster-storages"]
${STORAGE_NAME_INPUT_XP}= xpath=//input[@name="create-new-storage-name"]
${STORAGE_DESCR_INPUT_XP}= xpath=//textarea[@name="create-new-storage-description"]
${STORAGE_SIZE_INPUT_XP}= xpath=//div/input[contains(@aria-label,"input") or contains(@aria-label,"Input")]
${STORAGE_SIZE_INPUT_XP}= xpath=//input[@aria-label="Input"]
${STORAGE_SIZE_PLUS_BTN_XP}= xpath=//div/button[@aria-label="Plus"]
${STORAGE_MOUNT_DIR_INPUT_XP}= xpath=//input[@aria-label="mount-path-folder-value"]
${STORAGE_WORKBENCH_SELECTOR_XP}= xpath=//div[contains(@class,"modal")]//div[contains(@class,"pf-c-select")]/ul/li
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@
... Wait Until Element Is Enabled xpath=//input[@placeholder="Select a persistent storage"]
Click Element xpath=//input[@placeholder="Select a persistent storage"]
Wait Until Page Contains Element xpath=//ul/li/button[text()="${name}"]
Wait Until Page Contains Element xpath=//div[contains(@class,"pf-c-select")]/ul/li/button[text()="${name}"]
Wait Until Page Contains Element xpath=//ul[@aria-label="Persistent storage select"]//button[text()="${name}"]
Click Element xpath=//ul/li/button[text()="${name}"]

Select Workbench Jupyter Image
Expand Down Expand Up @@ -309,7 +309,7 @@
${is_stopped}= Run Keyword And Return Status Workbench Status Should Be
... workbench_title=${workbench_title} status=${WORKBENCH_STATUS_STOPPED}
IF ${is_stopped} == ${TRUE}
Click Element ${WORKBENCH_SECTION_XP}//tr[td[@data-label="Name"]/*[div[text()="${workbench_title}"]]]/td[@data-label="Status"]//span[@class="pf-c-switch__toggle"]
Click Element ${WORKBENCH_SECTION_XP}//div[text()="${workbench_title}"]/ancestor::tr/td[@data-label="Status"]//label[@data-ouia-component-type="PF5/Switch"]

Check warning

Code scanning / Robocop

Line is too long ({{ line_length }}/{{ allowed_length }}) Warning test

Line is too long (170/120)
ELSE
Log msg=Cannot start ${workbench_title} workbench because it is not stopped.
END
Expand Down Expand Up @@ -355,7 +355,7 @@
${is_starting}= Run Keyword And Return Status Workbench Status Should Be
... workbench_title=${workbench_title} status=${WORKBENCH_STATUS_STARTING}
IF ${is_started} == ${TRUE} or ${is_starting} == ${TRUE}
Click Element ${WORKBENCH_SECTION_XP}//tr[td[@data-label="Name"]/*[div[text()="${workbench_title}"]]]/td[@data-label="Status"]//span[@class="pf-c-switch__toggle"]
Click Element ${WORKBENCH_SECTION_XP}//div[text()="${workbench_title}"]/ancestor::tr/td[@data-label="Status"]//label[@data-ouia-component-type="PF5/Switch"]

Check warning

Code scanning / Robocop

Line is too long ({{ line_length }}/{{ allowed_length }}) Warning test

Line is too long (170/120)
Wait Until Generic Modal Appears
Handle Stop Workbench Confirmation Modal press_cancel=${press_cancel}
... from_running=${from_running}
Expand Down Expand Up @@ -385,9 +385,9 @@
Click Action From Actions Menu
[Documentation] Clicks an action from Actions menu (3-dots menu on the right)
[Arguments] ${item_title} ${item_type} ${action}
Click Element xpath=//tr[td[@data-label="Name"]//*[text()="${item_title}"]]/td[@class="pf-c-table__action"]/div/button[@aria-label="Actions"]
Wait Until Page Contains Element xpath=//tr[td[@data-label="Name"]//*[text()="${item_title}"]]/td[@class="pf-c-table__action"]/div/ul/li/button[text()="${action} ${item_type}"]
Click Element xpath=//tr[td[@data-label="Name"]//*[text()="${item_title}"]]/td[@class="pf-c-table__action"]/div/ul/li/button[text()="${action} ${item_type}"]
Click Element xpath=//*[text()="ODS-CI Common Prj"]/ancestor::tr//td/button[@aria-label="Kebab toggle"]
Wait Until Page Contains Element xpath=//*[text()="${item_title}"]/ancestor::tr//td//li//span[text()="${action} ${item_type}"]

Check warning

Code scanning / Robocop

Line is too long ({{ line_length }}/{{ allowed_length }}) Warning test

Line is too long (136/120)
Click Element xpath=//*[text()="${item_title}"]/ancestor::tr//td//li//span[text()="${action} ${item_type}"]

Delete Workbench
[Documentation] Deletes a workbench
Expand Down
Loading