-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Remove unnecessary awaits #5296
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
Closed
Closed
Changes from 8 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
7a3302a
remove unnecessery waits
b21197a
removed awaits
263699e
Split select options into 2
77a9edf
Update fast-cycles-bathe.md
4a9a31d
Update fast-cycles-bathe.md
0796c0e
Delete .changeset/stupid-peas-work.md
8694ffc
Merge branch 'main' into MERX-198-improvment
1c780bb
Merge branch 'main' into MERX-198-improvment
78f482a
Merge branch 'main' into MERX-198-improvment
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "saleor-dashboard": patch | ||
| --- | ||
|
|
||
| Removed unnecessary await from expect statements and split select link option into two methods to reduce flakiness. |
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,20 +14,37 @@ export class AddNavigationMenuItemDialog extends BasePage { | |
| super(page); | ||
| } | ||
|
|
||
| async selectLinkOption(option: string, optionName: string) { | ||
| async selectLinkTypeOption(linkType: string) { | ||
| await this.menuLinkType.click(); | ||
| await this.waitForDOMToFullyLoad(); | ||
| await this.menuLinkOptions.filter({ hasText: "Categories" }).waitFor({ state: "visible" }); | ||
| await this.menuLinkOptions.filter({ hasText: "Collections" }).waitFor({ state: "visible" }); | ||
| await this.menuLinkOptions.filter({ hasText: "Pages" }).waitFor({ state: "visible" }); | ||
| await expect(this.menuLinkOptions.filter({ hasText: option })).toBeEnabled(); | ||
| await this.menuLinkOptions.filter({ hasText: option }).click({ force: true }); | ||
| await this.waitForDOMToFullyLoad(); | ||
|
|
||
| // Ensure the link type option is visible and select it | ||
| const linkTypeOption = this.menuLinkOptions.filter({ hasText: linkType }); | ||
|
|
||
| await linkTypeOption.waitFor({ state: "visible" }); | ||
| await expect(linkTypeOption).toBeEnabled(); | ||
| await linkTypeOption.click({ force: true }); | ||
|
|
||
| // Verify the correct link type is selected | ||
| const selectedLinkType = await this.menuLinkType.inputValue(); | ||
|
|
||
| if (selectedLinkType !== linkType) { | ||
| throw new Error(`Expected link type "${linkType}" but found "${selectedLinkType}"`); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this should be an assert, not exception raising, this will break the test execution by unhandled error |
||
| } | ||
| } | ||
|
|
||
| async selectLinkTypeValue(optionName: string) { | ||
| await this.menuLinkValue.click(); | ||
| await this.menuLinkOptions.filter({ hasText: optionName }).waitFor({ state: "visible" }); | ||
| await expect(this.menuLinkOptions.filter({ hasText: optionName })).toBeEnabled(); | ||
| await this.menuLinkOptions.filter({ hasText: optionName }).click({ force: true }); | ||
| await this.waitForDOMToFullyLoad(); | ||
|
|
||
| // Ensure the option is present and select it | ||
| const option = this.menuLinkOptions.filter({ hasText: optionName }); | ||
|
|
||
| await option.waitFor({ state: "visible" }); | ||
| await expect(option).toBeEnabled(); | ||
| await option.click({ force: true }); | ||
|
|
||
| // Verify the correct option is selected | ||
| await expect(this.menuLinkValue).toHaveValue(optionName); | ||
| } | ||
|
|
||
|
|
||
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
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.
LLM models generate usually tons on comments, explaining what they do - it's useful when composing the final solution, but usually redundant when used in the destined codebase.