Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: convert progressbar test to Playwright #54636

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
85 changes: 0 additions & 85 deletions cypress/e2e/default/learn/challenges/progress-bar.ts

This file was deleted.

29 changes: 29 additions & 0 deletions e2e/progress-bar.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { expect, test } from '@playwright/test';
test.use({ storageState: 'playwright/.auth/certified-user.json' });

test.describe('Progress bar component', () => {
test('Should appear with the correct content after the user has submitted their code', async ({
Expand Down Expand Up @@ -33,4 +34,32 @@ test.describe('Progress bar component', () => {
.getByRole('button', { name: 'Submit and go to next challenge' })
.click();
});

test('Declare JavaScript Variables Test', async ({ page }) => {
Sembauke marked this conversation as resolved.
Show resolved Hide resolved
await page.goto(
'/learn/javascript-algorithms-and-data-structures/basic-javascript/declare-javascript-variables'
);

const monacoEditor = page.getByLabel('Editor content');
await monacoEditor.focus();

await page.keyboard.press('Control+A');

await page.keyboard.press('Meta+A');
await page.keyboard.press('Backspace');

await page.keyboard.insertText('var myName;');

await page
.getByRole('button', { name: 'Run the Tests (Ctrl + Enter)' })
.click();

await expect(page.locator('.completion-block-meta')).toContainText(
'99% complete'
);

await page
.getByRole('button', { name: 'Submit and go to next challenge' })
.click();
});
});