-
Notifications
You must be signed in to change notification settings - Fork 576
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(e2e): switching to playwright (#1720)
* Switching to playwright * some screenshots * Updated screenshots and command to run in docker * prebuild demo app to warm up cache --------- Co-authored-by: Dmitriy Shekhovtsov <[email protected]>
- Loading branch information
Showing
49 changed files
with
254 additions
and
653 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,38 @@ | ||
import { test, expect } from "@playwright/test"; | ||
|
||
test(`navigate to main Demo page and check info`, async ({ page }) => { | ||
const topBarSelector = "mat-toolbar"; | ||
const mainContentSelector = "main"; | ||
await page.goto("/"); | ||
|
||
// wait for animations to finish | ||
await expect(page.locator(topBarSelector)).toBeVisible(); | ||
|
||
await expect(page.locator(topBarSelector)).toHaveScreenshot(); | ||
|
||
return expect(page.locator(mainContentSelector)).toBeVisible(); | ||
}); | ||
|
||
const componentsArray = [ | ||
{ url: "/#LineChart", selector: "app-line-chart" }, | ||
{ url: "/#BarChart", selector: "app-bar-chart" }, | ||
{ url: "/#DoughnutChart", selector: "app-doughnut-chart" }, | ||
{ url: "/#RadarChart", selector: "app-radar-chart" }, | ||
{ url: "/#PieChart", selector: "app-pie-chart" }, | ||
{ url: "/#PolarAreaChart", selector: "app-polar-area-chart" }, | ||
{ url: "/#BubbleChart", selector: "app-bubble-chart" }, | ||
{ url: "/#ScatterChart", selector: "app-scatter-chart" }, | ||
{ url: "/#DynamicChart", selector: "app-dynamic-chart" } | ||
]; | ||
|
||
componentsArray.forEach((component) => { | ||
test(`${component.selector}`, async ({ page }) => { | ||
await page.goto(component.url); | ||
// wait for animations to finish | ||
await expect(page.locator(component.selector) | ||
.locator("canvas")) | ||
.toBeVisible(); | ||
|
||
return expect(page.locator(component.selector).locator("canvas")).toHaveScreenshot(); | ||
}); | ||
}); |
Binary file added
BIN
+19.2 KB
...harts-demo/e2e/ng2-charts.spec.ts-snapshots/app-bar-chart-1-chromium-darwin.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
+16.9 KB
...charts-demo/e2e/ng2-charts.spec.ts-snapshots/app-bar-chart-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
+11.3 KB
...ts-demo/e2e/ng2-charts.spec.ts-snapshots/app-bubble-chart-1-chromium-darwin.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
+10.3 KB
...rts-demo/e2e/ng2-charts.spec.ts-snapshots/app-bubble-chart-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
+31.8 KB
...-demo/e2e/ng2-charts.spec.ts-snapshots/app-doughnut-chart-1-chromium-darwin.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
+52.9 KB
...s-demo/e2e/ng2-charts.spec.ts-snapshots/app-doughnut-chart-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
+14.5 KB
...s-demo/e2e/ng2-charts.spec.ts-snapshots/app-dynamic-chart-1-chromium-darwin.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
+12.6 KB
...ts-demo/e2e/ng2-charts.spec.ts-snapshots/app-dynamic-chart-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
+44.1 KB
...arts-demo/e2e/ng2-charts.spec.ts-snapshots/app-line-chart-1-chromium-darwin.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
+50.4 KB
...harts-demo/e2e/ng2-charts.spec.ts-snapshots/app-line-chart-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
+22.9 KB
...harts-demo/e2e/ng2-charts.spec.ts-snapshots/app-pie-chart-1-chromium-darwin.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
+30.7 KB
...charts-demo/e2e/ng2-charts.spec.ts-snapshots/app-pie-chart-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
+48.3 KB
...emo/e2e/ng2-charts.spec.ts-snapshots/app-polar-area-chart-1-chromium-darwin.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
+62.1 KB
...demo/e2e/ng2-charts.spec.ts-snapshots/app-polar-area-chart-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
+52.4 KB
...rts-demo/e2e/ng2-charts.spec.ts-snapshots/app-radar-chart-1-chromium-darwin.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
+66.3 KB
...arts-demo/e2e/ng2-charts.spec.ts-snapshots/app-radar-chart-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
+10.8 KB
...s-demo/e2e/ng2-charts.spec.ts-snapshots/app-scatter-chart-1-chromium-darwin.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
+9.67 KB
...ts-demo/e2e/ng2-charts.spec.ts-snapshots/app-scatter-chart-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
+5.02 KB
...ec.ts-snapshots/navigate-to-main-Demo-page-and-check-info-1-chromium-darwin.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
+5 KB
...pec.ts-snapshots/navigate-to-main-Demo-page-and-check-info-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.
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,35 @@ | ||
import { defineConfig, devices } from "@playwright/test"; | ||
import { nxE2EPreset } from "@nx/playwright/preset"; | ||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
import { workspaceRoot } from "@nx/devkit"; | ||
|
||
// For CI, you may want to set BASE_URL to the deployed application. | ||
const baseURL = process.env["BASE_URL"] || "http://localhost:4200"; | ||
|
||
/** | ||
* Read environment variables from file. | ||
* https://github.com/motdotla/dotenv | ||
*/ | ||
// require('dotenv').config(); | ||
|
||
/** | ||
* See https://playwright.dev/docs/test-configuration. | ||
*/ | ||
export default defineConfig({ | ||
...nxE2EPreset(__filename, { testDir: "./e2e" }), | ||
projects: [{ | ||
name: "chromium", | ||
use: { ...devices["Desktop Chrome"] } | ||
}], | ||
webServer: { | ||
command: "nx serve-static", | ||
url: baseURL, | ||
reuseExistingServer: !process.env.CI | ||
}, | ||
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */ | ||
use: { | ||
baseURL, | ||
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */ | ||
trace: "on-first-retry" | ||
} | ||
}); |
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
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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Binary file removed
BIN
-20.6 KB
apps/ng2-charts-e2e/src/e2e/__image_snapshots__/Charts canvas #BarChart #0.png
Binary file not shown.
Binary file removed
BIN
-10.5 KB
apps/ng2-charts-e2e/src/e2e/__image_snapshots__/Charts canvas #BubbleChart #0.png
Binary file not shown.
Binary file removed
BIN
-47.9 KB
...ng2-charts-e2e/src/e2e/__image_snapshots__/Charts canvas #DoughnutChart #0.png
Binary file not shown.
Binary file removed
BIN
-15.3 KB
.../ng2-charts-e2e/src/e2e/__image_snapshots__/Charts canvas #DynamicChart #0.png
Binary file not shown.
Binary file removed
BIN
-46.1 KB
apps/ng2-charts-e2e/src/e2e/__image_snapshots__/Charts canvas #LineChart #0.png
Binary file not shown.
Binary file removed
BIN
-29.3 KB
apps/ng2-charts-e2e/src/e2e/__image_snapshots__/Charts canvas #PieChart #0.png
Diff not rendered.
Binary file removed
BIN
-69.9 KB
...g2-charts-e2e/src/e2e/__image_snapshots__/Charts canvas #PolarAreaChart #0.png
Diff not rendered.
Binary file removed
BIN
-82.9 KB
apps/ng2-charts-e2e/src/e2e/__image_snapshots__/Charts canvas #RadarChart #0.png
Diff not rendered.
Binary file removed
BIN
-11.3 KB
.../ng2-charts-e2e/src/e2e/__image_snapshots__/Charts canvas #ScatterChart #0.png
Diff not rendered.
Binary file removed
BIN
-5.31 KB
...ge_snapshots__/Ng2 Charts Demo navigate to main Demo page and check info #0.png
Diff not rendered.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.