-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathforms.spec.ts
More file actions
53 lines (42 loc) · 1.8 KB
/
Copy pathforms.spec.ts
File metadata and controls
53 lines (42 loc) · 1.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
import { test, expect } from "@playwright/test";
/**
* Forms and interactions tests
* Verify forms are present and can be interacted with
*/
test.describe("Contact Form", () => {
test.skip("contact form is visible", async ({ page }) => {
// Skip by default - enable once you verify the form structure
await page.goto("/contact");
// Update these selectors based on your actual form structure
const form = page.locator("form");
await expect(form).toBeVisible();
});
test.skip("contact form fields are present", async ({ page }) => {
// Skip by default - customize based on your form fields
await page.goto("/contact");
// Example - update with your actual field names/IDs
await expect(page.locator('input[name="name"]')).toBeVisible();
await expect(page.locator('input[name="email"]')).toBeVisible();
await expect(page.locator('textarea[name="message"]')).toBeVisible();
});
test.skip("can fill out and submit contact form", async ({ page }) => {
// Skip by default - customize based on your form
await page.goto("/contact");
// Fill form
await page.fill('input[name="name"]', "Test User");
await page.fill('input[name="email"]', "test@example.com");
await page.fill('textarea[name="message"]', "This is a test message");
// Submit
await page.click('button[type="submit"]');
// Verify success (customize based on your success message/redirect)
await expect(page.locator("text=/thank you|success/i")).toBeVisible();
});
});
test.describe("Search Functionality", () => {
test.skip("search bar is present on homepage", async ({ page }) => {
// Skip by default - enable if you have search
await page.goto("/");
const searchBar = page.locator('input[type="search"]');
await expect(searchBar).toBeVisible();
});
});