-
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
79 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,79 @@ | ||
import { test, expect, type Page } from "@playwright/test"; | ||
|
||
test.describe("Modal", () => { | ||
const modalTestExpectations = [ | ||
{ | ||
url: "artifacts-custom-weewx-html/public_html/index.html", | ||
external: true, | ||
statTiles: true, | ||
}, | ||
{ | ||
url: "artifacts-custom-weewx-html/public_html/week.html", | ||
external: false, | ||
statTiles: true, | ||
}, | ||
{ | ||
url: "artifacts-custom-weewx-html/public_html/month.html", | ||
external: false, | ||
statTiles: true, | ||
}, | ||
{ | ||
url: "artifacts-custom-weewx-html/public_html/year.html", | ||
external: false, | ||
statTiles: true, | ||
}, | ||
]; | ||
|
||
for (const testExpectation of modalTestExpectations) { | ||
test(`Modal, url: ${testExpectation.url}`, async ({ page }) => { | ||
await page.goto(testExpectation.url); | ||
|
||
const modalStatET = page.locator("#modal-ET"), | ||
modalExternal1 = page.locator("#modal-external_1"), | ||
modalRadar = page.locator("#modal-radar-default"); | ||
|
||
await expect(modalStatET).toBeHidden(); | ||
await expect(modalExternal1).toBeHidden(); | ||
await expect(modalRadar).toBeHidden(); | ||
|
||
// Open stat tile modal. | ||
await page.locator('.stat-tile[data-observation="ET"]').click(); | ||
await expect(modalStatET).toBeVisible(); | ||
await expect(modalExternal1).toBeHidden(); | ||
await expect(modalRadar).toBeHidden(); | ||
|
||
await expect(page).toHaveScreenshot(); | ||
|
||
// Close stat tile modal. | ||
await modalStatET.getByRole("button", { name: "Close" }).click(); | ||
await expect(modalStatET).toBeHidden(); | ||
|
||
if (testExpectation.external) { | ||
// Open Radar tile modal. | ||
await page.locator("#panel-radar").click(); | ||
await expect(modalRadar).toBeVisible(); | ||
await expect(modalStatET).toBeHidden(); | ||
await expect(modalExternal1).toBeHidden(); | ||
|
||
await expect(page).toHaveScreenshot(); | ||
|
||
// Close Radar tile modal. | ||
await modalRadar.getByRole("button", { name: "Close" }).click(); | ||
await expect(modalRadar).toBeHidden(); | ||
|
||
// Open external tile modal. | ||
await page.locator("#tab-external_1").click(); | ||
await page.locator("#panel-external_1").click(); | ||
await expect(modalExternal1).toBeVisible(); | ||
await expect(modalStatET).toBeHidden(); | ||
await expect(modalRadar).toBeHidden(); | ||
|
||
await expect(page).toHaveScreenshot(); | ||
|
||
// Close external tile modal. | ||
await modalExternal1.getByRole("button", { name: "Close" }).click(); | ||
await expect(modalExternal1).toBeHidden(); | ||
} | ||
}); | ||
} | ||
}); |
Binary file added
BIN
+324 KB
...dal-url-artifacts-custom-weewx-html-public-html-index-html-1-chromium-linux.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
+550 KB
...dal-url-artifacts-custom-weewx-html-public-html-index-html-2-chromium-linux.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
+548 KB
...dal-url-artifacts-custom-weewx-html-public-html-index-html-3-chromium-linux.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
+330 KB
...dal-url-artifacts-custom-weewx-html-public-html-month-html-1-chromium-linux.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
+385 KB
...odal-url-artifacts-custom-weewx-html-public-html-week-html-1-chromium-linux.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
+419 KB
...odal-url-artifacts-custom-weewx-html-public-html-year-html-1-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.