-
-
Notifications
You must be signed in to change notification settings - Fork 43.6k
Expand file tree
/
Copy pathcode-storage.spec.ts
More file actions
29 lines (22 loc) · 797 Bytes
/
code-storage.spec.ts
File metadata and controls
29 lines (22 loc) · 797 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import { test, expect } from '@playwright/test';
import { getEditors } from './utils/editor';
test.describe('Challenge with editor', function () {
test.skip(({ isMobile }) => isMobile);
test('the shortcut "Ctrl + S" saves the code', async ({ page }) => {
await page.goto(
'/learn/2022/responsive-web-design/learn-html-by-building-a-cat-photo-app/step-2'
);
const editor = getEditors(page);
await editor.fill('Something funny');
await page.keyboard.down('Control');
await page.keyboard.press('S');
await expect(
page.getByText(
"Saved! Your code was saved to your browser's local storage."
)
).toBeVisible();
await page.reload();
// check editor content
await expect(editor).toHaveValue(/Something funny/);
});
});