diff --git a/tests/contact/contact.nofixture.spec.ts b/tests/contact/contact.nofixture.spec.ts new file mode 100644 index 0000000..0d5095d --- /dev/null +++ b/tests/contact/contact.nofixture.spec.ts @@ -0,0 +1,16 @@ +import { test, expect } from "@playwright/test"; + +test("Home Page Tests", async ({ page }) => { + await page.goto(""); + + await page.getByTestId("nav-contact").click(); + await page.getByTestId("first-name").fill("Test"); + await page.getByTestId("last-name").fill("Mctester"); + await page.getByTestId("email").fill("asf@asdf.com"); + await page.getByTestId("subject").selectOption("payments"); + await page.getByTestId("message").fill("test".repeat(40)); + await page.getByTestId("contact-submit").click(); + await expect(page.locator(".alert-success")).toHaveText( + "Thanks for your message! We will contact you shortly." + ); +}); diff --git a/tests/contact/contact.spec.ts b/tests/contact/contact.spec.ts index 890b297..2fdbec8 100644 --- a/tests/contact/contact.spec.ts +++ b/tests/contact/contact.spec.ts @@ -1,11 +1,8 @@ import { test } from "@fixtures/modifiedGoto"; import { expect } from "@playwright/test"; -// Append query parameters to page.goto() urls - Tomaj -// https://discord.com/channels/807756831384403968/1160874346483564644 - test("Home Page Tests", async ({ page }) => { - await page.goto("https://practicesoftwaretesting.com/#/"); + await page.goto("/#/"); expect(page.url()).toContain("?UTM_SOURCE=playwright"); await page.getByTestId("nav-contact").click();