|
1 |
| -import { test } from "../core"; |
2 |
| -import { expect } from "@playwright/test"; |
3 |
| -import { LoginPage } from "../pages"; |
| 1 | +import { test } from '../core'; |
| 2 | +import { expect } from '@playwright/test'; |
| 3 | +import { LoginPage } from '../pages'; |
4 | 4 |
|
5 |
| -test("Should login as Admin", async ({ page }) => { |
| 5 | +test('Should login as Admin', async ({ page }) => { |
6 | 6 | const loginPage = new LoginPage(page);
|
7 | 7 |
|
8 |
| - await test.step("When I goto the login page", async () => { |
| 8 | + await test.step('When I goto the login page', async () => { |
9 | 9 | await loginPage.goto();
|
10 | 10 | });
|
11 | 11 |
|
12 |
| - await test.step("And I enter the username", async () => { |
13 |
| - await page |
14 |
| - .locator("#username") |
15 |
| - .fill(`${process.env.E2E_USER_ADMIN_USERNAME}`); |
16 |
| - await page.getByText("Continue").click(); |
| 12 | + await test.step('And I enter the username', async () => { |
| 13 | + await page.locator('#username').fill(`${process.env.E2E_USER_ADMIN_USERNAME}`); |
| 14 | + await page.getByText('Continue').click(); |
17 | 15 | });
|
18 | 16 |
|
19 |
| - await test.step("And I enter the password", async () => { |
20 |
| - await page |
21 |
| - .locator("#password") |
22 |
| - .fill(`${process.env.E2E_USER_ADMIN_PASSWORD}`); |
| 17 | + await test.step('And I enter the password', async () => { |
| 18 | + await page.locator('#password').fill(`${process.env.E2E_USER_ADMIN_PASSWORD}`); |
23 | 19 | });
|
24 | 20 |
|
25 |
| - await test.step("And I click login buttion", async () => { |
26 |
| - await page.getByText("Log in").click(); |
| 21 | + await test.step('And I click login buttion', async () => { |
| 22 | + await page.getByText('Log in').click(); |
27 | 23 | });
|
28 | 24 |
|
29 |
| - await test.step("And I choose the location", async () => { |
30 |
| - await page.getByText("Outpatient clinic").click(); |
31 |
| - await page.getByText("Confirm").click(); |
| 25 | + await test.step('And I choose the location', async () => { |
| 26 | + await page.getByText('Outpatient clinic').click(); |
| 27 | + await page.getByText('Confirm').click(); |
32 | 28 | });
|
33 | 29 |
|
34 |
| - await test.step("Then I should be logged in", async () => { |
| 30 | + await test.step('Then I should be logged in', async () => { |
35 | 31 | await expect(page).toHaveURL(`${process.env.E2E_BASE_URL}/spa/home`);
|
36 | 32 | });
|
37 | 33 |
|
38 |
| - await test.step("Then I logged out", async () => { |
39 |
| - await page.getByRole("button", { name: "Users" }).click(); |
40 |
| - await page.getByText("Logout").click(); |
| 34 | + await test.step('Then I logged out', async () => { |
| 35 | + await page.getByRole('button', { name: 'Users' }).click(); |
| 36 | + await page.getByText('Logout').click(); |
41 | 37 | });
|
42 | 38 | });
|
0 commit comments