-
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
Showing
6 changed files
with
106 additions
and
17 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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,18 +1,38 @@ | ||
import { test, expect } from '@playwright/test'; | ||
import { RegisterPage } from '../pages/register-page'; | ||
import { HomePage } from '../pages/home-page'; | ||
import { LoginPage } from '../pages/login-page'; | ||
|
||
test('has title', async ({ page }) => { | ||
await page.goto('https://playwright.dev/'); | ||
import { faker } from '@faker-js/faker'; | ||
|
||
// Expect a title "to contain" a substring. | ||
await expect(page).toHaveTitle(/Playwright/); | ||
}); | ||
test.describe('Create new user account', () => { | ||
|
||
let registerPage: RegisterPage; | ||
let homePage: HomePage; | ||
let loginPage: LoginPage; | ||
|
||
test.beforeEach(async ({page}) => { | ||
registerPage = new RegisterPage(page); | ||
homePage = new HomePage(page); | ||
loginPage = new LoginPage(page); | ||
}); | ||
|
||
test('get started link', async ({ page }) => { | ||
await page.goto('https://playwright.dev/'); | ||
test('should be able to create a account', async () => { | ||
|
||
// Click the get started link. | ||
await page.getByRole('link', { name: 'Get started' }).click(); | ||
const password = faker.internet.password(); | ||
await homePage.navigateToHomePage('https://ecommerce-playground.lambdatest.io/'); //navigate to home page | ||
await homePage.clickOnLoginButton(); | ||
await loginPage.clickOnContinueButton(); | ||
await registerPage.enterFirstName(faker.person.firstName()); | ||
await registerPage.enterLastName(faker.person.lastName()); | ||
await registerPage.enterEmail(faker.internet.email()); | ||
await registerPage.enterTelephone(faker.phone.number()); | ||
await registerPage.enterPassword(password); | ||
await registerPage.enterConfirmPassword(password); | ||
await registerPage.clickOnSubscribeRadioButton(); | ||
await registerPage.clickOnPrivacyPolicyCheckbox(); | ||
await registerPage.clickOnContinueButton(); | ||
|
||
// Expects page to have a heading with the name of Installation. | ||
await expect(page.getByRole('heading', { name: 'Installation' })).toBeVisible(); | ||
// get the url of the current page | ||
}); | ||
}); |