Skip to content

Commit

Permalink
test: add delay post navigate
Browse files Browse the repository at this point in the history
  • Loading branch information
jlp-craigmorten committed Jan 31, 2024
1 parent 603ca57 commit daba43c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions examples/playwright-nvda/tests/headerNavigation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ import { Page } from "@playwright/test";
import { log } from "../../log";
import type { NVDAPlaywright } from "../../../src";

async function delay(ms: number) {
return new Promise((resolve) => setTimeout(resolve, ms));
}

const MAX_NAVIGATION_LOOP = 10;

export async function headerNavigation({
Expand All @@ -20,9 +24,11 @@ export async function headerNavigation({
// Wait for page to be ready and interact 🙌
const header = page.locator("h1");
await header.waitFor();
await delay(500);

// Make sure interacting with the web content
await nvda.navigateToWebContent();
await delay(500);

let headingCount = 0;

Expand Down
6 changes: 6 additions & 0 deletions examples/playwright-voiceover/tests/headerNavigation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ import { Page } from "@playwright/test";
import { log } from "../../log";
import type { VoiceOverPlaywright } from "../../../src";

async function delay(ms: number) {
return new Promise((resolve) => setTimeout(resolve, ms));
}

const MAX_NAVIGATION_LOOP = 10;

export async function headerNavigation({
Expand All @@ -20,9 +24,11 @@ export async function headerNavigation({
// Wait for page to be ready and interact 🙌
const header = page.locator("h1");
await header.waitFor();
await delay(500);

// Make sure interacting with the web content
await voiceOver.navigateToWebContent();
await delay(500);

let headingCount = 0;

Expand Down

0 comments on commit daba43c

Please sign in to comment.