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

Improve popup handling #53

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

lugi0
Copy link
Contributor

@lugi0 lugi0 commented Dec 23, 2021

Signed-off-by: Luca Giorgi [email protected]

This PR fixes the bug identified in #44

Signed-off-by: Luca Giorgi <[email protected]>
Signed-off-by: Luca Giorgi <[email protected]>
Signed-off-by: Luca Giorgi <[email protected]>
@lugi0
Copy link
Contributor Author

lugi0 commented Dec 24, 2021

Looks like the teardown failed because no browser was open

FAIL | No browser is open.

Am I misunderstanding what the Maybe Accept A JupyterLab Prompt was supposed to do? @bollwyvl

# Check if a popup exists
${accept} = Get WebElements xpath:${JL_POPUP}
# Click the right most button of the popup
Run Keyword If ${accept} Click Element xpath:${JL_POPUP}/button[last()]
Copy link
Collaborator

Choose a reason for hiding this comment

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

the ordering of buttons is not as indicative as their semantic classes. the "blue" one should have the jp-mod-accept or whatever.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is not enough to correctly identify the button we want to use. As an example, the popup for saving changes to a file has the jp-mod-accept class on both the Discard and Save buttons.
accept

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have kept using the position of the button for now, since that is consistent in all cases I've seen. Perhaps we should raise a bug to jupyter for the usage of jp-mod-accept?

@lugi0
Copy link
Contributor Author

lugi0 commented Dec 24, 2021

Thanks for the review, I'll have to fix it up after the holidays though. Have a nice end of year!

@lugi0
Copy link
Contributor Author

lugi0 commented Feb 10, 2022

@bollwyvl have you had a chance to look at the latest commits?

@@ -38,6 +38,9 @@ ${JLAB XP NB FRAG} ${JLAB XP MAIN AREA FRAG}\[contains(@cla
${JLAB XP NB TOOLBAR FRAG} [contains(@class, 'jp-NotebookPanel-toolbar')]
${JLAB XP NB TOOLBAR} //div${JLAB XP NB TOOLBAR FRAG}
${JLAB XP BUSY KERNEL} //*[local-name() = 'div' and contains(@class, 'jp-FilledCircleIcon' or (local-name() = 'svg' and contains(@data-icon, 'ui-components:circle-filled')))]
${JLAB XP CONTENT XPATH} //div[contains(@class,"p-DockPanel-tabBar")]/ul[@class="p-TabBar-content"]
${JLAB XP NOT SELECTED XPATH} ${JLAB XP CONTENT XPATH}/li[not(contains(@class,"p-mod-current"))]
${JLAB POPUP} //div[contains(concat(' ',normalize-space(@class),' '),' jp-Dialog-footer ')]
Copy link
Collaborator

Choose a reason for hiding this comment

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

please add the JLAB XP to this to distinguish it from the CSS selectors

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants