Skip to content
Merged
Changes from all commits
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
39 changes: 19 additions & 20 deletions playwright/e2e/element-examples/si-select.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,25 @@ test.describe('si-select', () => {
test(example, async ({ page, si }) => {
await si.visitExample(example);

await page.getByRole('combobox', { name: 'FormControl' }).click();
await si.runVisualAndA11yTests('form-select');
await page.locator('.cdk-overlay-backdrop').click({ position: { x: 0, y: 0 }, force: true });

await page.getByRole('combobox', { name: 'Multi select' }).click();
await si.runVisualAndA11yTests('multi-select');
await page.locator('.cdk-overlay-backdrop').click({ position: { x: 0, y: 0 }, force: true });

await page.getByRole('combobox', { name: 'Multi-select with groups' }).click();
await si.runVisualAndA11yTests('multi-select-with-groups');
await page.locator('.cdk-overlay-backdrop').click({ position: { x: 0, y: 0 }, force: true });

await page.getByRole('combobox', { name: 'Select with custom template' }).click();
await si.runVisualAndA11yTests('custom-template');
await page.locator('.cdk-overlay-backdrop').click({ position: { x: 0, y: 0 }, force: true });

await page.getByRole('combobox', { name: 'Select with actions' }).click();
await si.runVisualAndA11yTests('actions');
await page.getByRole('button', { name: 'clear' }).click();
await page.locator('.cdk-overlay-backdrop').click({ position: { x: 0, y: 0 }, force: true });
const testCases = [
{ name: 'FormControl', testName: 'form-select' },
{ name: 'Multi select', testName: 'multi-select' },
{ name: 'Multi-select with groups', testName: 'multi-select-with-groups' },
{ name: 'Select with custom template', testName: 'custom-template' },
{ name: 'Select with actions', testName: 'actions' }
];

for (const { name, testName } of testCases) {
await page.getByRole('combobox', { name }).click();
await expect(page.getByRole('listbox', { name })).toBeVisible();
await si.runVisualAndA11yTests(testName);

if (name === 'Select with actions') {
await page.getByRole('button', { name: 'clear' }).click();
}

await page.locator('.cdk-overlay-backdrop').click({ position: { x: 0, y: 0 }, force: true });
}

await page.locator('h4').first().click();

Expand Down
Loading