This repository has been archived on 2026-01-31. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
nextjs-serve-actions/app/page.spec.ts
2024-07-08 12:24:21 +02:00

30 lines
844 B
TypeScript

import { expect, test } from '@playwright/test';
import 'dotenv/config';
test.describe('Home component tests', () => {
test.beforeEach(async ({ page }) => {
await page.goto(`http://localhost:${process.env.PORT}/`);
});
test('should display Dashboard content by default', async ({ page }) => {
await expect(page.locator('text=Dashboard')).toBeVisible();
});
test('should switch to Dashboard content when Dashboard tab is clicked', async ({
page
}) => {
await page.click('text=Settings');
await page.click('text=Dashboard');
await expect(page.locator('text=Dashboard')).toBeVisible();
});
test('should switch to Settings content when Settings tab is clicked', async ({
page
}) => {
await page.click('text=Settings');
await expect(page.locator('text=Settings')).toBeVisible();
});
});