-
Notifications
You must be signed in to change notification settings - Fork 2
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
1 parent
968db5c
commit 4af41a2
Showing
1 changed file
with
37 additions
and
14 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 |
---|---|---|
@@ -1,16 +1,39 @@ | ||
import { test, expect } from '@playwright/test'; | ||
|
||
test('e2e', async ({ page }) => { | ||
await page.goto('https://baggit-app.vercel.app/home') | ||
await page.getByRole('link', { name: 'account Account' }).click(); | ||
await page.getByRole('link', { name: 'booking Booking' }).click(); | ||
await page.getByRole('link', { name: 'home Home' }).click(); | ||
await page.getByPlaceholder('Enter location to search').click(); | ||
await page.getByPlaceholder('Enter location to search').fill('birmingham'); | ||
await page.getByRole('button', { name: 'Search' }).click(); | ||
await page.locator('div:nth-child(3) > div:nth-child(3)').first().click(); | ||
await page.getByRole('button', { name: '×' }).click(); | ||
await page.locator('div:nth-child(3) > div:nth-child(4)').first().click(); | ||
await page.getByRole('link', { name: 'Details' }).click(); | ||
await page.getByRole('link', { name: 'Terms and Conditions' }).click(); | ||
}) | ||
test('frontpage presentation', async ({ page }) => { | ||
await page.goto('https://baggit-app.vercel.app/home'); | ||
|
||
const homepageElements = [ | ||
page.locator('div').filter({ hasText: 'Search' }).nth(1), | ||
page.getByPlaceholder('Enter location to search'), | ||
page.getByRole('button', { name: 'Search' }), | ||
page.getByRole('button', { name: 'Current Location' }), | ||
page.getByText('Home Booking Account'), | ||
page.getByRole('link', { name: 'home Home' }), | ||
page.getByRole('link', { name: 'booking Booking' }), | ||
page.getByRole('link', { name: 'account Account' }) | ||
]; | ||
|
||
for (const element of homepageElements) { | ||
await expect(element).toBeVisible(); | ||
} | ||
}); | ||
|
||
test('User Journey', async ({ page }) => { | ||
await page.goto('https://baggit-app.vercel.app/home'); | ||
await page.getByPlaceholder('Enter location to search').click(); | ||
await page.getByPlaceholder('Enter location to search').fill('birmingham'); | ||
await page.getByPlaceholder('Enter location to search').press('Enter'); | ||
await page.getByRole('button', { name: 'Search' }).click(); | ||
await page.locator('div:nth-child(3) > div:nth-child(3)').first().click(); | ||
await page.getByRole('button', { name: 'Details' }).click(); | ||
await page.getByRole('link', { name: 'Terms and Conditions' }).click(); | ||
await page.getByRole('link', { name: 'Privacy Policy' }).click(); | ||
}) | ||
|
||
test('store info presentation', async ({ page }) => { | ||
await page.goto('https://baggit-app.vercel.app/storeinfo'); | ||
await expect(page.getByText('Opening times: Mon-Fri 9:00 - 20:00')).toBeVisible(); | ||
await expect(page.getByRole('heading', { name: 'About Bag Storage App' })).toBeVisible() | ||
await expect(page.getByText('Pay Now')).toBeVisible() | ||
}); |