Skip to content

Pass CI on main branch#443

Closed
seanpdoyle wants to merge 1 commit intohotwired:mainfrom
seanpdoyle:fix-test-suite
Closed

Pass CI on main branch#443
seanpdoyle wants to merge 1 commit intohotwired:mainfrom
seanpdoyle:fix-test-suite

Conversation

@seanpdoyle
Copy link
Copy Markdown
Contributor

Merging 9c74f77 introduced a TypeScript build error, which is
failing our CI build. This commit replaces the old formSubmitted
helper with the newer formSubmitEnded.

Attempt to resolve flaky tests

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.

Merging [9c74f77][] introduced a TypeScript build error, which is
failing our CI build. This commit replaces the old `formSubmitted`
helper with the newer `formSubmitEnded`.

[9c74f77]: hotwired@9c74f77#diff-225e8f674fa1e4fd108c22a917fd5673e51909d4a5d8958e4874ae9e402dca2f

Attempt to resolve flaky tests
---

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.
@seanpdoyle
Copy link
Copy Markdown
Contributor Author

seanpdoyle commented Nov 12, 2021

@dhh this passes CI and resolves a test suite regression that has been failing commits on main.

@dhh
Copy link
Copy Markdown
Member

dhh commented Nov 13, 2021

Solved via #444

@dhh dhh closed this Nov 13, 2021
@seanpdoyle seanpdoyle deleted the fix-test-suite branch November 13, 2021 12:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants