|
1 | | -import {testWithII} from '@dfinity/internet-identity-playwright'; |
2 | | -import {initTestSuiteWithInternetIdentity, initTestSuiteWithPasskey} from './utils/init.utils'; |
| 1 | +import {test} from '@playwright/test'; |
| 2 | +import {initTestSuiteWithInternetIdentity} from './utils/init.utils'; |
3 | 3 |
|
4 | | -testWithII.describe.configure({mode: 'serial'}); |
| 4 | +test.describe.configure({mode: 'serial'}); |
5 | 5 |
|
6 | | -[ |
7 | | - {title: 'With Passkey', initExamplePage: initTestSuiteWithPasskey}, |
8 | | - {title: 'With II', initExamplePage: initTestSuiteWithInternetIdentity} |
9 | | -].forEach(({title, initExamplePage}) => { |
10 | | - testWithII.describe(title, () => { |
11 | | - const getExamplePage = initExamplePage(); |
| 6 | +[{title: 'With Dev', initExamplePage: initTestSuiteWithInternetIdentity}].forEach( |
| 7 | + ({title, initExamplePage}) => { |
| 8 | + test.describe(title, () => { |
| 9 | + const getExamplePage = initExamplePage(); |
12 | 10 |
|
13 | | - testWithII('should sign-in', async () => { |
14 | | - const examplePage = getExamplePage(); |
| 11 | + test('should sign-in', async () => { |
| 12 | + const examplePage = getExamplePage(); |
15 | 13 |
|
16 | | - await examplePage.assertSignedIn(); |
17 | | - }); |
| 14 | + await examplePage.assertSignedIn(); |
| 15 | + }); |
18 | 16 |
|
19 | | - testWithII('should add an entry', async () => { |
20 | | - const examplePage = getExamplePage(); |
| 17 | + test('should add an entry', async () => { |
| 18 | + const examplePage = getExamplePage(); |
21 | 19 |
|
22 | | - await examplePage.addEntry('My notes.'); |
23 | | - }); |
| 20 | + await examplePage.addEntry('My notes.'); |
| 21 | + }); |
24 | 22 |
|
25 | | - testWithII('should add an entry with file', async () => { |
26 | | - const examplePage = getExamplePage(); |
| 23 | + test('should add an entry with file', async () => { |
| 24 | + const examplePage = getExamplePage(); |
27 | 25 |
|
28 | | - await examplePage.addEntryWithFile({ |
29 | | - text: 'My file.', |
30 | | - filePath: 'e2e/data/dog.jpg' |
31 | | - }); |
| 26 | + await examplePage.addEntryWithFile({ |
| 27 | + text: 'My file.', |
| 28 | + filePath: 'e2e/data/dog.jpg' |
| 29 | + }); |
32 | 30 |
|
33 | | - await examplePage.assertUploadedImage(); |
34 | | - }); |
| 31 | + await examplePage.assertUploadedImage(); |
| 32 | + }); |
35 | 33 |
|
36 | | - const lastEntryText = 'My last note.'; |
| 34 | + const lastEntryText = 'My last note.'; |
37 | 35 |
|
38 | | - testWithII('should add another entry', async () => { |
39 | | - const examplePage = getExamplePage(); |
| 36 | + test('should add another entry', async () => { |
| 37 | + const examplePage = getExamplePage(); |
40 | 38 |
|
41 | | - await examplePage.addEntry(lastEntryText); |
42 | | - }); |
| 39 | + await examplePage.addEntry(lastEntryText); |
| 40 | + }); |
43 | 41 |
|
44 | | - testWithII('should delete entry', async () => { |
45 | | - const examplePage = getExamplePage(); |
| 42 | + test('should delete entry', async () => { |
| 43 | + const examplePage = getExamplePage(); |
46 | 44 |
|
47 | | - await examplePage.deleteLastEntry(); |
| 45 | + await examplePage.deleteLastEntry(); |
48 | 46 |
|
49 | | - await examplePage.assertEntries(2); |
50 | | - }); |
| 47 | + await examplePage.assertEntries(2); |
| 48 | + }); |
51 | 49 |
|
52 | | - testWithII('should sign-out', async () => { |
53 | | - const examplePage = getExamplePage(); |
| 50 | + test('should sign-out', async () => { |
| 51 | + const examplePage = getExamplePage(); |
54 | 52 |
|
55 | | - await examplePage.signOut(); |
| 53 | + await examplePage.signOut(); |
56 | 54 |
|
57 | | - await examplePage.assertSignedOut(); |
58 | | - }); |
| 55 | + await examplePage.assertSignedOut(); |
| 56 | + }); |
59 | 57 |
|
60 | | - // TODO: testWithII does not seem to support setting dark or light mode so for now we just use screenshot of default mode |
| 58 | + // TODO: test does not seem to support setting dark or light mode so for now we just use screenshot of default mode |
61 | 59 |
|
62 | | - testWithII('match login screenshot', async () => { |
63 | | - const examplePage = getExamplePage(); |
| 60 | + test('match login screenshot', async () => { |
| 61 | + const examplePage = getExamplePage(); |
64 | 62 |
|
65 | | - await examplePage.assertSignedOut(); |
| 63 | + await examplePage.assertSignedOut(); |
66 | 64 |
|
67 | | - await examplePage.assertScreenshot({mode: 'current', name: 'login'}); |
68 | | - }); |
| 65 | + await examplePage.assertScreenshot({mode: 'current', name: 'login'}); |
| 66 | + }); |
69 | 67 |
|
70 | | - testWithII('match logged in screenshot', async () => { |
71 | | - const examplePage = getExamplePage(); |
| 68 | + test('match logged in screenshot', async () => { |
| 69 | + const examplePage = getExamplePage(); |
72 | 70 |
|
73 | | - await examplePage.signIn(); |
| 71 | + await examplePage.signIn(); |
74 | 72 |
|
75 | | - await examplePage.assertSignedIn(); |
| 73 | + await examplePage.assertSignedIn(); |
76 | 74 |
|
77 | | - await examplePage.assertScreenshot({mode: 'current', name: 'logged-in'}); |
78 | | - }); |
| 75 | + await examplePage.assertScreenshot({mode: 'current', name: 'logged-in'}); |
| 76 | + }); |
79 | 77 |
|
80 | | - testWithII('match modal screenshot', async () => { |
81 | | - const examplePage = getExamplePage(); |
| 78 | + test('match modal screenshot', async () => { |
| 79 | + const examplePage = getExamplePage(); |
82 | 80 |
|
83 | | - await examplePage.openAddEntry(); |
| 81 | + await examplePage.openAddEntry(); |
84 | 82 |
|
85 | | - await examplePage.assertScreenshot({mode: 'current', name: 'modal'}); |
| 83 | + await examplePage.assertScreenshot({mode: 'current', name: 'modal'}); |
86 | 84 |
|
87 | | - await examplePage.closeAddEntryModal(); |
88 | | - }); |
| 85 | + await examplePage.closeAddEntryModal(); |
| 86 | + }); |
89 | 87 |
|
90 | | - testWithII('match logout screenshot', async () => { |
91 | | - const examplePage = getExamplePage(); |
| 88 | + test('match logout screenshot', async () => { |
| 89 | + const examplePage = getExamplePage(); |
92 | 90 |
|
93 | | - await examplePage.signOut(); |
| 91 | + await examplePage.signOut(); |
94 | 92 |
|
95 | | - await examplePage.assertSignedOut(); |
| 93 | + await examplePage.assertSignedOut(); |
96 | 94 |
|
97 | | - await examplePage.assertScreenshot({mode: 'current', name: 'logout'}); |
| 95 | + await examplePage.assertScreenshot({mode: 'current', name: 'logout'}); |
| 96 | + }); |
98 | 97 | }); |
99 | | - }); |
100 | | -}); |
| 98 | + } |
| 99 | +); |
0 commit comments