Last active
January 13, 2023 15:40
-
-
Save nadvolod/5a8441e10237193a64161bcea37ef0c1 to your computer and use it in GitHub Desktop.
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
const page = await context.newPage(); | |
await page.goto('/'); | |
const loginPage = new LoginPage(page) | |
//option 1 | |
await loginPage.login(data) | |
//option 2 | |
await loginPage.userNameFill(userData.standart) | |
await loginPage.userPasswordFill(userData.correctPassword) | |
await loginPage.loginButtonClick() | |
await loginPage.burgerMenuClick() | |
await loginPage.aboutButtClick() | |
test('Should login using standart User Name and correct password', async ({ page }) => { | |
const loginPage = new LoginPage(page) | |
data.user = 'correct' | |
data.pass = 'correct' | |
await loginPage.login(data) | |
await loginPage.expectHeaderToHaveText('Products') | |
}); | |
test('Should login using standart User Name and correct password', async ({ page }) => { | |
const loginPage = new LoginPage(page) | |
data.user = 'incorrect' | |
data.pass = 'incorrect' | |
await loginPage.login(data) | |
await loginPage.expectHeaderToHaveText('Products') | |
}); | |
async login(userData){ | |
await loginPage.userNameFill(userData.standart) | |
await loginPage.userPasswordFill(userData.correctPassword) | |
await loginPage.loginButtonClick() | |
} | |
async loginWithJWT(userData){ | |
await otherStuff() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment