-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fb7dc63
commit fa6b6ff
Showing
3 changed files
with
56 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,18 @@ | ||
import { test, expect } from '@playwright/test'; | ||
import { LoginPage } from '../page_object/loginPage'; | ||
|
||
let loginPage: LoginPage | ||
|
||
test.beforeEach(async ({page}) => { | ||
loginPage = new LoginPage(page); | ||
}) | ||
|
||
test('Should check if the standard user can log in', async ({ page }) => { | ||
const loginPage = new LoginPage(page); | ||
await loginPage.login(process.env.STANDARD_USER, process.env.PASSWORD); | ||
await expect(page.locator('[data-test="title"]')).toContainText('Products'); | ||
}); | ||
|
||
test('Should check if the locked user can not log in', async ({ page }) => { | ||
const loginPage = new LoginPage(page); | ||
await loginPage.login(process.env.LOCKED_USER, process.env.PASSWORD); | ||
await expect(page.locator('[data-test="error"]')).toContainText('Epic sadface: Sorry, this user has been locked out.'); | ||
}); |