Skip to content

Commit 7a032f1

Browse files
committed
WIP
1 parent 48bf58d commit 7a032f1

File tree

2 files changed

+10
-15
lines changed

2 files changed

+10
-15
lines changed

site/e2e/playwright.config.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export default defineConfig({
3636
use: {
3737
baseURL: `http://localhost:${coderPort}`,
3838
video: "retain-on-failure",
39-
viewport: { width: 2048, height: 1600 },
39+
viewport: { width: 2560, height: 1440 },
4040
...(wsEndpoint
4141
? {
4242
connectOptions: {
+9-14
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import { expect, test } from "@playwright/test";
22
import * as API from "api/api";
33
import { setupApiCalls } from "../../api";
4+
import { e2eFakeExperiment1, e2eFakeExperiment2 } from "../../constants";
45

56
test("experiments", async ({ page }) => {
67
await setupApiCalls(page);
78

89
// Load experiments from backend API
910
const availableExperiments = await API.getAvailableExperiments();
10-
const enabledExperiments = await API.getExperiments();
1111

1212
// Verify if the site lists the same experiments
1313
await page.goto("/deployment/general", { waitUntil: "networkidle" });
@@ -17,22 +17,17 @@ test("experiments", async ({ page }) => {
1717
);
1818
await expect(experimentsLocator).toBeVisible();
1919

20-
// eslint-disable-next-line no-console -- HTML for experiments
21-
console.log(experimentsLocator.innerHTML());
20+
// Firstly, check if all enabled experiments are listed
21+
expect(experimentsLocator.locator("li", { hasText: e2eFakeExperiment1 }))
22+
.toBeVisible;
23+
expect(experimentsLocator.locator("li", { hasText: e2eFakeExperiment2 }))
24+
.toBeVisible;
2225

23-
// Firstly, check if available experiments are listed
24-
availableExperiments.safe.map(async (experiment) => {
25-
const experimentLocator = experimentsLocator.locator(
26-
`li.option-array-item-${experiment}`,
27-
);
28-
await expect(experimentLocator).toBeVisible();
29-
});
30-
31-
// Secondly, check if all enabled experiments are listed
32-
enabledExperiments.map(async (experiment) => {
26+
// Secondly, check if available experiments are listed
27+
for (const experiment of availableExperiments.safe) {
3328
const experimentLocator = experimentsLocator.locator(
3429
`li.option-array-item-${experiment}.option-enabled`,
3530
);
3631
await expect(experimentLocator).toBeVisible();
37-
});
32+
}
3833
});

0 commit comments

Comments
 (0)