Skip to content

Commit

Permalink
modified goto (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
BMayhew authored Nov 26, 2023
1 parent ab6cafb commit 3c443cb
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
16 changes: 16 additions & 0 deletions tests/contact/contact.nofixture.spec.ts
Original file line number Diff line number Diff line change
@@ -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."
);
});
5 changes: 1 addition & 4 deletions tests/contact/contact.spec.ts
Original file line number Diff line number Diff line change
@@ -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();
Expand Down

0 comments on commit 3c443cb

Please sign in to comment.