forked from freeCodeCamp/freeCodeCamp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsass.spec.ts
24 lines (20 loc) · 812 Bytes
/
sass.spec.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import { test, expect } from '@playwright/test';
test.describe('Sass Challenge', () => {
test.beforeEach(async ({ page }) => {
await page.goto(
'/learn/front-end-development-libraries/sass/use-for-to-create-a-sass-loop'
);
});
test('should render the sass preview', async ({ page, isMobile }) => {
if (isMobile) {
await page.getByRole('tab', { name: 'Preview' }).click();
}
const frame = page.frameLocator('.challenge-preview iframe');
expect(frame).not.toBeNull();
await expect(frame.locator('.text-1')).toBeVisible();
await expect(frame.locator('.text-2')).toBeVisible();
await expect(frame.locator('.text-3')).toBeVisible();
await expect(frame.locator('.text-4')).toBeVisible();
await expect(frame.locator('.text-5')).toBeVisible();
});
});