Rust编写的JavaScript引擎,该项目是一个试验性质的项目。
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.
 
 

25 lines
719 B

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);
});