Skip to content

Commit

Permalink
signed-in state tests update
Browse files Browse the repository at this point in the history
  • Loading branch information
dilpreetj committed Aug 1, 2022
1 parent ce7d057 commit 629ad87
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 17 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ node_modules/
/test-results/
/playwright-report/
/playwright/.cache/
loggedInState.json
22 changes: 5 additions & 17 deletions tests/account.spec.ts
Original file line number Diff line number Diff line change
@@ -1,26 +1,14 @@
import { test, expect, Page } from '@playwright/test';
import { test, expect } from '@playwright/test';

test.describe.serial('My Account', () => {
let page: Page

test.beforeAll(async ({browser}) => {
page = await browser.newPage()
test.describe('My Account', () => {
test('Access Orders', async ({ page }) => {
await page.goto('/my-account')
await page.locator('#username').fill('practiceuser1')
await page.locator('#password').fill('PracticePass1!')
await page.locator('[value="Log in"]').click()
await expect(page.locator('a:has-text("Logout")'))
.toBeVisible()
})

test('Access Orders', async () => {
// await page.goto('/my-account')
await page.locator(`li a[href*='orders']`).click()
await expect(page).toHaveURL(/.*orders/)
});

test('Access Downloads', async () => {
// await page.goto('/my-account')
test('Access Downloads', async ({ page }) => {
await page.goto('/my-account')
await page.locator(`li a[href*='downloads']`).click()
await expect(page).toHaveURL(/.*downloads/)
});
Expand Down

0 comments on commit 629ad87

Please sign in to comment.