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
4 changes: 2 additions & 2 deletions tools/playwright/package-lock.json

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

2 changes: 1 addition & 1 deletion tools/playwright/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "abledom-playwright",
"version": "0.0.17",
"version": "0.0.18",
"description": "AbleDOM tools for Playwright",
"author": "Marat Abdullin <marata@microsoft.com>",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion tools/playwright/src/fixtures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export interface AbleDOMFixtures {
* IMPORTANT: This function is async and MUST be awaited before navigating the page.
*
* @param page - The Playwright Page object to attach AbleDOM to
* @param options - Optional idle options (markAsRead defaults to true, timeout defaults to 2000ms)
* @param options - Optional idle options (markAsRead defaults to true, timeout defaults to 1000ms)
*
* @example
* ```typescript
Expand Down
6 changes: 3 additions & 3 deletions tools/playwright/src/page-injector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export interface AbleDOMIdleOptions {
/**
* Timeout in milliseconds to wait for validation to complete.
* If validation doesn't complete within the timeout, returns null.
* @default 2000
* @default 1000
*/
timeout?: number;
}
Expand Down Expand Up @@ -92,7 +92,7 @@ function getCallerLocation(
*
* @param page - The Playwright Page object to attach methods to
* @param testInfo - Optional TestInfo object for reporting issues to the custom reporter
* @param options - Optional idle options (markAsRead defaults to true, timeout defaults to 2000ms)
* @param options - Optional idle options (markAsRead defaults to true, timeout defaults to 1000ms)
*
* @example
* ```typescript
Expand All @@ -113,7 +113,7 @@ export async function attachAbleDOMMethodsToPage(
testInfo?: TestInfo,
options: AbleDOMIdleOptions = {},
): Promise<void> {
const { markAsRead = true, timeout = 2000 } = options;
const { markAsRead = true, timeout = 1000 } = options;
const attachAbleDOMMethodsToPageWithCachedLocatorProto: FunctionWithCachedLocatorProto =
attachAbleDOMMethodsToPage;

Expand Down
4 changes: 2 additions & 2 deletions tools/playwright/tests/create-abledom-test.test.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ test.describe("attachAbleDOM with custom options", () => {
});

expect(opts).toHaveLength(1);
expect(opts[0]).toEqual({ markAsRead: false, timeout: 2000 });
expect(opts[0]).toEqual({ markAsRead: false, timeout: 1000 });

await context.close();
});
Expand Down Expand Up @@ -379,7 +379,7 @@ test.describe("attachAbleDOM with custom options", () => {
});

expect(opts).toHaveLength(1);
expect(opts[0]).toEqual({ markAsRead: true, timeout: 2000 });
expect(opts[0]).toEqual({ markAsRead: true, timeout: 1000 });

await context.close();
});
Expand Down
2 changes: 1 addition & 1 deletion tools/playwright/tests/page-fixture-options.test.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ testWithMarkAsReadFalse.describe(
});

expect(opts).toHaveLength(1);
expect(opts[0]).toEqual({ markAsRead: false, timeout: 2000 });
expect(opts[0]).toEqual({ markAsRead: false, timeout: 1000 });
},
);
},
Expand Down
14 changes: 7 additions & 7 deletions tools/playwright/tests/page-injector.test.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ test.describe("idle options (markAsRead and timeout)", () => {
};
});

// Trigger an action - should use default options (markAsRead=true, timeout=2000)
// Trigger an action - should use default options (markAsRead=true, timeout=1000)
await page.locator("button").waitFor();

// Verify the options were passed
Expand All @@ -295,10 +295,10 @@ test.describe("idle options (markAsRead and timeout)", () => {
});

expect(idleArgs.length).toBe(1);
expect(idleArgs[0]).toEqual({ markAsRead: true, timeout: 2000 });
expect(idleArgs[0]).toEqual({ markAsRead: true, timeout: 1000 });
});

test("should use default markAsRead=true and timeout=2000", async ({
test("should use default markAsRead=true and timeout=1000", async ({
page,
}) => {
await page.goto(
Expand Down Expand Up @@ -331,7 +331,7 @@ test.describe("idle options (markAsRead and timeout)", () => {
});

expect(calls).toHaveLength(1);
expect(calls[0]).toEqual({ markAsRead: true, timeout: 2000 });
expect(calls[0]).toEqual({ markAsRead: true, timeout: 1000 });
});

test("should handle null return from idle() when timeout expires", async ({
Expand Down Expand Up @@ -401,8 +401,8 @@ test.describe("idle options (markAsRead and timeout)", () => {

expect(calls).toHaveLength(2);
// Both calls should have the same default options
expect(calls[0]).toEqual({ markAsRead: true, timeout: 2000 });
expect(calls[1]).toEqual({ markAsRead: true, timeout: 2000 });
expect(calls[0]).toEqual({ markAsRead: true, timeout: 1000 });
expect(calls[1]).toEqual({ markAsRead: true, timeout: 1000 });
});
});

Expand Down Expand Up @@ -660,7 +660,7 @@ baseTest.describe("custom idle options via attachAbleDOMMethodsToPage", () => {
});

baseTest.expect(opts).toHaveLength(1);
baseTest.expect(opts[0]).toEqual({ markAsRead: false, timeout: 2000 });
baseTest.expect(opts[0]).toEqual({ markAsRead: false, timeout: 1000 });
},
);

Expand Down