mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-09-24 23:01:18 +08:00
test: update completion modal tests (#53377)
This commit is contained in:
@@ -1,12 +1,12 @@
|
|||||||
import { test, expect } from '@playwright/test';
|
import { test, expect } from '@playwright/test';
|
||||||
import translations from '../client/i18n/locales/english/translations.json';
|
import translations from '../client/i18n/locales/english/translations.json';
|
||||||
|
|
||||||
const timeCalculatorUrl =
|
const nextChallengeURL =
|
||||||
'/learn/scientific-computing-with-python/scientific-computing-with-python-projects/time-calculator';
|
'/learn/data-analysis-with-python/data-analysis-with-python-projects/demographic-data-analyzer';
|
||||||
|
|
||||||
test.beforeEach(async ({ page }) => {
|
test.beforeEach(async ({ page }) => {
|
||||||
await page.goto(
|
await page.goto(
|
||||||
'/learn/scientific-computing-with-python/scientific-computing-with-python-projects/arithmetic-formatter'
|
'/learn/data-analysis-with-python/data-analysis-with-python-projects/mean-variance-standard-deviation-calculator'
|
||||||
);
|
);
|
||||||
await page.getByLabel('Solution Link').fill('https://example.com');
|
await page.getByLabel('Solution Link').fill('https://example.com');
|
||||||
await page
|
await page
|
||||||
@@ -44,7 +44,7 @@ test.describe('Challenge Completion Modal Tests (Signed Out)', () => {
|
|||||||
await page
|
await page
|
||||||
.getByRole('button', { name: translations.buttons['go-to-next'] })
|
.getByRole('button', { name: translations.buttons['go-to-next'] })
|
||||||
.click();
|
.click();
|
||||||
await expect(page).toHaveURL(timeCalculatorUrl);
|
await expect(page).toHaveURL(nextChallengeURL);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -73,6 +73,6 @@ test.describe('Challenge Completion Modal Tests (Signed In)', () => {
|
|||||||
await page
|
await page
|
||||||
.getByRole('button', { name: translations.buttons['submit-and-go'] })
|
.getByRole('button', { name: translations.buttons['submit-and-go'] })
|
||||||
.click();
|
.click();
|
||||||
await expect(page).toHaveURL(timeCalculatorUrl);
|
await expect(page).toHaveURL(nextChallengeURL);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user