mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-05-28 18:26:54 +00:00
test(e2e,playwright): ms-trophy-show improvements (#52447)
This commit is contained in:
@@ -10,10 +10,18 @@ test.beforeEach(async ({ page }) => {
|
||||
);
|
||||
});
|
||||
|
||||
test('the page should render with correct title', async ({ page }) => {
|
||||
test('the page should render with correct title and description', async ({
|
||||
page
|
||||
}) => {
|
||||
await expect(page).toHaveTitle(
|
||||
'Write Your First Code Using C# - Trophy - Write Your First Code Using C# | Learn | freeCodeCamp.org'
|
||||
);
|
||||
const title = page.getByTestId('challenge-title');
|
||||
await expect(title).toBeVisible();
|
||||
await expect(title).toContainText('Trophy - Write Your First Code Using C#');
|
||||
|
||||
const description = page.getByTestId('challenge-description');
|
||||
await expect(description).toBeVisible();
|
||||
});
|
||||
|
||||
test('Correct Verify Trophy button', async ({ page }) => {
|
||||
@@ -22,6 +30,7 @@ test('Correct Verify Trophy button', async ({ page }) => {
|
||||
});
|
||||
await expect(askHelpButton).toBeVisible();
|
||||
await expect(askHelpButton).toHaveText(verifyTrophyButtonText);
|
||||
await expect(askHelpButton).toBeDisabled();
|
||||
});
|
||||
|
||||
test('Correct Ask for help button', async ({ page }) => {
|
||||
@@ -30,4 +39,12 @@ test('Correct Ask for help button', async ({ page }) => {
|
||||
});
|
||||
await expect(checkAnswerButton).toBeVisible();
|
||||
await expect(checkAnswerButton).toContainText(askForHelpButtonText);
|
||||
|
||||
await checkAnswerButton.click();
|
||||
await expect(
|
||||
page.getByRole('heading', {
|
||||
name: translations.buttons['ask-for-help'],
|
||||
exact: true
|
||||
})
|
||||
).toBeVisible();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user