Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions Test/End-2-End/Pages/VisitCheckoutPayment.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { expect } from "@playwright/test";
import {expect} from "@playwright/test";
import Cart from "../Components/Cart";
import {v7 as uuidv7} from 'uuid';

export default class VisitCheckoutPayment {
constructor(page) {
Expand All @@ -13,7 +14,7 @@ export default class VisitCheckoutPayment {

await this.page
.getByLabel("Email address", { exact: true })
.fill("johndoe@example.com");
.fill(uuidv7() + "@example.com");
await this.page.getByLabel("First name").fill("John");
await this.page.getByLabel("Last name").fill("Doe");
await this.page.getByLabel("Street address").fill("123 Main St");
Expand Down
9 changes: 3 additions & 6 deletions Test/End-2-End/clearpay.spec.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { test, expect } from "@playwright/test";
import {expect, test} from "@playwright/test";
import VisitCheckoutPayment from "./Pages/VisitCheckoutPayment";
import Cart from "./Components/Cart";

import {v7 as uuidv7} from 'uuid';
// This test is quite far, but the Clearpay modal is quite a bit flakey. It sometimes works, sometimes doesn't.
test.skip("Can place an order", async ({ page, browser }) => {
const visitCheckoutPayment = new VisitCheckoutPayment(page);
Expand All @@ -21,12 +21,9 @@ test.skip("Can place an order", async ({ page, browser }) => {
const frame = page.frameLocator("iframe.rvvup-modal");
await frame.getByRole("button", { name: "Accept All" }).click();

const randomString =
Math.random().toString(36).substring(2, 15) +
Math.random().toString(36).substring(2, 15);
await frame
.getByLabel("Email or mobile number")
.fill("playwright-" + randomString + "@example.com");
.fill(uuidv7() + "@example.com");
await frame.getByRole("button", { name: "Continue" }).click();

await frame
Expand Down
114 changes: 114 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"devDependencies": {
"@playwright/test": "^1.41.1",
"@types/node": "^20.11.8",
"prettier": "3.3.3"
"prettier": "3.3.3",
"uuid": "^10.0.0"
}
}