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

Spawn in same tab for rhods 1.17+ #571

Merged
merged 3 commits into from
Sep 21, 2022
Merged
Changes from all 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
14 changes: 13 additions & 1 deletion tests/Resources/Page/ODH/JupyterHub/JupyterHubSpawner.robot
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,12 @@ Get Spawner Environment Variable Value
Spawn Notebook
[Documentation] Start the notebook pod spawn and wait ${spawner_timeout} seconds (DEFAULT: 600s)
[Arguments] ${spawner_timeout}=600 seconds
# TODO: Make sure server spawns in same tab in 1.17+
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe my solution wasn't the best but I dealt with something similar at

${is_data_collection_enabled}= Run Keyword And Return Status Checkbox Should Be Selected

# Currently no way to know if option already selected or not
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what about something like that ? 🤔

  ${notebook_browser_tab_preference}=  Set Variable  //input[@id="checkbox-notebook-browser-tab-preference"]
  ${new_tab_checked}  Get Element Attribute  ${notebook_browser_tab_preference}  checked
  Run Keyword If  "${new_tab_checked}" == "${None}"  Click Element  xpath:${notebook_browser_tab_preference}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Last I looked at this the checked attribute was no different between the checkbox actually being checked or not.
I went down a rabbit hole chasing Checkbox Should Be Selected and Select Checkbox keywords inherited from Selenium to try and understand what they were doing, but I came up empty handed since it looks like those rely on the WebDriver / Browser / WebElement combination to behave according to the Living HTML standard and self-report their own selectedness or checkedness

#${version-check}= Is RHODS Version Greater Or Equal Than 1.17.0
#IF ${version-check}==True
# Click Element xpath://input[@id="checkbox-notebook-browser-tab-preference"]
#END
Click Button Start server
# Waiting for 60 seconds, since a long wait seems to redirect the user to the control panel
# if the spawn was successful
Expand Down Expand Up @@ -187,7 +193,13 @@ Spawn Notebook
END
END
Wait Until Element Is Visible xpath://div[@role="progressbar"]
Wait Until Page Does Not Contain Element xpath://div[@role="progressbar"] ${spawner_timeout}
${version-check}= Is RHODS Version Greater Or Equal Than 1.17.0
IF ${version-check}==True
Wait Until Page Contains The notebook server is up and running. ${spawner_timeout}
Click Button Open in current tab
ELSE
Wait Until Page Does Not Contain Element xpath://div[@role="progressbar"] ${spawner_timeout}
END

Has Spawn Failed
[Documentation] Checks if spawning the image has failed
Expand Down