Add a playwright test that checks static generation (#2608)
* add a playwright test that checks static generation * add playwright-static-generation to the workspace * fix static-generation name in CLI
This commit is contained in:
1 parent
f07ab370b9
commit
b13236cd38
8 files changed
+90
-1
No files matched your search
@@ -0,0 +1,21 @@
|
||||
// @ts-check
|
||||
const { test, expect } = require("@playwright/test");
|
||||
|
||||
test("button click", async ({ page }) => {
|
||||
await page.goto("http://localhost:2222");
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
// Expect the page to contain the counter text.
|
||||
const main = page.locator("#main");
|
||||
await expect(main).toContainText("hello axum! 12345");
|
||||
|
||||
// Expect the page to contain the server data
|
||||
await expect(main).toContainText('Server said: Ok("Hello from the server!")');
|
||||
|
||||
// Click the increment button.
|
||||
let button = page.locator("button.increment-button");
|
||||
await button.click();
|
||||
|
||||
// Expect the page to contain the updated counter text.
|
||||
await expect(main).toContainText("hello axum! 12346");
|
||||
});
|
||||
Reference in new issue
Block a user