Repository navigation
Navigation: migrate Accordion, Button, ButtonGroup, Drawer, Gallery, Stepper, TabPanel and Tabs e2e tests to Playwright #36471
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
Merged
+1,756
−2,262
Merged
Changes from all commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
55ac55d
Navigation: add the Playwright models for the buttons and tabs tests
dmlvr a0a6cad
Navigation: add a click helper that reads TestCafe click offsets
dmlvr 9c582b2
Navigation: migrate the Accordion, ButtonGroup and Gallery e2e tests …
dmlvr 998a76c
Navigation: migrate the Button and FAB e2e tests to Playwright
dmlvr 61baa0f
Navigation: migrate the Stepper and Tabs e2e tests to Playwright
dmlvr 42819a4
Navigation: migrate the TabPanel e2e tests to Playwright
dmlvr 5af65bf
Navigation: migrate the Drawer e2e tests to Playwright
dmlvr 29de5dc
update codeowners
dmlvr 9291e97
add new etalons
dmlvr cc9c365
update two menu's etalons
dmlvr 2fbc0fd
Navigation: add the Playwright models for the buttons and tabs tests
dmlvr 03cd833
Navigation: add a click helper that reads TestCafe click offsets
dmlvr cc5a20e
Navigation: migrate the Accordion, ButtonGroup and Gallery e2e tests …
dmlvr 74e441c
Navigation: migrate the Button and FAB e2e tests to Playwright
dmlvr 2ef6bac
Navigation: migrate the Stepper and Tabs e2e tests to Playwright
dmlvr b2fff1c
Navigation: migrate the TabPanel e2e tests to Playwright
dmlvr 6976174
Navigation: migrate the Drawer e2e tests to Playwright
dmlvr 4f06e7c
update codeowners
dmlvr 4ddbc08
add new etalons
dmlvr fb5d037
update two menu's etalons
dmlvr 07c3cc5
Merge branch '27_1_playwrite_buttons_tabs' of github.com:dmlvr/DevExt…
dmlvr 76943ea
Merge remote-tracking branch 'upstream/main' into 27_1_playwrite_butt…
dmlvr 5917290
Merge branch 'main' into 27_1_playwrite_buttons_tabs
dmlvr f9e424f
update etalons
dmlvr 7849263
Merge branch '27_1_playwrite_buttons_tabs' of github.com:dmlvr/DevExt…
dmlvr 5fa69da
Merge remote-tracking branch 'upstream/main' into 27_1_playwrite_butt…
dmlvr 98fcc8a
CI: drop the TestCafe navigation job, its folder has no tests left
dmlvr 3c2135b
fix by review
dmlvr dee58f2
Playwright: move expectImagesLoaded to the common DOM helpers
dmlvr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
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
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,15 @@ | ||
| import type { Locator, Page } from '@playwright/test'; | ||
| import { pointWithin } from './dragUtils'; | ||
|
|
||
| // TestCafe's "t.click(target, { offsetX, offsetY })" clicked the point even when it lay outside the | ||
| // target ("body" with offsetY: 400 on a shorter page), so this clicks the page point with the mouse | ||
| // instead of asking the target to receive the click. | ||
| export const clickWithOffset = async ( | ||
| page: Page, | ||
| target: Locator, | ||
| { offsetX, offsetY }: { offsetX?: number; offsetY?: number } = {}, | ||
| ): Promise<void> => { | ||
| const { x, y } = await pointWithin(target, offsetX, offsetY); | ||
|
|
||
| await page.mouse.click(x, y); | ||
| }; | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| import type { Locator, Page } from '@playwright/test'; | ||
| import type { WidgetName } from './types'; | ||
| import Widget from './internal/widget'; | ||
| import Button from './button'; | ||
|
|
||
| const CLASS = { | ||
| item: 'dx-button', | ||
| }; | ||
|
|
||
| export default class ButtonGroup extends Widget { | ||
| name: WidgetName = 'dxButtonGroup'; | ||
|
|
||
| public readonly items: Locator; | ||
|
|
||
| constructor(page: Page, selector: Locator | string) { | ||
| super(page, selector); | ||
|
|
||
| this.items = this.element.locator(`.${CLASS.item}`); | ||
| } | ||
|
|
||
| public getItem(index = 0): Button { | ||
| return new Button(this.page, this.items.nth(index)); | ||
| } | ||
| } |
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,15 @@ | ||
| import type { WidgetName } from '../types'; | ||
| import Widget from '../internal/widget'; | ||
| import GalleryIndicatorItem from './indicatorItem'; | ||
|
|
||
| const CLASS = { | ||
| indicatorItem: 'dx-gallery-indicator-item', | ||
| }; | ||
|
|
||
| export default class Gallery extends Widget { | ||
| name: WidgetName = 'dxGallery'; | ||
|
|
||
| public getIndicatorItem(index = 0): GalleryIndicatorItem { | ||
| return new GalleryIndicatorItem(this.element.locator(`.${CLASS.indicatorItem}`).nth(index)); | ||
| } | ||
| } |
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,18 @@ | ||
| import type { Locator } from '@playwright/test'; | ||
| import { expectClass } from '../internal/classMatcher'; | ||
|
|
||
| const CLASS = { | ||
| selected: 'dx-gallery-indicator-item-selected', | ||
| }; | ||
|
|
||
| export default class GalleryIndicatorItem { | ||
| public readonly element: Locator; | ||
|
|
||
| constructor(element: Locator) { | ||
| this.element = element; | ||
| } | ||
|
|
||
| public expectSelected(present = true): Promise<void> { | ||
| return expectClass(this.element, CLASS.selected, present); | ||
| } | ||
| } |
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,15 @@ | ||
| import type { WidgetName } from './types'; | ||
| import Widget from './internal/widget'; | ||
| import FocusableElement from './internal/focusable'; | ||
|
|
||
| const CLASS = { | ||
| item: 'dx-multiview-item', | ||
| }; | ||
|
|
||
| export default class MultiView extends Widget { | ||
| name: WidgetName = 'dxMultiView'; | ||
|
|
||
| public getItem(index = 0): FocusableElement { | ||
| return new FocusableElement(this.element.locator(`.${CLASS.item}`).nth(index)); | ||
| } | ||
| } |
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,15 @@ | ||
| import type { Locator } from '@playwright/test'; | ||
| import type { WidgetName } from './types'; | ||
| import Widget from './internal/widget'; | ||
|
|
||
| const CLASS = { | ||
| item: 'dx-step', | ||
| }; | ||
|
|
||
| export default class Stepper extends Widget { | ||
| name: WidgetName = 'dxStepper'; | ||
|
|
||
| public getItem(index = 0): Locator { | ||
| return this.element.locator(`.${CLASS.item}`).nth(index); | ||
| } | ||
| } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| import type { WidgetName } from './types'; | ||
| import Widget from './internal/widget'; | ||
| import FocusableElement from './internal/focusable'; | ||
|
|
||
| const CLASS = { | ||
| item: 'dx-tab', | ||
| }; | ||
|
|
||
| export default class Tabs extends Widget { | ||
| name: WidgetName = 'dxTabs'; | ||
|
|
||
| public getItem(index = 0): FocusableElement { | ||
| return new FocusableElement(this.element.locator(`.${CLASS.item}`).nth(index)); | ||
| } | ||
| } |
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 was deleted.
Oops, something went wrong.
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,36 @@ | ||
| import type { Item } from 'devextreme/ui/accordion'; | ||
| import { test } from '../../../fixtures'; | ||
| import { createWidget } from '../../../helpers/createWidget'; | ||
| import { appendElementTo, setAttribute } from '../../../helpers/domUtils'; | ||
| import { testScreenshot } from '../../../helpers/screenshots'; | ||
|
|
||
| test.describe('Accordion_common', () => { | ||
| test('Accordion items render (T865742)', async ({ page }) => { | ||
| await appendElementTo(page, '#container', 'div', 'accordion'); | ||
| await appendElementTo(page, '#container', 'div', 'accordion2'); | ||
|
|
||
| await setAttribute(page, '#container', 'style', 'display: flex; gap: 50px;'); | ||
|
|
||
| const items: Item[] = [ | ||
| { title: 'Some text 1', icon: 'coffee' }, | ||
| { title: 'Some text 2' }, | ||
| { title: 'Some text 3' }, | ||
| ]; | ||
|
|
||
| await createWidget(page, 'dxAccordion', { items, width: 500 }, '#accordion'); | ||
| await createWidget(page, 'dxAccordion', { items, rtlEnabled: true, width: 500 }, '#accordion2'); | ||
|
|
||
| await testScreenshot(page, 'Accordion items render.png', { element: '#container' }); | ||
| }); | ||
|
|
||
| test('Icon-only button should be rendered correctly (T851081)', async ({ page }) => { | ||
| await appendElementTo(page, '#container', 'div', 'accordion'); | ||
|
|
||
| await createWidget(page, 'dxAccordion', () => ({ | ||
| dataSource: [{}], | ||
| itemTitleTemplate: () => ($('<div>') as any).dxButton({ icon: 'coffee' }), | ||
| }), '#accordion'); | ||
|
|
||
| await testScreenshot(page, 'Accordion with icon-only button.png', { element: '#container' }); | ||
| }); | ||
| }); |
Binary file added
BIN
+10.1 KB
...avigation/accordion/etalons/Accordion items render (fluent-next.blue.light).png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+8.76 KB
...sts/navigation/accordion/etalons/Accordion items render (fluent.blue.light).png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.43 KB
.../accordion/etalons/Accordion with icon-only button (fluent-next.blue.light).png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.5 KB
...ation/accordion/etalons/Accordion with icon-only button (fluent.blue.light).png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Oops, something went wrong.
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.