-
Notifications
You must be signed in to change notification settings - Fork 84
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(menu): playwright refactor #6466
Conversation
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit bbaa149:
|
e8cb113
to
b1a8a38
Compare
|
||
const menuTypes: MenuType[] = ["white", "light", "dark", "black"]; | ||
|
||
export const MenuComponent = (props: Partial<MenuProps> & MenuDividerProps) => { |
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.
can we delete these mock components from menu-test.stories.tsx since they are already moved to the components.test-pw.tsx?
src/components/menu/menu.pw.tsx
Outdated
@@ -0,0 +1,2426 @@ | |||
/* eslint-disable @typescript-eslint/no-non-null-assertion, no-await-in-loop */ |
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.
is this line still necessary?
src/components/menu/menu.pw.tsx
Outdated
["dark", "rgb(0, 25, 38)", 4], | ||
["black", "rgb(38, 38, 38)", 6], | ||
] as [string, string, number][]).forEach(([colorName, color, menuNumber]) => { | ||
test(`should verify submenu background color is ${colorName}`, async ({ |
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.
test(`should verify submenu background color is ${colorName}`, async ({ | |
test(`should verify the ${menuNumber}th submenu background color is ${colorName}`, async ({ |
src/components/menu/menu.pw.tsx
Outdated
["dark", "rgb(0, 50, 76)", 8], | ||
["black", "rgb(0, 0, 0)", 12], | ||
] as [string, string, number][]).forEach(([colorName, color, menuNumber]) => { | ||
test(`should verify Menu background color is ${colorName}`, async ({ |
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.
test(`should verify Menu background color is ${colorName}`, async ({ | |
test(`should verify the ${menuNumber}th menu background color is ${colorName}`, async ({ |
src/components/menu/menu.pw.tsx
Outdated
["default", 1], | ||
["large", 4], | ||
] as [MenuDividerProps["size"], number][]).forEach(([size, height]) => { | ||
test(`should verify Menu Divider size is ${size}`, async ({ |
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.
test(`should verify Menu Divider size is ${size}`, async ({ | |
test(`should verify Menu Divider has the proper height when the size is ${size}`, async ({ |
src/components/menu/menu.pw.tsx
Outdated
["ArrowDown", 0], | ||
["ArrowUp", 2], | ||
] as [string, number][]).forEach(([key, tabs]) => { | ||
test(`should verify the Search component is focusable by using the ${key} key`, async ({ |
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.
test(`should verify the Search component is focusable by using the ${key} key`, async ({ | |
test(`should verify the Search component is focusable by pressing the ${key} key`, async ({ |
src/components/menu/menu.pw.tsx
Outdated
await expect(subMenuBlock).toBeVisible(); | ||
}); | ||
|
||
test(`should render with a menu item with a very long label and verify the width of the whole submenu is determined by this item`, async ({ |
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.
test(`should render with a menu item with a very long label and verify the width of the whole submenu is determined by this item`, async ({ | |
test(`should render with a menu item that has a very long label and verify the width of the whole submenu is determined by this item`, async ({ |
src/components/menu/menu.pw.tsx
Outdated
CHARACTERS.DIACRITICS, | ||
CHARACTERS.SPECIALCHARACTERS, | ||
].forEach((text) => { | ||
test(`should render with Menu Item text ${text}`, async ({ |
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.
test(`should render with Menu Item text ${text}`, async ({ | |
test(`should render with submenu text set to ${text}`, async ({ |
src/components/menu/menu.pw.tsx
Outdated
["250px", 250], | ||
] as [ScrollableBlockProps["height"], number][]).forEach( | ||
([height, pixels]) => { | ||
test(`should render with scroll block height of ${pixels}px when height prop is passed a number or string`, async ({ |
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.
test(`should render with scroll block height of ${pixels}px when height prop is passed a number or string`, async ({ | |
test(`should render with scroll block height of ${pixels}px when height prop is passed as a number or string`, async ({ |
src/components/menu/menu.pw.tsx
Outdated
await expect(fullMenuItem).toBeFocused(); | ||
}); | ||
|
||
test(`should verify that inner Menu without link is NOT available with tabbing in Fullscreen Menu`, async ({ |
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.
test(`should verify that inner Menu without link is NOT available with tabbing in Fullscreen Menu`, async ({ | |
test(`should verify that inner Menu without link is NOT available when tabbing in Fullscreen Menu`, async ({ |
src/components/menu/menu.pw.tsx
Outdated
}); | ||
|
||
test.describe("Accessibility tests for Menu component", () => { | ||
test(`should pass tests for default Menu`, async ({ mount, 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.
test(`should pass tests for default Menu`, async ({ mount, page }) => { | |
test(`should pass accessibility tests for default Menu`, async ({ mount, page }) => { |
same as below for all the accessibility tests
b1a8a38
to
fc53cd4
Compare
4d8a984
to
bbaa149
Compare
🎉 This PR is included in version 124.3.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Proposed behaviour
Refactor Menu tests from Cypress to Playwright
Current behaviour
Tests are currently Cypress
Checklist
d.ts
file added or updated if requiredQA
Additional context
N/A
Testing instructions
Testing instructions
menu.pw.tsx
file passed*.pw.tsx
files have regressed