-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(test): move from cypress to playwright
- Loading branch information
Showing
23 changed files
with
45,024 additions
and
45,471 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
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,34 @@ | ||
import { test } from "@playwright/test"; | ||
import { attachCoverageReport } from "monocart-reporter"; | ||
const HOME = "localhost:4200"; | ||
|
||
test("Take V8 and Istanbul coverage report", async ({ page, browserName }) => { | ||
if (browserName === "chromium") { | ||
await Promise.all([ | ||
page.coverage.startJSCoverage({ | ||
resetOnNavigation: false, | ||
}), | ||
page.coverage.startCSSCoverage({ | ||
resetOnNavigation: false, | ||
}), | ||
]); | ||
|
||
await page.goto(HOME); | ||
|
||
// delay for mock code execution | ||
await new Promise((resolve) => { | ||
setTimeout(resolve, 500); | ||
}); | ||
|
||
const [jsCoverage, cssCoverage] = await Promise.all([ | ||
page.coverage.stopJSCoverage(), | ||
page.coverage.stopCSSCoverage(), | ||
]); | ||
await page.close(); | ||
|
||
const coverageList = [...jsCoverage, ...cssCoverage]; | ||
|
||
const v8 = await attachCoverageReport(coverageList, test.info(), {}); | ||
console.log(v8.summary); | ||
} | ||
}); |
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,26 @@ | ||
import { test, expect } from "@playwright/test"; | ||
const HOME = "localhost:4200"; | ||
|
||
test("has title", async ({ page }) => { | ||
await page.goto(HOME); | ||
|
||
// Expect a title "to contain" a substring. | ||
await expect(page).toHaveTitle(/WordWeaver/); | ||
}); | ||
|
||
test("navigate to tableviewer", async ({ page }) => { | ||
await page.goto(HOME + "/tableviewer"); | ||
|
||
// Expects page to have a heading with the name of Installation. | ||
await expect(page.url()).toContain("tableviewer"); | ||
}); | ||
|
||
test("get started link", async ({ page }) => { | ||
await page.goto(HOME); | ||
|
||
// Click the get started link. | ||
await page.getByTestId("start").click(); | ||
|
||
// Expects page to have a heading with the name of Installation. | ||
await expect(page.url()).toContain("stepper"); | ||
}); |
Oops, something went wrong.