forked from freeCodeCamp/freeCodeCamp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexam-token.spec.ts
40 lines (33 loc) · 1.27 KB
/
exam-token.spec.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// TO ENABLE THESE TESTS GROWTHBOOK HAS TO BE SET IN THE ENVIRONMENT VARIABLES`
// UNCOMMENT WHEN NEW API IS READY.
// import { test, expect } from '@playwright/test';
// test.beforeEach(async ({ page }) => {
// await page.goto('/settings');
// });
// test.describe('Exam Token Widget', () => {
// test('should tell you to not share the token with anyone', async ({
// page
// }) => {
// await expect(
// page.getByText(
// 'Your exam token is a secret key that allows you to access the exam. Do not share this token with anyone'
// )
// ).toBeVisible();
// await expect(
// page.getByText(
// 'If you generate a new token, your old token will be invalidated.'
// )
// ).toBeVisible();
// await expect(
// page.getByRole('button', { name: 'Generate Exam Token' })
// ).toBeVisible();
// });
// test('should be able to generate a token', async ({ page }) => {
// await page.getByRole('button', { name: 'Generate Exam Token' }).click();
// await expect(page.getByText('Your Exam Token is:')).toBeVisible();
// await expect(page.getByRole('button', { name: 'Copy' })).toBeVisible();
// await expect(
// page.getByRole('button', { name: 'Close' }).nth(1)
// ).toBeVisible();
// });
// });