Skip to content

Commit

Permalink
[docs] Fix e2e tests (#33477)
Browse files Browse the repository at this point in the history
  • Loading branch information
siriwatknp authored Jul 12, 2022
1 parent 6e69c8e commit 594fe44
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 43 deletions.
2 changes: 1 addition & 1 deletion test/e2e-website/material-docs.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ test.describe('Material docs', () => {
test('should have correct link for API section', async ({ page }) => {
await page.goto(`/material-ui/react-card/`);

const anchors = page.locator('div > h2#heading-api ~ ul a');
const anchors = page.locator('div > h2#api ~ ul a');

const firstAnchor = anchors.first();
const textContent = await firstAnchor.textContent();
Expand Down
2 changes: 1 addition & 1 deletion test/e2e-website/material-icons.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { TestFixture } from './playwright.config';

const test = base.extend<TestFixture>({});

test.only('should see the selected icon popup that match the query', async ({ page }) => {
test('should see the selected icon popup that match the query', async ({ page }) => {
await page.goto('/material-ui/material-icons/?selected=AcUnit');

await expect(page.locator('.MuiDialog-container h2:has-text("AcUnit")')).toBeVisible();
Expand Down
10 changes: 4 additions & 6 deletions test/e2e-website/products-drawer.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,15 @@ test('able to navigate between products', async ({ page }) => {
await expect(page.locator('#mui-product-menu')).toBeVisible();

await expect(
page.locator('#mui-product-menu a[href="/material-ui/getting-started/installation/"]'),
page.locator('#mui-product-menu a[href^="/material-ui/getting-started/"]'),
).toBeVisible();

await expect(page.locator('#mui-product-menu a[href="/system/basics/"]')).toHaveAttribute(
await expect(page.locator('#mui-product-menu a[href^="/system/"]')).toHaveAttribute(
'href',
'/system/basics/',
);

await expect(page.locator('#mui-product-menu a[href="/x/introduction/"]')).toBeVisible();
await expect(page.locator('#mui-product-menu a[href^="/x/introduction/"]')).toBeVisible();

await expect(
page.locator('#mui-product-menu a[href="/base/getting-started/installation/"]'),
).toBeVisible();
await expect(page.locator('#mui-product-menu a[href^="/base/getting-started/"]')).toBeVisible();
});
35 changes: 0 additions & 35 deletions test/e2e-website/x-redirects.spec.ts

This file was deleted.

0 comments on commit 594fe44

Please sign in to comment.