Skip to content

test(site): add e2e tests for experiments #12940

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 20 commits into from
Apr 12, 2024
Prev Previous commit
Next Next commit
network
  • Loading branch information
mtojek committed Apr 11, 2024
commit cdd9f30eb49ad5346218243d88af57e51f7db8fb
9 changes: 4 additions & 5 deletions site/e2e/tests/deployment/general.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,26 @@ test("experiments", async ({ page }) => {
const enabledExperiments = await API.getExperiments();

// Verify if the site lists the same experiments
await page.goto("/deployment/general", { waitUntil: "domcontentloaded" });
await page.goto("/deployment/general", { waitUntil: "networkidle" });

const experimentsLocator = page.locator(
"div.options-table tr.option-experiments ul.option-array",
);
await expect(experimentsLocator).toBeVisible();
await experimentsLocator.scrollIntoViewIfNeeded()
await experimentsLocator.scrollIntoViewIfNeeded();

// Firstly, check if available experiments are listed
availableExperiments.safe.map(async (experiment) => {
const experimentLocator = experimentsLocator.locator(
`li.option-array-item-${experiment}`,
);
await expect(experimentLocator).toBeVisible();
await expect(experimentLocator).toBeInViewport();
});

// Secondly, check if all enabled experiments are listed
enabledExperiments.map(async (experiment) => {
const experimentLocator = experimentsLocator.locator(
`li.option-array-item-${experiment}.option-enabled`,
);
await expect(experimentLocator).toBeVisible();
await expect(experimentLocator).toBeInViewport();
});
});
Loading