fix: e2e tests need to click 'Continue to Booking' before date selection
The exchange page is a two-step wizard: - Step 1: Direction, amount, price selection - Step 2: Date and slot selection Tests were looking for date elements before navigating to step 2.
This commit is contained in:
parent
ca3a08a236
commit
0d8369ce65
2 changed files with 87 additions and 8 deletions
|
|
@ -92,9 +92,13 @@ test.describe("Exchange Page - Regular User Access", () => {
|
|||
await expect(page.getByText(/You buy €\d/)).toBeVisible();
|
||||
});
|
||||
|
||||
test("exchange page shows date selection", async ({ page }) => {
|
||||
test("exchange page shows date selection after continue", async ({ page }) => {
|
||||
await page.goto("/exchange");
|
||||
|
||||
// Step 1: Click "Continue to Booking" to proceed to step 2
|
||||
await page.getByRole("button", { name: "Continue to Booking" }).click();
|
||||
|
||||
// Step 2: Now date selection should be visible
|
||||
await expect(page.getByRole("heading", { name: "Select a Date" })).toBeVisible();
|
||||
// Should see multiple date buttons
|
||||
const dateButtons = page
|
||||
|
|
@ -118,7 +122,10 @@ test.describe("Exchange Page - With Availability", () => {
|
|||
test("shows available slots when availability is set", async ({ page }) => {
|
||||
await page.goto("/exchange");
|
||||
|
||||
// Use data-testid for reliable date selection
|
||||
// Step 1: Click "Continue to Booking" to proceed to step 2
|
||||
await page.getByRole("button", { name: "Continue to Booking" }).click();
|
||||
|
||||
// Step 2: Use data-testid for reliable date selection
|
||||
const tomorrowStr = getTomorrowDateStr();
|
||||
const dateButton = page.getByTestId(`date-${tomorrowStr}`);
|
||||
await expect(dateButton).toBeEnabled({ timeout: 15000 });
|
||||
|
|
@ -138,7 +145,10 @@ test.describe("Exchange Page - With Availability", () => {
|
|||
test("clicking slot shows confirmation form", async ({ page }) => {
|
||||
await page.goto("/exchange");
|
||||
|
||||
// Use data-testid for reliable date selection
|
||||
// Step 1: Click "Continue to Booking" to proceed to step 2
|
||||
await page.getByRole("button", { name: "Continue to Booking" }).click();
|
||||
|
||||
// Step 2: Use data-testid for reliable date selection
|
||||
const tomorrowStr = getTomorrowDateStr();
|
||||
const dateButton = page.getByTestId(`date-${tomorrowStr}`);
|
||||
await expect(dateButton).toBeEnabled({ timeout: 15000 });
|
||||
|
|
@ -160,7 +170,10 @@ test.describe("Exchange Page - With Availability", () => {
|
|||
test("confirmation shows trade details", async ({ page }) => {
|
||||
await page.goto("/exchange");
|
||||
|
||||
// Use data-testid for reliable date selection
|
||||
// Step 1: Click "Continue to Booking" to proceed to step 2
|
||||
await page.getByRole("button", { name: "Continue to Booking" }).click();
|
||||
|
||||
// Step 2: Use data-testid for reliable date selection
|
||||
const tomorrowStr = getTomorrowDateStr();
|
||||
const dateButton = page.getByTestId(`date-${tomorrowStr}`);
|
||||
await expect(dateButton).toBeEnabled({ timeout: 15000 });
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue