mirror of https://github.com/boa-dev/boa.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
719 B
26 lines
719 B
2 years ago
|
import { expect, test } from "@playwright/test";
|
||
|
|
||
|
test.beforeEach(async ({ page }) => {
|
||
|
page.on("console", (msg) => {
|
||
|
let msgText = "";
|
||
|
for (let i = 0; i < msg.args().length; ++i) {
|
||
|
msgText += `${msg.args()[i]}`;
|
||
|
}
|
||
|
// eslint-disable-next-line no-console
|
||
|
console.log(msgText);
|
||
|
});
|
||
|
});
|
||
|
|
||
|
test("boa demo", async ({ page }) => {
|
||
|
await page.goto("/", {
|
||
|
// wait until all content is loaded
|
||
|
waitUntil: "networkidle",
|
||
|
});
|
||
|
// wait for the code evaluate
|
||
|
await page.waitForTimeout(2000);
|
||
|
const output = page.getByTestId("output");
|
||
|
const result = await output.innerHTML();
|
||
|
console.log("eval result: ", result);
|
||
|
await expect(result.match("Hello, World")?.length).toEqual(1);
|
||
|
});
|