-
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.
Update home page test and remove basic test
- Loading branch information
1 parent
47869d4
commit 3ddedbe
Showing
2 changed files
with
15 additions
and
16 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,19 +1,25 @@ | ||
import { expect, test } from '@playwright/test'; | ||
|
||
test.describe('Basic home page tests', () => { | ||
test('verify page heading and toast message', async ({ page }) => { | ||
test('Verify page headings and navigation', async ({ page }) => { | ||
// Navigate to the home page | ||
await page.goto('/'); | ||
|
||
// Check if the heading 'Home page' is visible | ||
const heading = page.getByRole('heading', { name: 'Home page' }); | ||
await expect(heading).toBeVisible(); | ||
// Check if the heading is visible | ||
const homePageHeading = page.getByRole('heading', { | ||
name: 'CaptionThat - Unleash Your Creativity' | ||
}); | ||
await expect(homePageHeading).toBeVisible(); | ||
|
||
// Click the button that shows the toast | ||
const showToastButton = page.getByRole('button', { name: 'Show toast' }); | ||
await showToastButton.click(); | ||
// Click the link that navigates to "/app" | ||
const link = page.getByRole('link', { name: 'Try it out for free' }); | ||
await link.first().click(); | ||
|
||
// Verify the toast message 'Hello world' is displayed | ||
await expect(page.locator('text=Hello world!')).toBeVisible(); | ||
await page.waitForURL('/app'); | ||
|
||
const appPageHeading = page.getByRole('heading', { | ||
name: 'Image Caption Creator' | ||
}); | ||
await expect(appPageHeading).toBeVisible(); | ||
}); | ||
}); |
This file was deleted.
Oops, something went wrong.