-
Notifications
You must be signed in to change notification settings - Fork 373
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Preview tab: Show overlay popup on selected mobile devices. (#5742)
* resolve #5700 Preview tab: Show overlay popup on selected mobile devices. * #5700 Preview tab: Show overlay popup on selected mobile devices: update test * work #5700 Preview tab: Show overlay popup on selected mobile devices. --------- Co-authored-by: OlgaLarina <[email protected]>
- Loading branch information
1 parent
45caa3e
commit 29a2ef7
Showing
6 changed files
with
83 additions
and
10 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
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
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,60 @@ | ||
import { url, getTabbedMenuItemByText, setJSON, creatorTabPreviewName, getBarItemByTitle, getListItemByText } from "../helper"; | ||
import { Selector } from "testcafe"; | ||
const title = "Preview tab simulator"; | ||
|
||
fixture`${title}`.page`${url}`.beforeEach( | ||
async (t) => { | ||
await t.maximizeWindow(); | ||
} | ||
); | ||
|
||
test("Simulator popups", async (t) => { | ||
await setJSON({ | ||
"pages": [ | ||
{ | ||
"name": "page1", | ||
"elements": [ | ||
{ | ||
"type": "dropdown", | ||
"name": "question1", | ||
"choices": [ | ||
"Item 1", | ||
"Item 2", | ||
"Item 3" | ||
] | ||
} | ||
] | ||
} | ||
] | ||
}); | ||
|
||
const dropdownSelect = Selector(".sd-dropdown"); | ||
const dropdownPopup = Selector(".svd-simulator-content .sv-popup"); | ||
const dropdownPopupContainer = dropdownPopup.find(".sv-popup__container"); | ||
const tabletPopup = "sv-popup--tablet"; | ||
const overlayPopup = "sv-popup--dropdown-overlay"; | ||
|
||
await t | ||
.click(getTabbedMenuItemByText(creatorTabPreviewName)) | ||
.expect(dropdownPopupContainer.visible).notOk() | ||
|
||
.click(dropdownSelect) | ||
.expect(dropdownPopupContainer.visible).ok() | ||
.expect(dropdownPopup.classNames).notContains(overlayPopup) | ||
.expect(dropdownPopup.classNames).notContains(tabletPopup) | ||
|
||
.click(getBarItemByTitle("Select device type")) | ||
.click(getListItemByText("iPad Air")) | ||
|
||
.click(dropdownSelect) | ||
.expect(dropdownPopupContainer.visible).ok() | ||
.expect(dropdownPopup.classNames).contains(overlayPopup) | ||
.expect(dropdownPopup.classNames).contains(tabletPopup) | ||
|
||
.click(getBarItemByTitle("Select device type")) | ||
.click(getListItemByText("iPhone 15")) | ||
.click(dropdownSelect) | ||
.expect(dropdownPopupContainer.visible).ok() | ||
.expect(dropdownPopup.classNames).contains(overlayPopup) | ||
.expect(dropdownPopup.classNames).notContains(tabletPopup); | ||
}); |
Binary file modified
BIN
-987 Bytes
(89%)
visualRegressionTests/tests/designer/etalons/test-tab-opened-dropdown-mobile.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 modified
BIN
+6.82 KB
(180%)
visualRegressionTests/tests/designer/etalons/test-tab-opened-dropdown.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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