Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tests involving successive `this.goBack()` and `this.goForward()` calls are flaky due to timing issues: ``` × firefox on linux 5.11.0-1020-azure - FrameTests - navigating back then forward after pushing URL state from a turbo-frame[data-turbo-action=advance] restores the frames next contents (0.629s) 367 StaleElementReference: [GET http://localhost:4444/wd/hub/session/01c3334a-e303-4d29-b392-1e4f1d4d7f5c/element/a97830bd-56a4-4b7a-86a0-9543cf697716/text] The element reference of <h2> is stale; either the element is no longer attached to the DOM, it is not in the current frame context, or the document has been refreshed 368 For documentation on this error, please visit: https://www.seleniumhq.org/exceptions/stale_element_reference.html 369 Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:53' 370 System info: host: 'fv-az214-396', ip: '10.1.0.47', os.name: 'Linux', os.arch: 'amd64', os.version: '5.11.0-1020-azure', java.version: '11.0.11' ``` In order to resolve that, this commit is more explicit with timing: navigating forward and back will wait on `turbo:load` events to fire, which won't occur until the page renders the cached version _and_ re-fetches the contents. Hopefully, this addresses the stale element failures, since the referenced element won't be replaced while being read from. This commit introduces the `this.getVisibleTextForSelector()` helper to combine the access-and-read action to a single Promise chain, instead of sequential access and read commands.
- Loading branch information
1 parent
e0ed694
commit 582d8a8
Showing
2 changed files
with
25 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters