-
Notifications
You must be signed in to change notification settings - Fork 205
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
Fix waitForSelector calls in create-daml-app-tests #6253
Conversation
`waitForSelector` returns immediately if the selector is already present (which is documented). This means that the waitForSelector after the second follow isn’t doing anything since we already waited for after the first follow. `waitForFunction` seemed like the simplest solution and doesn’t require patching the HTML which is a bit finnicky in the compat tests. changelog_begin changelog_end
await page1.waitForFunction( | ||
() => document.querySelectorAll(".test-select-following").length == 2 | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't this make the length check below redundant?
expect(followingList11).toHaveLength(2);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kind of but it seemed reasonable to keep the assertion separate from the check for how long we wait. Otherwise this is easy to get lost during refactoring.
await page2.waitForFunction( | ||
() => document.querySelectorAll(".test-select-following").length == 2 | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
waitForSelector returns immediately if the selector is already present (which is documented). ...
page2
is a separate result of newUiPage
than page1
. Do I understand correctly that the presence of .test-select-following
on page1
influences the query on page2
? How is that happening?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I’m not following, we waited on page2
before, we wait on page2
now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, nevermind, I misread the description of the issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
waitForSelector
returns immediately if the selector is alreadypresent (which is documented). This means that the waitForSelector
after the second follow isn’t doing anything since we already waited
for after the first follow.
waitForFunction
seemed like the simplestsolution and doesn’t require patching the HTML which is a bit finnicky
in the compat tests.
changelog_begin
changelog_end
Pull Request Checklist
CHANGELOG_BEGIN
andCHANGELOG_END
tagsNOTE: CI is not automatically run on non-members pull-requests for security
reasons. The reviewer will have to comment with
/AzurePipelines run
totrigger the build.