You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
The_Tip_Top/tests/contact.test.ts

14 lines
664 B

// e2e/example.spec.ts
import { test, expect } from '@playwright/test'
test('navigate to /contact and check if h1 contains "Contactez nous"', async ({ page }) => {
// Start from the index page (the baseURL is set via the webServer in the playwright.config.ts)
await page.goto('http://localhost:3000/')
// Find an element with the text 'About Page' and click on it
await page.click('text=Contactez-nous')
// The new URL should be "/about" (baseURL is used there)
await expect(page).toHaveURL('http://localhost:3000/contact')
// The new page should contain an h1 with "About Page"
await expect(page.locator('h1')).toContainText('Contactez nous')
})