Skip to content

Commit 40b7e5e

Browse files
committed
tests(web-host): update failing e2e tests
1 parent 946cd8b commit 40b7e5e

5 files changed

Lines changed: 10 additions & 2 deletions

File tree

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
"test:e2e:all:preview": "npm run test:e2e:all:preview --workspace=packages/web-host",
3535
"test:e2e:ui:preview": "npm run test:e2e:ui:preview --workspace=packages/web-host",
3636
"test:e2e:report": "npm run test:e2e:report --workspace=packages/web-host",
37+
"test:e2e:like-in-ci": "npm run test:e2e:like-in-ci --workspace=packages/web-host",
3738
"typecheck": "npm run typecheck --workspace=*",
3839
"web-host:typecheck": "npm run typecheck --workspace=packages/web-host",
3940
"web-host:build": "npm run build --workspace=packages/web-host",

packages/web-host/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
"test:e2e:all:preview": "BASE_URL=http://localhost:4173/webassembly-component-model-experiments npm run test:e2e:all",
2424
"test:e2e:ui:preview": "BASE_URL=http://localhost:4173/webassembly-component-model-experiments npm run test:e2e:ui",
2525
"test:e2e:report": "playwright show-report",
26+
"test:e2e:like-in-ci": "CI=true GITHUB_ACTIONS=true WAIT_FOR_SERVER_AT_URL=http://localhost:4173/webassembly-component-model-experiments/ npm run test:e2e:all:preview",
2627
"wasm:transpile:plugin-echo": "jco transpile --no-nodejs-compat --no-namespaced-exports public/plugins/plugin_echo.wasm -o ./src/wasm/generated/plugin_echo/transpiled",
2728
"wasm:transpile:plugin-weather": "jco transpile --no-nodejs-compat --no-namespaced-exports public/plugins/plugin_weather.wasm -o ./src/wasm/generated/plugin_weather/transpiled",
2829
"wasm:transpile:plugin-greet": "jco transpile --no-nodejs-compat --no-namespaced-exports public/plugins/plugin_greet.wasm -o ./src/wasm/generated/plugin_greet/transpiled",

packages/web-host/tests/repl-loading.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ test("repl logic should have loaded", async ({ page }) => {
1111
});
1212

1313
test("plugins should have loaded under their names", async ({ page }) => {
14-
const pluginNames = ["echo", "weather", "greet", "ls", "cat"];
14+
const pluginNames = ["echo", "weather", "greet", "ls", "cat", "echoc"];
1515
await page.goto("/#repl");
1616
for (const pluginName of pluginNames) {
1717
await expect(
18-
page.getByText(`[Host] Loaded plugin: ${pluginName}`),
18+
page.getByText(`[Host] Loaded plugin: ${pluginName}`, { exact: true }),
1919
).toBeVisible();
2020
}
2121
});

packages/web-host/tests/repl-logic.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ test("list-commands", async ({ page }) => {
7373
await expect(stdout).toContainText(
7474
`cat plugin
7575
echo plugin
76+
echoc plugin
7677
export reserved
7778
greet plugin
7879
help reserved

packages/web-host/tests/repl-plugins.spec.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ test("echo foo", async ({ page }) => {
66
await fillAndSubmitCommand(page, "echo foo", { expectStdout: "foo" });
77
});
88

9+
test("echoc foo", async ({ page }) => {
10+
await page.goto("/#repl");
11+
await fillAndSubmitCommand(page, "echoc foo", { expectStdout: "foo" });
12+
});
13+
914
test("greet World", async ({ page }) => {
1015
await page.goto("/#repl");
1116
await fillAndSubmitCommand(page, "greet World", {

0 commit comments

Comments
 (0)