Added test file

This commit is contained in:
Patrick Alvin Alcala 2025-08-26 11:53:58 +08:00
parent c6f276405c
commit 1320d58c4a
2 changed files with 20 additions and 0 deletions

View file

@ -0,0 +1,20 @@
import { test, expect } from '@playwright/test'
test('page loaded correctly', async ({ page }) => {
await page.goto('http://localhost:4321')
await expect(page).toHaveTitle('Home')
const descriptionMeta = await page.getAttribute('meta[name="name"]', 'content')
expect(descriptionMeta).toBe('Template')
const keywordsMeta = await page.getAttribute('meta[name="description"]', 'content')
expect(keywordsMeta).toBe('This is just a template.')
})
test('header title is visible and contains correct text', async ({ page }) => {
await page.goto('http://localhost:4321')
const headerTitle = await page.textContent('h1')
expect(headerTitle).toBe('Main Page')
})

View file