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
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Try
  • Loading branch information
mtojek committed Apr 11, 2024
commit 599d22dabf6fda230266cf986ab2e04d3fd88ff2
12 changes: 9 additions & 3 deletions site/e2e/tests/deployment/general.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,27 @@ test("experiments", async ({ page }) => {
const experimentsLocator = page.locator(
"div.options-table tr.option-experiments ul.option-array",
);
await experimentsLocator.scrollIntoViewIfNeeded();
await expect(experimentsLocator).toBeVisible();

await experimentsLocator.focus();
await page.mouse.wheel(0, 600);

// eslint-disable-next-line no-console -- HTML for experiments
console.log(experimentsLocator.innerHTML())

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

// 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).toBeInViewport();
await expect(experimentLocator).toBeVisible();
});
});