-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Drawer: fix overlap, bottom, expand configurations in React (#3150)
- Loading branch information
1 parent
4a2386f
commit 626c785
Showing
5 changed files
with
97 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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,97 @@ | ||
import { Selector as $ } from 'testcafe'; | ||
import { createScreenshotsComparer } from 'devextreme-screenshot-comparer'; | ||
import { runManualTest } from '../../../utils/visual-tests/matrix-test-helper'; | ||
|
||
const RADIO_GROUP_CLASS = 'dx-radiogroup'; | ||
const RADIO_BUTTON_CLASS = 'dx-radiobutton'; | ||
const TOOLBAR_CLASS = 'dx-toolbar'; | ||
const BUTTON_CLASS = 'dx-button'; | ||
|
||
fixture('Drawer.TopOrBottomPosition') | ||
.page('http://localhost:8080/') | ||
.beforeEach(async (t) => { | ||
await t | ||
.resizeWindow(900, 1200); | ||
}); | ||
|
||
runManualTest('Drawer', 'TopOrBottomPosition', ['jQuery', 'React', 'Vue', 'Angular'], (test) => { | ||
test('TopOrBottomPosition -> position: bottom -> openedStateMode: overlap -> open -> resize -> close', async (t) => { | ||
const { takeScreenshot, compareResults } = createScreenshotsComparer(t); | ||
|
||
const menuButton = $(`.${TOOLBAR_CLASS} .${BUTTON_CLASS}`); | ||
const optionsGroup = $(`.${RADIO_GROUP_CLASS}`); | ||
|
||
const openedStateModes = optionsGroup.nth(0).find(`.${RADIO_BUTTON_CLASS}`); | ||
const positions = optionsGroup.nth(1).find(`.${RADIO_BUTTON_CLASS}`); | ||
|
||
await t | ||
.click(positions.nth(1)) | ||
.click(openedStateModes.nth(2)); | ||
|
||
await takeScreenshot('drawer(overlap, bottom, expand).png'); | ||
|
||
await t | ||
.click(menuButton) | ||
.wait(500); | ||
|
||
await takeScreenshot('drawer_opened(overlap, bottom, expand).png'); | ||
|
||
await t | ||
.resizeWindow(900, 1000); | ||
|
||
await takeScreenshot('drawer_after_resize(overlap, bottom, expand).png'); | ||
|
||
await t | ||
.resizeWindow(900, 1200); | ||
|
||
await t | ||
.click(menuButton) | ||
.wait(500); | ||
|
||
await takeScreenshot('drawer_closed(overlap, bottom, expand).png'); | ||
|
||
await t | ||
.expect(compareResults.isValid()) | ||
.ok(compareResults.errorMessages()); | ||
}); | ||
|
||
test('TopOrBottomPosition -> openedStateMode: overlap -> position: bottom -> open -> resize -> close', async (t) => { | ||
const { takeScreenshot, compareResults } = createScreenshotsComparer(t); | ||
|
||
const menuButton = $(`.${TOOLBAR_CLASS} .${BUTTON_CLASS}`); | ||
const optionsGroup = $(`.${RADIO_GROUP_CLASS}`); | ||
|
||
const openedStateModes = optionsGroup.nth(0).find(`.${RADIO_BUTTON_CLASS}`); | ||
const positions = optionsGroup.nth(1).find(`.${RADIO_BUTTON_CLASS}`); | ||
|
||
await t | ||
.click(openedStateModes.nth(2)) | ||
.click(positions.nth(1)); | ||
|
||
await takeScreenshot('drawer(overlap, bottom, expand).png'); | ||
|
||
await t | ||
.click(menuButton) | ||
.wait(500); | ||
|
||
await takeScreenshot('drawer_opened(overlap, bottom, expand).png'); | ||
|
||
await t | ||
.resizeWindow(900, 1000); | ||
|
||
await takeScreenshot('drawer_after_resize(overlap, bottom, expand).png'); | ||
|
||
await t | ||
.resizeWindow(900, 1200); | ||
|
||
await t | ||
.click(menuButton) | ||
.wait(500); | ||
|
||
await takeScreenshot('drawer_closed(overlap, bottom, expand).png'); | ||
|
||
await t | ||
.expect(compareResults.isValid()) | ||
.ok(compareResults.errorMessages()); | ||
}); | ||
}); |
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
+93.9 KB
testing/widgets/drawer/etalons/drawer_after_resize(overlap, bottom, expand).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
+136 KB
testing/widgets/drawer/etalons/drawer_closed(overlap, bottom, expand).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
+94.9 KB
testing/widgets/drawer/etalons/drawer_opened(overlap, bottom, expand).png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.