mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-05-16 07:00:53 -04:00
feat (e2e, playwright) : e2e tests for Editor component (#51915)
This commit is contained in:
20
e2e/editor.spec.ts
Normal file
20
e2e/editor.spec.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import { test, expect } from '@playwright/test';
|
||||
|
||||
test.beforeEach(async ({ page }) => {
|
||||
await page.goto(
|
||||
'/learn/2022/responsive-web-design/learn-html-by-building-a-cat-photo-app/step-2'
|
||||
);
|
||||
});
|
||||
test.afterEach(async ({ page }) => {
|
||||
await page.close();
|
||||
});
|
||||
|
||||
test.describe('Editor Component', () => {
|
||||
test('Should be clicked and able to insert text', async ({ page }) => {
|
||||
const monacoEditor = page.getByLabel('Editor content');
|
||||
await monacoEditor.click();
|
||||
await page.keyboard.insertText('<h2>FreeCodeCamp</h2>');
|
||||
const text = page.getByText('<h2>FreeCodeCamp</h2>');
|
||||
await expect(text).toBeVisible();
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user