-
Notifications
You must be signed in to change notification settings - Fork 35
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
test(quantic): SFINT-5832 Sort E2E tests migrate from Cypress to Playwright #4777
base: master
Are you sure you want to change the base?
Conversation
Pull Request ReportPR Title❌ Title should follow the conventional commit spec: Example: Live demo linksBundle Size
SSR Progress
Detailed logssearch : buildInteractiveResultsearch : buildInteractiveInstantResult search : buildInteractiveRecentResult search : buildInteractiveCitation search : buildGeneratedAnswer recommendation : missing SSR support case-assist : missing SSR support insight : missing SSR support commerce : missing SSR support |
packages/quantic/force-app/main/default/lwc/quanticSort/e2e/sortObject.ts
Outdated
Show resolved
Hide resolved
packages/quantic/force-app/main/default/lwc/quanticSort/e2e/fixture.ts
Outdated
Show resolved
Hide resolved
packages/quantic/force-app/main/default/lwc/quanticSort/e2e/fixture.ts
Outdated
Show resolved
Hide resolved
packages/quantic/force-app/main/default/lwc/quanticSort/e2e/fixture.ts
Outdated
Show resolved
Hide resolved
packages/quantic/force-app/main/default/lwc/quanticSort/e2e/fixture.ts
Outdated
Show resolved
Hide resolved
packages/quantic/force-app/main/default/lwc/quanticSort/e2e/fixture.ts
Outdated
Show resolved
Hide resolved
packages/quantic/force-app/main/default/lwc/quanticSort/e2e/fixture.ts
Outdated
Show resolved
Hide resolved
packages/quantic/force-app/main/default/lwc/quanticSort/e2e/fixture.ts
Outdated
Show resolved
Hide resolved
packages/quantic/force-app/main/default/lwc/quanticSort/e2e/fixture.ts
Outdated
Show resolved
Hide resolved
packages/quantic/force-app/main/default/lwc/quanticSort/e2e/quanticSort.e2e.ts
Show resolved
Hide resolved
packages/quantic/force-app/main/default/lwc/quanticSort/e2e/quanticSort.e2e.ts
Outdated
Show resolved
Hide resolved
packages/quantic/force-app/main/default/lwc/quanticSort/e2e/sortObject.ts
Outdated
Show resolved
Hide resolved
packages/quantic/force-app/main/default/lwc/quanticSort/e2e/quanticSort.e2e.ts
Outdated
Show resolved
Hide resolved
packages/quantic/force-app/main/default/lwc/quanticSort/e2e/sortObject.ts
Outdated
Show resolved
Hide resolved
@erocheleau I will integrate the content from this PR: #4782 in this PR as well, to have more unit tests to test the component rather going E2E only. |
packages/quantic/force-app/main/default/lwc/quanticSort/e2e/fixture.ts
Outdated
Show resolved
Hide resolved
packages/quantic/force-app/main/default/lwc/quanticSort/e2e/fixture.ts
Outdated
Show resolved
Hide resolved
packages/quantic/force-app/main/default/lwc/quanticSort/e2e/fixture.ts
Outdated
Show resolved
Hide resolved
packages/quantic/force-app/main/default/lwc/quanticSort/e2e/fixture.ts
Outdated
Show resolved
Hide resolved
packages/quantic/force-app/main/default/lwc/quanticSort/e2e/fixture.ts
Outdated
Show resolved
Hide resolved
packages/quantic/force-app/main/default/lwc/quanticSort/e2e/pageObject.ts
Show resolved
Hide resolved
packages/quantic/force-app/main/default/lwc/quanticSort/e2e/quanticSort.e2e.ts
Show resolved
Hide resolved
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.
Re-read the comments that were addressed, ltgm! thank you
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.
Not done yet :)
Will review the playwright tests later
await this.sortDropDown.click(); | ||
} | ||
|
||
async focusSortDropDownEnter(): Promise<void> { |
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.
What does the "focusSortDropDownEnter" mean here?
The function clicks on the preview button and then presses Tab?
await this.page.keyboard.press('Enter'); | ||
await this.sortButton('Oldest').isVisible(); | ||
await this.page.waitForTimeout(500); | ||
await this.page.keyboard.press('ArrowDown'); | ||
await this.page.keyboard.press('Enter'); |
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.
The name of this function doesn't describe what is being done with the steps within this function, what are you trying to accomplish with that?
packages/quantic/force-app/main/default/lwc/quanticSort/e2e/quanticSort.e2e.ts
Outdated
Show resolved
Hide resolved
packages/quantic/force-app/main/default/lwc/quanticSort/__tests__/quanticSort.test.js
Outdated
Show resolved
Hide resolved
packages/quantic/force-app/main/default/lwc/quanticSort/__tests__/quanticSort.test.js
Show resolved
Hide resolved
packages/quantic/force-app/main/default/lwc/quanticSort/__tests__/quanticSort.test.js
Show resolved
Hide resolved
packages/quantic/force-app/main/default/lwc/quanticSort/__tests__/quanticSort.test.js
Show resolved
Hide resolved
packages/quantic/force-app/main/default/lwc/quanticSort/e2e/fixture.ts
Outdated
Show resolved
Hide resolved
packages/quantic/force-app/main/default/lwc/quanticSort/e2e/fixture.ts
Outdated
Show resolved
Hide resolved
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.
Some suggestions
packages/quantic/force-app/main/default/lwc/quanticSort/e2e/fixture.ts
Outdated
Show resolved
Hide resolved
packages/quantic/force-app/main/default/lwc/quanticSort/e2e/pageObject.ts
Show resolved
Hide resolved
packages/quantic/force-app/main/default/lwc/quanticSort/e2e/pageObject.ts
Outdated
Show resolved
Hide resolved
async selectSortOptionUsingArrow(): Promise<void> { | ||
await this.sortButton('Oldest').isVisible(); | ||
await this.page.waitForTimeout(500); | ||
await this.page.keyboard.press('ArrowDown'); | ||
await this.page.keyboard.press('Enter'); | ||
} |
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.
This one is weird for me, why you rely on 'Oldest' specifically, and also why do you have to wait for 500ms?
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.
After seeing the test, it shouldn't be in the pageObject
just in your test, put this:
await this.page.keyboard.press('ArrowDown');
await this.page.keyboard.press('Enter');
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.
the wait for 500ms
is to make the test for Insight use case more stable, otherwise the next keyboard action sometimes will fail.
let test; | ||
if (useCase.value === useCaseEnum.search) { | ||
test = fixtures[useCase.value] as typeof testSearch; | ||
} else { | ||
test = fixtures[useCase.value] as typeof testInsight; | ||
} |
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.
Why do you need the as typeof
?
let test; | |
if (useCase.value === useCaseEnum.search) { | |
test = fixtures[useCase.value] as typeof testSearch; | |
} else { | |
test = fixtures[useCase.value] as typeof testInsight; | |
} | |
const test = fixtures[useCase.value]; |
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 won't fix it now, as it's bit complicated. Mehdi will review and fix them later
packages/quantic/force-app/main/default/lwc/quanticSort/e2e/quanticSort.e2e.ts
Outdated
Show resolved
Hide resolved
packages/quantic/force-app/main/default/lwc/quanticSort/e2e/quanticSort.e2e.ts
Outdated
Show resolved
Hide resolved
packages/quantic/force-app/main/default/lwc/quanticSort/e2e/quanticSort.e2e.ts
Outdated
Show resolved
Hide resolved
await sort.openSortDropdownUsingEnter(); | ||
await sort.selectSortOptionUsingArrow(); | ||
selectedSortLabel = await sort.sortDropDown.textContent(); | ||
expect(selectedSortLabel).toEqual(defaultSortLabels[1]); |
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.
Again here, I would go fetch what the loaded sorts are available on the page instead of relying on the default sorts.
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.
same as above, we want to be sure the sort displays in correct order
https://coveord.atlassian.net/browse/SFINT-5832
IN THIS PR:
UNIT TESTS:
E2E PLAYWRIGHT TESTS: