-
Notifications
You must be signed in to change notification settings - Fork 39
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
12 changed files
with
238 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { test, expect } from '@playwright/test'; | ||
test.setTimeout(60000); | ||
|
||
test('change password with mismatched new password and confirmation shows error message', async ({ page }) => { | ||
await page.goto('https://packrat.world/'); | ||
await page.getByRole('link', { name: 'Get Started' }).click(); | ||
await page.getByLabel('Email').click(); | ||
await page.getByLabel('Email').fill('[email protected]'); | ||
await page.getByLabel('Password').click(); | ||
await page.getByLabel('Password').fill('12345678'); | ||
await page.getByRole('button', { name: 'Sign In' }).click(); | ||
await page.getByRole('button', { name: 'Menu' }).hover(); | ||
await page.getByRole('button', { name: ' Profile' }).click(); | ||
await page.goto('https://packrat.world/profile'); | ||
await page.getByRole('button', { name: '' }).click(); | ||
await page.getByLabel('Old password').click(); | ||
await page.getByLabel('Old password').fill('12345678)') | ||
await page.getByLabel('New password', { exact: true }).click(); | ||
await page.getByLabel('New password', { exact: true }).fill('87654321'); | ||
await page.getByLabel('Confirm new password').click(); | ||
await page.getByLabel('Confirm new password').fill('98765432'); | ||
await page.getByRole('button', { name: 'Change password' }).click(); | ||
|
||
// Verify the error message for invalid email format | ||
const passwordErrorMessage = page.locator('text=New password and confirmation must match'); | ||
await expect(passwordErrorMessage).toBeVisible({ timeout: 50000 }); // Adjust the timeout as needed | ||
}); |
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { test, expect } from '@playwright/test'; | ||
test.setTimeout(60000); | ||
|
||
test('delete account error', async ({ page }) => { | ||
await page.goto('https://packrat.world/'); | ||
await page.getByRole('link', { name: 'Get Started' }).click(); | ||
await page.getByLabel('Email').click(); | ||
await page.getByLabel('Email').fill('[email protected]'); | ||
await page.getByLabel('Password').click(); | ||
await page.getByLabel('Password').fill('12345678'); | ||
await page.getByRole('button', { name: 'Sign In' }).click(); | ||
await page.getByRole('button', { name: 'Menu' }).hover(); | ||
await page.getByRole('button', { name: ' Profile' }).click(); | ||
await page.goto('https://packrat.world/profile'); | ||
await page.getByRole('button', { name: '' }).click(); | ||
await page.getByRole('button', { name: 'Delete account' }).click(); | ||
|
||
|
||
// Verify the error message for invalid email format | ||
const emailErrorMessage = page.locator('text= Invalid literal value, expected "delete"'); | ||
await expect(emailErrorMessage).toBeVisible({ timeout: 50000 }); // Adjust the timeout as needed | ||
}); |
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { test, expect } from '@playwright/test'; | ||
|
||
test('invalid login with empty email shows error message', async ({ page }) => { | ||
await page.goto('https://packrat.pages.dev/'); | ||
await page.getByRole('link', { name: 'Get Started' }).click(); | ||
|
||
await page.locator('input[type="email"]').click(); | ||
await page.locator('input[type="email"]').fill(""); | ||
await page.locator('input[type="password"]').click(); | ||
await page.locator('input[type="password"]').fill('12345678'); | ||
await page.getByRole('button', { name: 'Sign In' }).click(); | ||
|
||
// Verify the error message for invalid email format | ||
const emailErrorMessage = page.locator('text=Email is required'); | ||
await expect(emailErrorMessage).toBeVisible({ timeout: 50000 }); // Adjust the timeout as needed | ||
}); |
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { test, expect } from '@playwright/test'; | ||
|
||
test('invalid login with empty fields shows error message', async ({ page }) => { | ||
await page.goto('https://packrat.world/'); | ||
await page.getByRole('link', { name: 'Get Started' }).click(); | ||
|
||
await page.getByRole('button', { name: 'Sign In' }).click(); | ||
|
||
|
||
// Verify the error message for invalid email format | ||
const emailErrorMessage = page.locator('text=Email is required'); | ||
await expect(emailErrorMessage).toBeVisible({ timeout: 50000 }); // Adjust the timeout as needed | ||
|
||
// Verify the error message for invalid email format | ||
const passwordErrorMessage = page.locator('text=Password is required'); | ||
await expect(passwordErrorMessage).toBeVisible({ timeout: 50000 }); // Adjust the timeout as needed | ||
}); |
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { test, expect } from '@playwright/test'; | ||
|
||
test('invalid login with incorrect password shows error message', async ({ page }) => { | ||
await page.goto('https://packrat.world//'); | ||
await page.getByRole('link', { name: 'Get Started' }).click(); | ||
|
||
await page.locator('input[type="email"]').click(); | ||
await page.locator('input[type="email"]').fill('[email protected]'); | ||
await page.locator('input[type="password"]').click(); | ||
await page.locator('input[type="password"]').fill('1234567'); | ||
await page.getByRole('button', { name: 'Sign In' }).click(); | ||
|
||
// Verify the error message for invalid email format | ||
const passwordErrorMessage = page.locator('text=User not found'); | ||
await expect(passwordErrorMessage).toBeVisible({ timeout: 50000 }); // Adjust the timeout as needed | ||
}); |
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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { test, expect } from '@playwright/test'; | ||
|
||
test('Add Item without item name shows required error', async ({ page }) => { | ||
test.setTimeout(60000); | ||
await page.goto('https://packrat.world/'); | ||
await page.getByRole('link', { name: 'Get Started' }).click(); | ||
await page.getByLabel('Email').click(); | ||
await page.getByLabel('Email').fill('[email protected]'); | ||
await page.getByLabel('Password').click(); | ||
await page.getByLabel('Password').fill('12345678'); | ||
await page.getByRole('button', { name: 'Sign In' }).click(); | ||
await page.getByRole('button', { name: 'Menu' }).hover(); | ||
await page.getByRole('button', { name: 'Packs' }).click(); | ||
await page.goto('https://packrat.world/packs'); | ||
await page.getByRole('link', { name: 'Quantity field' }).click(); | ||
await page.getByRole('button', { name: 'Add Item' }).click(); | ||
await page.getByPlaceholder('Item Name').fill(''); | ||
await page.getByPlaceholder('Weight').click(); | ||
await page.getByPlaceholder('Weight').fill('0.5'); | ||
await page.getByPlaceholder('Quantity').click(); | ||
await page.getByPlaceholder('Quantity').fill('1'); | ||
await page.getByLabel('Essentials').click(); | ||
await page.getByRole('button', { name: 'Add Item' }).click(); | ||
|
||
// Verify the error message for the empty item name | ||
const itemNameErrorMessage = page.locator('text=Required'); | ||
await expect(itemNameErrorMessage).toBeVisible({ timeout: 10000 }); // Adjust the timeout as needed | ||
}); | ||
|
||
|
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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { test, expect } from '@playwright/test'; | ||
|
||
test('Add Pack without name shows error message', async ({ page }) => { | ||
await page.goto('https://packrat.world/'); | ||
await page.getByRole('link', { name: 'Get Started' }).click(); | ||
await page.getByLabel('Email').click(); | ||
await page.getByLabel('Email').fill('[email protected]'); | ||
await page.getByLabel('Password').click(); | ||
await page.getByLabel('Password').fill('12345678'); | ||
await page.getByRole('button', { name: 'Sign In' }).click(); | ||
await page.getByText('Create a Pack').click(); | ||
await page.getByPlaceholder('Name').click(); | ||
await page.getByPlaceholder('Name').fill(''); | ||
await page.getByRole('switch').click(); | ||
await page.getByRole('button', { name: 'Add Pack' }).click(); | ||
|
||
|
||
// Verify the error message for the empty name field | ||
const nameErrorMessage = page.locator('text=String must contain at least 1 character(s)'); | ||
await expect(nameErrorMessage).toBeVisible({ timeout: 10000 }); // Adjust the timeout as needed | ||
}); | ||
|
||
|
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { test, expect } from '@playwright/test'; | ||
|
||
test('invalid login with empty password format shows error message', async ({ page }) => { | ||
await page.goto('https://packrat.world/'); | ||
await page.getByRole('link', { name: 'Get Started' }).click(); | ||
|
||
await page.locator('input[type="email"]').click(); | ||
await page.locator('input[type="email"]').fill("[email protected]"); | ||
await page.getByRole('button', { name: 'Sign In' }).click(); | ||
|
||
// Verify the error message for invalid email format | ||
const passwordErrorMessage = page.locator('text=Password is required'); | ||
await expect(passwordErrorMessage).toBeVisible({ timeout: 50000 }); // Adjust the timeout as needed | ||
}); |
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { test, expect } from '@playwright/test'; | ||
|
||
test('invalid login with incorrect email shows error message', async ({ page }) => { | ||
await page.goto('https://packrat.pages.dev/'); | ||
await page.getByRole('link', { name: 'Get Started' }).click(); | ||
|
||
await page.locator('input[type="email"]').click(); | ||
await page.locator('input[type="email"]').fill('[email protected]'); | ||
await page.locator('input[type="password"]').click(); | ||
await page.locator('input[type="password"]').fill('12345678'); | ||
await page.getByRole('button', { name: 'Sign In' }).click(); | ||
|
||
// Verify the error message for invalid email format | ||
const emailErrorMessage = page.locator('text=User not found'); | ||
await expect(emailErrorMessage).toBeVisible({ timeout: 50000 }); // Adjust the timeout as needed | ||
}); |
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { test, expect } from '@playwright/test'; | ||
|
||
test('Register new account name field empty', async ({ page }) => { | ||
await page.goto('https://packrat.world/'); | ||
await page.getByRole('link', { name: 'Get Started' }).click(); | ||
await page.getByRole('link', { name: 'Don\'t have an account? Sign up' }).click(); | ||
await page.locator('input[type="email"]').click(); | ||
await page.locator('input[type="email"]').fill('[email protected]'); | ||
await page.getByRole('textbox').nth(2).click(); | ||
await page.getByRole('textbox').nth(2).fill('admin123'); | ||
await page.locator('input[type="password"]').click(); | ||
await page.locator('input[type="password"]').fill('12345678'); | ||
await page.getByRole('button', { name: 'Sign Up' }).click(); | ||
|
||
// Verify the error message for the empty name field | ||
const nameErrorMessage = page.locator('text=Required'); | ||
await expect(nameErrorMessage).toBeVisible({ timeout: 10000 }); // Adjust the timeout as needed | ||
}); | ||
|
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { test, expect } from '@playwright/test'; | ||
|
||
test('Update profile without name shows error message', async ({ page }) => { | ||
await page.goto('https://packrat.world/'); | ||
await page.getByRole('link', { name: 'Get Started' }).click(); | ||
await page.getByLabel('Email').click(); | ||
await page.getByLabel('Email').fill('[email protected]'); | ||
await page.getByLabel('Password').click(); | ||
await page.getByLabel('Password').fill('12345678'); | ||
await page.getByRole('button', { name: 'Sign In' }).click(); | ||
await page.getByRole('button', { name: 'Menu' }).hover(); | ||
await page.getByRole('button', { name: ' Profile' }).click(); | ||
await page.goto('https://packrat.world/profile'); | ||
await page.getByRole('button', { name: '' }).click(); | ||
await page.locator('#name').click(); | ||
await page.locator('#name').fill(''); | ||
await page.getByRole('button', { name: 'Update profile' }).click(); | ||
|
||
// Verify the error message for the empty name field | ||
const nameErrorMessage = page.locator('text=String must contain at least 1 character(s)'); | ||
await expect(nameErrorMessage).toBeVisible({ timeout: 10000 }); // Adjust the timeout as needed | ||
}); |
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { test, expect } from '@playwright/test'; | ||
|
||
test('invalid login with wrong password format shows error message', async ({ page }) => { | ||
await page.goto('https://packrat.world/'); | ||
await page.getByRole('link', { name: 'Get Started' }).click(); | ||
|
||
await page.locator('input[type="email"]').click(); | ||
await page.locator('input[type="email"]').fill('[email protected]'); | ||
await page.locator('input[type="password"]').click(); | ||
await page.locator('input[type="password"]').fill('12345'); | ||
await page.getByRole('button', { name: 'Sign In' }).click(); | ||
|
||
// Verify the error message for invalid email format | ||
const passwordErrorMessage = page.locator('text=String must contain at least 7 character(s)'); | ||
await expect(passwordErrorMessage).toBeVisible({ timeout: 50000 }); // Adjust the timeout as needed | ||
}); |