|
1 |
| -import { test } from '@playwright/test'; |
| 1 | +import { test } from '@playwright/test' |
2 | 2 | import {AddPeerModal} from '../pages/modals/add-peer-modal'
|
3 | 3 | import {PeersPage} from '../pages/peers-page'
|
| 4 | +import {LoginPage} from '../pages/login-page' |
4 | 5 |
|
5 |
| -const URL = 'https://app.netbird.io/' |
6 |
| -const localUrl = 'http://localhost:3000/' |
7 |
| -let addPeerModal: AddPeerModal; |
8 |
| -let peersPage: PeersPage; |
| 6 | +let addPeerModal: AddPeerModal |
| 7 | +let peersPage: PeersPage |
| 8 | +let loginPage: LoginPage |
9 | 9 |
|
10 | 10 | test.beforeEach(async ({ page }) => {
|
11 | 11 | addPeerModal = new AddPeerModal(page);
|
12 |
| - await page.goto(localUrl); |
13 |
| - await page.getByPlaceholder('username@domain').fill('admin@localhost'); |
14 |
| - await page.getByRole('button', { name: 'next' }).click(); |
15 |
| - await page.getByLabel('Password').fill('testMe123@'); |
16 |
| - await page.getByRole('button', { name: 'next' }).click(); |
17 |
| - const skipButton = page.getByRole('button', { name: 'skip' }); |
18 |
| - if (await skipButton.isVisible({ timeout: 300 })) { |
19 |
| - await skipButton.click(); |
20 |
| - } |
| 12 | + loginPage = new LoginPage(page); |
| 13 | + await loginPage.doLogin(); |
21 | 14 | await addPeerModal.assertPeerModalIsVisible();
|
22 | 15 | });
|
23 | 16 |
|
24 |
| -test('Test Linux tab on a first access add peer modal / @bc', async function ({ }) { |
| 17 | +test('Test Linux tab on a first access add peer modal / @bc', async function () { |
25 | 18 | await addPeerModal.openLinuxTab();
|
26 | 19 | await addPeerModal.assertLinuxTabHasCorrectText();
|
27 | 20 | });
|
28 | 21 |
|
29 |
| -test('Test Windows tab on a first access add peer modal / @bc', async ({ }) => { |
| 22 | +test('Test Windows tab on a first access add peer modal / @bc', async () => { |
30 | 23 | await addPeerModal.openWindowsTab();
|
31 | 24 | await addPeerModal.assertWindowsDownloadButtonHasCorrectLink();
|
32 | 25 | });
|
33 | 26 |
|
34 |
| -test('Test MacOS tab on a first access add peer modal / @bc', async ({ }) => { |
| 27 | +test('Test MacOS tab on a first access add peer modal / @bc', async () => { |
35 | 28 | await addPeerModal.openMacTab();
|
36 | 29 | await addPeerModal.assertIntelDownloadButtonHasCorrectLink();
|
37 | 30 | await addPeerModal.assertM1M2DownloadButtonHasCorrectLink();
|
38 | 31 | });
|
39 | 32 |
|
40 |
| -test('Test Android tab on a first access add peer modal', async ({ }) => { |
| 33 | +test('Test Android tab on a first access add peer modal', async () => { |
41 | 34 | await addPeerModal.openAndroidTab();
|
42 | 35 | await addPeerModal.assertAndroidDownloadButtonHasCorrectLink();
|
43 | 36 | });
|
44 | 37 |
|
45 |
| - test('Test Docker tab on a first access add peer modal', async ({ }) => { |
| 38 | + test('Test Docker tab on a first access add peer modal', async () => { |
46 | 39 | await addPeerModal.openDockerTab();
|
47 | 40 | await addPeerModal.assertDockerDownloadButtonHasCorrectLink();
|
48 | 41 | });
|
|
0 commit comments