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

chore: Updates integ tests for compatibility with webdriver upgrade #154

Merged
merged 1 commit into from
Sep 16, 2024

Conversation

pan-kot
Copy link
Member

@pan-kot pan-kot commented Sep 10, 2024

Preparing for changes to browser test tools: cloudscape-design/browser-test-tools#107

Rel: CR-148624506

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@pan-kot pan-kot marked this pull request as ready for review September 13, 2024 08:55
@pan-kot pan-kot requested a review from a team as a code owner September 13, 2024 08:55
@pan-kot pan-kot requested review from orangevolon and removed request for a team September 13, 2024 08:55
@@ -93,6 +96,8 @@ describe('S3 Resource Selector - Read mode', () => {
'shows alert about missing versions',
setupTest(async page => {
await page.setUriInputValue('s3://bucket-officia/particle-1ns.sim');
// click somewhere to blur the input and trigger validation
await page.click(createWrapper().findHeader().toSelector());
Copy link
Contributor

Choose a reason for hiding this comment

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

Now that we're copying the same comment and the statement it in multiple places, how about just making a function out of it?

async function waitForValidation() {
      // click somewhere to blur the input and trigger validation
      await page.click(createWrapper().findHeader().toSelector());
}

Copy link
Member Author

Choose a reason for hiding this comment

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

That click to the header is only needed to trigger a blue on the input for the validation to appear. It can as well be a click on another element or pressing Tab. The comment is needed to explain that it is not the click itself that matters but the blur. I am hesitating to create a function for it because: 1) it is hard to come up with a clear enough name, the "wait for validation" is not correct; 2) it makes an assumption that the header exists which might not be true for some new page if we want to reuse the function in there.

Copy link
Contributor

@orangevolon orangevolon Sep 16, 2024

Choose a reason for hiding this comment

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

If we can come up with a proper name for the function, the name of the function could be a very good replacement for the comment that we have repeated several times. That being said, if it's not applicable in this context then let's go with the comment 👍

@pan-kot pan-kot requested a review from orangevolon September 16, 2024 07:56
@pan-kot pan-kot merged commit 37c8bca into main Sep 16, 2024
1 check passed
@pan-kot pan-kot deleted the chore-webdriver8-1 branch September 16, 2024 08:09
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