Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
37 changes: 37 additions & 0 deletions tests/homePage.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import { test, expect } from '@playwright/test';


test('checking the url', async ({page}) => {
await page.goto('/')
await expect(page).toHaveURL('http://localhost:3000/')
})

test('checking home page', async ({page}) => {
await page.goto('/')
await expect(page.getByRole('heading',{name: 'Welcome to React Email'})).toContainText('Welcome to React Email')
})

test('cheking for presence of notifications', async ({page}) => {
await page.goto('/')
await expect(page.locator('//h3')).toHaveText('notifications')
})

test('checking for presence of mails', async ({page}) => {
await page.goto('/')
await page.locator('//h3').click()
for (const element of await page.locator('span.truncate.w-\\[calc\\(100\\%\\-1\\.25rem\\)\\]').all()) {
expect(element).toBeVisible()}
})

test('checking for screenshot light mode', async ({page}) => {
page.goto('/')
await page.locator('//h3').click()
await page.getByText('deposited-cycles').click()
await page.locator('#layer2')
await expect(page).toHaveScreenshot('deposited-cycles.png')

await page.getByText('failed-deposit-cycles').click()
await page.locator('#layer2')
await expect(page).toHaveScreenshot('failed-deposit-cycles.png')
})

Loading