Skip to content

Commit

Permalink
chore: Update sign-up tests to use a unique email address
Browse files Browse the repository at this point in the history
  • Loading branch information
noriega2112 committed Aug 27, 2024
1 parent f60f78c commit a94bc25
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,20 @@ import { test, expect } from '@playwright/test'

const PASSWORD = 'PASSWORD'

function generateUniqueEmail() {
const timestamp = Date.now().toString();
return `playwright-${timestamp}@thinknimble.com`;
}

test('Login workflow', async ({ page }) => {
const uniqueEmail = generateUniqueEmail()

await page.goto('/sign-up')
await page.getByTestId('first-name').fill('playwright')
await page.getByTestId('last-name').fill('e2e test')
await page
.getByTestId('email')
.fill(`playwright${Math.floor(Math.random() * 1000)}@thinknimble.com`)
.fill(uniqueEmail)
await page.getByTestId('password').fill(PASSWORD)
await page.getByTestId('confirm-password').fill(PASSWORD)
await page.getByTestId('submit').click()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,20 @@ import { test, expect } from '@playwright/test'

const PASSWORD = 'PASSWORD'

function generateUniqueEmail() {
const timestamp = Date.now().toString();
return `playwright-${timestamp}@thinknimble.com`;
}

test('Sign up workflow', async ({ page }) => {
const uniqueEmail = generateUniqueEmail()

await page.goto('/signup')
await page.getByPlaceholder('Enter first name...').fill('playwright')
await page.getByPlaceholder('Enter last name...').fill('e2e test')
await page
.getByPlaceholder('Enter email...')
.fill(`playwright${Math.floor(Math.random() * 1000)}@thinknimble.com`)
.fill(uniqueEmail)
await page.getByPlaceholder('Enter password...').fill(PASSWORD)
await page.getByPlaceholder('Confirm Password').fill(PASSWORD)
await page.getByRole('button', { name: 'Sign up' }).click()
Expand Down

0 comments on commit a94bc25

Please sign in to comment.