Skip to content
This repository has been archived by the owner on Jan 17, 2023. It is now read-only.

Really fix selenium #3647

Merged
merged 2 commits into from
Oct 18, 2017
Merged

Really fix selenium #3647

merged 2 commits into from
Oct 18, 2017

Conversation

ianb
Copy link
Contributor

@ianb ianb commented Oct 17, 2017

No description provided.

ianb added 2 commits October 17, 2017 14:46
This adds a timeout after the UI is first displayed. The UI is displayed, and handlers are added, but for EVERYTHING to get setup and working takes slightly longer.
// This avoids a problem where the UI has been instantiated, and handlers
// added, but not everything is fully setup yet; by waiting we give it
// time to set everything up
return setTimeoutPromise(500);
Copy link
Member

Choose a reason for hiding this comment

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

Since we're here again, the right way to fix this, according to webdriver best practices, is to use an implicit or explicit wait, rather than bake a long delay into the tests. @davehunt any suggestions on how to ensure webdriver waits for iframed UI to be fully ready?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If we want to fix this we'd have to do something a bit fancier. The elements appear (it does wait), but if you click them right away there are problems.

This display code is the issue:

display(installHandlerOnDocument, standardOverlayCallbacks) {
return iframeSelection.display(installHandlerOnDocument)
.then(() => iframePreSelection.display(installHandlerOnDocument, standardOverlayCallbacks))
.then(() => iframePreview.display(installHandlerOnDocument, standardOverlayCallbacks));
},

All of iframeSelection.display, iframePreSelection.display and iframePreview.display have to complete before you click on elements. They all complete in a reasonable time, but not reasonable for a computer that's polling for the interface.

To fix this properly we'd have to keep that promise, and use it to guard all the actual functions in installHandlerOnDocument and standardOverlayCallbacks. It felt a bit too complicated, though I suppose it's only 15ish lines of code when I think about it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Followup in #3653

@jaredhirsch
Copy link
Member

eh, let's just land this and do the even better thing in a followup bug

# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants