-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initialize end to end testing in top level directory e2e. Everything related to end to end testing will be in this directory. Initialize node package with echo '{"private": true}' > e2e/package.json npm install --save-dev --prefix e2e playwright npm install --save-dev --prefix e2e @playwright/test@latest Add `node_modules/` to .gitignore. Setup basic playwright test config that will allow to parametrize the baseURL of tests. Add a minimal index.test.js test file that loads the Evy playground index.html page. It runs two tests on it: - ensure the title is "Evy | Playground" - execute `Run` and ensure the console output contains expected test.
- Loading branch information
1 parent
2997529
commit 17469d3
Showing
6 changed files
with
113 additions
and
2 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 |
---|---|---|
@@ -1,7 +1,10 @@ | ||
/.hermit/ | ||
/e2e/test-results | ||
/firebase/*.log | ||
/firebase/.firebase/ | ||
/frontend/evy.wasm | ||
/frontend/version.json | ||
/frontend/wasm_exec.js | ||
/out/ | ||
|
||
node_modules/ |
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,15 @@ | ||
const { test, expect } = require("@playwright/test") | ||
|
||
test("title", async ({ page, baseURL }) => { | ||
await page.goto(baseURL) | ||
await expect(page).toHaveTitle("evy | Playground") | ||
}) | ||
|
||
test("console output", async ({ page, baseURL }) => { | ||
await page.goto(baseURL) | ||
await page.waitForLoadState("networkidle") | ||
await page.getByRole("button", { name: "Run" }).click() | ||
const console = page.locator("css=#console") | ||
await expect(console).toContainText("x: 12") | ||
await expect(console).toContainText("🍦 big x") | ||
}) |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,7 @@ | ||
{ | ||
"private": "true", | ||
"devDependencies": { | ||
"@playwright/test": "^1.40.1", | ||
"playwright": "^1.40.1" | ||
} | ||
} |
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,6 @@ | ||
const { defineConfig, devices } = require("@playwright/test") | ||
module.exports = defineConfig({ | ||
use: { | ||
baseURL: process.env.BASEURL || "http://localhost:8080", | ||
}, | ||
}) |