Files
wehub-resource-sync dde272c4b8
i18n - Build Validation / Validate i18n Builds (24) (push) Has been cancelled
CI - Node.js / Lint (24) (push) Has been cancelled
CI - Node.js / Build (24) (push) Has been cancelled
CI - Node.js / Test (24) (push) Has been cancelled
CI - Node.js / Test - Upcoming Changes (24) (push) Has been cancelled
CI - Node.js / Test - i18n (italian, 24) (push) Has been cancelled
CI - Node.js / Test - i18n (portuguese, 24) (push) Has been cancelled
CD - Docker - GHCR Images / Build and Push Images (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 11:55:53 +08:00

39 lines
1.3 KiB
TypeScript

import { execSync } from 'child_process';
import { test, expect } from '@playwright/test';
const url =
'/learn/foundational-c-sharp-with-microsoft/foundational-c-sharp-with-microsoft-certification-exam/foundational-c-sharp-with-microsoft-certification-exam';
test.describe('Exam Survey', () => {
test.beforeAll(() => {
execSync('node ../tools/scripts/seed/seed-demo-user --certified-user');
execSync('node ../tools/scripts/seed/seed-surveys.js delete-only');
});
test('Should show the survey alert and be able to complete the survey', async ({
page
}) => {
await page.goto(url);
await expect(page.getByTestId('c-sharp-survey-alert')).toBeVisible();
await page.getByRole('button', { name: 'Take the survey' }).click();
await expect(page.getByRole('dialog')).toBeVisible();
await expect(
page.getByRole('heading', {
name: 'Foundational C# with Microsoft Survey'
})
).toBeVisible();
await page.getByText('Student developer').click();
await expect(
page.getByRole('button', { name: 'Submit the survey' })
).toBeDisabled();
await page.getByText('Novice (no prior experience)').click();
await page.getByRole('button', { name: 'Submit the survey' }).click();
await expect(page.getByTestId('flash-message')).toContainText(
/Thank you. Your survey was submitted./
);
});
});