diff --git a/tests/e2e.spec.ts b/tests/e2e.spec.ts index e237e7f5..03ce7b88 100644 --- a/tests/e2e.spec.ts +++ b/tests/e2e.spec.ts @@ -1,22 +1,20 @@ import { test, expect } from '@playwright/test'; -test('has title', async ({ page }) => { +test.beforeEach(async ({ page }) => { await page.goto('/'); +}); +test('has title', async ({ page }) => { // Expect a title "to contain" a substring. await expect(page).toHaveTitle(/Rahul Jain/); }); test('has main heading', async ({ page }) => { - await page.goto('/'); - // Expect the main heading to be visible await expect(page.locator('h1.title')).toBeVisible(); }); test('has social links', async ({ page }) => { - await page.goto('/'); - // Check for social links await Promise.all([ expect(page.getByLabel('Stack Overflow')).toBeVisible(),