@clerk/testing 2.0.0-snapshot.v07d9254 → 2.0.0-snapshot.v20251203152900
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -41
- package/cypress/package.json +5 -0
- package/dist/chunk-JDNEQWYI.mjs +10 -0
- package/dist/chunk-JDNEQWYI.mjs.map +1 -0
- package/dist/chunk-M5YIJ3SE.mjs +2 -0
- package/dist/chunk-M5YIJ3SE.mjs.map +1 -0
- package/dist/chunk-YFUXUEZ5.mjs +2 -0
- package/dist/chunk-YFUXUEZ5.mjs.map +1 -0
- package/dist/cypress/index.js +10 -0
- package/dist/cypress/index.js.map +1 -0
- package/dist/cypress/index.mjs +2 -0
- package/dist/cypress/index.mjs.map +1 -0
- package/dist/index.js +5 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6 -0
- package/dist/index.mjs.map +1 -0
- package/dist/playwright/index.js +10 -0
- package/dist/playwright/index.js.map +1 -0
- package/dist/playwright/index.mjs +2 -0
- package/dist/playwright/index.mjs.map +1 -0
- package/dist/playwright/unstable/index.js +2 -0
- package/dist/playwright/unstable/index.js.map +1 -0
- package/dist/playwright/unstable/index.mjs +2 -0
- package/dist/playwright/unstable/index.mjs.map +1 -0
- package/dist/types/common/constants.d.ts +2 -0
- package/dist/types/common/constants.d.ts.map +1 -0
- package/dist/types/common/errors.d.ts +2 -0
- package/dist/types/common/errors.d.ts.map +1 -0
- package/dist/types/common/helpers-utils.d.ts +3 -0
- package/dist/types/common/helpers-utils.d.ts.map +1 -0
- package/dist/types/common/index.d.ts +6 -0
- package/dist/types/common/index.d.ts.map +1 -0
- package/dist/types/common/setup.d.ts +3 -0
- package/dist/types/common/setup.d.ts.map +1 -0
- package/dist/types/common/types.d.ts +30 -0
- package/dist/types/common/types.d.ts.map +1 -0
- package/dist/types/cypress/custom-commands.d.ts +60 -0
- package/dist/types/cypress/custom-commands.d.ts.map +1 -0
- package/dist/types/cypress/index.d.ts +4 -0
- package/dist/types/cypress/index.d.ts.map +1 -0
- package/dist/types/cypress/setup.d.ts +23 -0
- package/dist/types/cypress/setup.d.ts.map +1 -0
- package/dist/types/cypress/setupClerkTestingToken.d.ts +22 -0
- package/dist/types/cypress/setupClerkTestingToken.d.ts.map +1 -0
- package/dist/types/index.d.ts +1 -2
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/playwright/helpers.d.ts +101 -0
- package/dist/types/playwright/helpers.d.ts.map +1 -0
- package/dist/types/playwright/index.d.ts +4 -0
- package/dist/types/playwright/index.d.ts.map +1 -0
- package/dist/types/{setup.d.ts → playwright/setup.d.ts} +2 -7
- package/dist/types/playwright/setup.d.ts.map +1 -0
- package/dist/types/playwright/setupClerkTestingToken.d.ts +28 -0
- package/dist/types/playwright/setupClerkTestingToken.d.ts.map +1 -0
- package/dist/types/playwright/unstable/index.d.ts +5 -0
- package/dist/types/playwright/unstable/index.d.ts.map +1 -0
- package/dist/types/playwright/unstable/page-objects/apiKeys.d.ts +52 -0
- package/dist/types/playwright/unstable/page-objects/apiKeys.d.ts.map +1 -0
- package/dist/types/playwright/unstable/page-objects/app.d.ts +28 -0
- package/dist/types/playwright/unstable/page-objects/app.d.ts.map +1 -0
- package/dist/types/playwright/unstable/page-objects/checkout.d.ts +56 -0
- package/dist/types/playwright/unstable/page-objects/checkout.d.ts.map +1 -0
- package/dist/types/playwright/unstable/page-objects/clerk.d.ts +12 -0
- package/dist/types/playwright/unstable/page-objects/clerk.d.ts.map +1 -0
- package/dist/types/playwright/unstable/page-objects/common.d.ts +29 -0
- package/dist/types/playwright/unstable/page-objects/common.d.ts.map +1 -0
- package/dist/types/playwright/unstable/page-objects/expect.d.ts +14 -0
- package/dist/types/playwright/unstable/page-objects/expect.d.ts.map +1 -0
- package/dist/types/playwright/unstable/page-objects/impersonation.d.ts +8 -0
- package/dist/types/playwright/unstable/page-objects/impersonation.d.ts.map +1 -0
- package/dist/types/playwright/unstable/page-objects/index.d.ts +626 -0
- package/dist/types/playwright/unstable/page-objects/index.d.ts.map +1 -0
- package/dist/types/playwright/unstable/page-objects/keylessPopover.d.ts +13 -0
- package/dist/types/playwright/unstable/page-objects/keylessPopover.d.ts.map +1 -0
- package/dist/types/playwright/unstable/page-objects/organizationSwitcher.d.ts +43 -0
- package/dist/types/playwright/unstable/page-objects/organizationSwitcher.d.ts.map +1 -0
- package/dist/types/playwright/unstable/page-objects/planDetails.d.ts +39 -0
- package/dist/types/playwright/unstable/page-objects/planDetails.d.ts.map +1 -0
- package/dist/types/playwright/unstable/page-objects/pricingTable.d.ts +55 -0
- package/dist/types/playwright/unstable/page-objects/pricingTable.d.ts.map +1 -0
- package/dist/types/playwright/unstable/page-objects/sessionTask.d.ts +45 -0
- package/dist/types/playwright/unstable/page-objects/sessionTask.d.ts.map +1 -0
- package/dist/types/playwright/unstable/page-objects/signIn.d.ts +61 -0
- package/dist/types/playwright/unstable/page-objects/signIn.d.ts.map +1 -0
- package/dist/types/playwright/unstable/page-objects/signUp.d.ts +57 -0
- package/dist/types/playwright/unstable/page-objects/signUp.d.ts.map +1 -0
- package/dist/types/playwright/unstable/page-objects/subscriptionDetails.d.ts +41 -0
- package/dist/types/playwright/unstable/page-objects/subscriptionDetails.d.ts.map +1 -0
- package/dist/types/playwright/unstable/page-objects/testingToken.d.ts +7 -0
- package/dist/types/playwright/unstable/page-objects/testingToken.d.ts.map +1 -0
- package/dist/types/playwright/unstable/page-objects/userAvatar.d.ts +11 -0
- package/dist/types/playwright/unstable/page-objects/userAvatar.d.ts.map +1 -0
- package/dist/types/playwright/unstable/page-objects/userButton.d.ts +14 -0
- package/dist/types/playwright/unstable/page-objects/userButton.d.ts.map +1 -0
- package/dist/types/playwright/unstable/page-objects/userProfile.d.ts +60 -0
- package/dist/types/playwright/unstable/page-objects/userProfile.d.ts.map +1 -0
- package/dist/types/playwright/unstable/page-objects/userVerification.d.ts +43 -0
- package/dist/types/playwright/unstable/page-objects/userVerification.d.ts.map +1 -0
- package/dist/types/playwright/unstable/page-objects/waitlist.d.ts +48 -0
- package/dist/types/playwright/unstable/page-objects/waitlist.d.ts.map +1 -0
- package/package.json +52 -23
- package/playwright/package.json +5 -0
- package/dist/esm/index.js +0 -2
- package/dist/esm/index.js.map +0 -1
- package/dist/types/setup.d.ts.map +0 -1
- package/dist/types/setupClerkTestingToken.d.ts +0 -29
- package/dist/types/setupClerkTestingToken.d.ts.map +0 -1
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import type { Clerk, SignOutOptions } from '@clerk/shared/types';
|
|
2
|
+
import type { Page } from '@playwright/test';
|
|
3
|
+
import type { ClerkSignInParams, SetupClerkTestingTokenOptions } from '../common';
|
|
4
|
+
declare global {
|
|
5
|
+
interface Window {
|
|
6
|
+
Clerk: Clerk;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
type PlaywrightClerkLoadedParams = {
|
|
10
|
+
page: Page;
|
|
11
|
+
};
|
|
12
|
+
type PlaywrightClerkSignInParamsWithEmail = {
|
|
13
|
+
page: Page;
|
|
14
|
+
emailAddress: string;
|
|
15
|
+
setupClerkTestingTokenOptions?: SetupClerkTestingTokenOptions;
|
|
16
|
+
};
|
|
17
|
+
type ClerkHelperParams = {
|
|
18
|
+
/**
|
|
19
|
+
* Signs in a user using Clerk. This helper supports multiple sign-in strategies:
|
|
20
|
+
* 1. Using signInParams object (password, phone_code, email_code strategies)
|
|
21
|
+
* 2. Using emailAddress for automatic ticket-based sign-in
|
|
22
|
+
*
|
|
23
|
+
* Multi-factor is not supported.
|
|
24
|
+
* This helper is using the `setupClerkTestingToken` internally.
|
|
25
|
+
* It is required to call `page.goto` before calling this helper, and navigate to a not protected page that loads Clerk.
|
|
26
|
+
*
|
|
27
|
+
* For strategy-based sign-in:
|
|
28
|
+
* If the strategy is password, the helper will sign in the user using the provided password and identifier.
|
|
29
|
+
* If the strategy is phone_code, you are required to have a user with a test phone number as an identifier (e.g. +15555550100).
|
|
30
|
+
* If the strategy is email_code, you are required to have a user with a test email as an identifier (e.g. your_email+clerk_test@example.com).
|
|
31
|
+
*
|
|
32
|
+
* For email-based sign-in:
|
|
33
|
+
* The helper finds the user by email, creates a sign-in token using Clerk's backend API, and uses the ticket strategy.
|
|
34
|
+
*
|
|
35
|
+
* @example Strategy-based sign-in
|
|
36
|
+
* import { clerk } from "@clerk/testing/playwright";
|
|
37
|
+
*
|
|
38
|
+
* test("sign in with strategy", async ({ page }) => {
|
|
39
|
+
* await page.goto("/");
|
|
40
|
+
* await clerk.signIn({
|
|
41
|
+
* page,
|
|
42
|
+
* signInParams: { strategy: 'phone_code', identifier: '+15555550100' },
|
|
43
|
+
* });
|
|
44
|
+
* await page.goto("/protected");
|
|
45
|
+
* });
|
|
46
|
+
*
|
|
47
|
+
* @example Email-based sign-in
|
|
48
|
+
* import { clerk } from "@clerk/testing/playwright";
|
|
49
|
+
*
|
|
50
|
+
* test("sign in with email", async ({ page }) => {
|
|
51
|
+
* await page.goto("/");
|
|
52
|
+
* await clerk.signIn({ emailAddress: "bryce@clerk.dev", page });
|
|
53
|
+
* await page.goto("/protected");
|
|
54
|
+
* });
|
|
55
|
+
*/
|
|
56
|
+
signIn: {
|
|
57
|
+
(opts: PlaywrightClerkSignInParams): Promise<void>;
|
|
58
|
+
(opts: PlaywrightClerkSignInParamsWithEmail): Promise<void>;
|
|
59
|
+
};
|
|
60
|
+
/**
|
|
61
|
+
* Signs out the current user using Clerk.
|
|
62
|
+
* It is required to call `page.goto` before calling this helper, and navigate to a page that loads Clerk.
|
|
63
|
+
* @param opts.signOutOptions - A SignOutOptions object.
|
|
64
|
+
* @param opts.page - The Playwright page object.
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* import { clerk } from "@clerk/testing/playwright";
|
|
68
|
+
*
|
|
69
|
+
* test("sign out", async ({ page }) => {
|
|
70
|
+
* await page.goto("/");
|
|
71
|
+
* await clerk.signIn({
|
|
72
|
+
* page,
|
|
73
|
+
* signInParams: { strategy: 'phone_code', identifier: '+15555550100' },
|
|
74
|
+
* });
|
|
75
|
+
* await page.goto("/protected");
|
|
76
|
+
* await clerk.signOut({ page });
|
|
77
|
+
* await page.goto("/protected");
|
|
78
|
+
* // should redirect to sign in page
|
|
79
|
+
* });
|
|
80
|
+
*/
|
|
81
|
+
signOut: (opts: PlaywrightClerkSignOutParams) => Promise<void>;
|
|
82
|
+
/**
|
|
83
|
+
* Asserts that Clerk has been loaded.
|
|
84
|
+
* It is required to call `page.goto` before calling this helper, and navigate to a page that loads Clerk.
|
|
85
|
+
*
|
|
86
|
+
* @param opts.page - The Playwright page object.
|
|
87
|
+
*/
|
|
88
|
+
loaded: (opts: PlaywrightClerkLoadedParams) => Promise<void>;
|
|
89
|
+
};
|
|
90
|
+
type PlaywrightClerkSignInParams = {
|
|
91
|
+
page: Page;
|
|
92
|
+
signInParams: ClerkSignInParams;
|
|
93
|
+
setupClerkTestingTokenOptions?: SetupClerkTestingTokenOptions;
|
|
94
|
+
};
|
|
95
|
+
type PlaywrightClerkSignOutParams = {
|
|
96
|
+
page: Page;
|
|
97
|
+
signOutOptions?: SignOutOptions;
|
|
98
|
+
};
|
|
99
|
+
export declare const clerk: ClerkHelperParams;
|
|
100
|
+
export {};
|
|
101
|
+
//# sourceMappingURL=helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../src/playwright/helpers.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACjE,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAE7C,OAAO,KAAK,EAAE,iBAAiB,EAAE,6BAA6B,EAAE,MAAM,WAAW,CAAC;AAIlF,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,KAAK,EAAE,KAAK,CAAC;KACd;CACF;AAED,KAAK,2BAA2B,GAAG;IACjC,IAAI,EAAE,IAAI,CAAC;CACZ,CAAC;AAEF,KAAK,oCAAoC,GAAG;IAC1C,IAAI,EAAE,IAAI,CAAC;IACX,YAAY,EAAE,MAAM,CAAC;IACrB,6BAA6B,CAAC,EAAE,6BAA6B,CAAC;CAC/D,CAAC;AAEF,KAAK,iBAAiB,GAAG;IACvB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAqCG;IACH,MAAM,EAAE;QACN,CAAC,IAAI,EAAE,2BAA2B,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;QACnD,CAAC,IAAI,EAAE,oCAAoC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;KAC7D,CAAC;IACF;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,OAAO,EAAE,CAAC,IAAI,EAAE,4BAA4B,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/D;;;;;OAKG;IACH,MAAM,EAAE,CAAC,IAAI,EAAE,2BAA2B,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CAC9D,CAAC;AAOF,KAAK,2BAA2B,GAAG;IACjC,IAAI,EAAE,IAAI,CAAC;IACX,YAAY,EAAE,iBAAiB,CAAC;IAChC,6BAA6B,CAAC,EAAE,6BAA6B,CAAC;CAC/D,CAAC;AAsDF,KAAK,4BAA4B,GAAG;IAClC,IAAI,EAAE,IAAI,CAAC;IACX,cAAc,CAAC,EAAE,cAAc,CAAC;CACjC,CAAC;AAUF,eAAO,MAAM,KAAK,EAAE,iBAInB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/playwright/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC"}
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
type
|
|
2
|
-
publishableKey?: string;
|
|
3
|
-
frontendApiUrl?: string;
|
|
4
|
-
debug?: boolean;
|
|
5
|
-
};
|
|
1
|
+
import type { ClerkSetupOptions } from '../common';
|
|
6
2
|
/**
|
|
7
3
|
* Sets up Clerk for testing by fetching the testing token from the Clerk Backend API.
|
|
8
4
|
*
|
|
@@ -15,6 +11,5 @@ type ClerkSetupParams = {
|
|
|
15
11
|
* @throws An error if the secret key is from a production instance.
|
|
16
12
|
* @throws An error if the testing token cannot be fetched from the Clerk Backend API.
|
|
17
13
|
*/
|
|
18
|
-
export declare const clerkSetup: (options?:
|
|
19
|
-
export {};
|
|
14
|
+
export declare const clerkSetup: (options?: ClerkSetupOptions) => Promise<void>;
|
|
20
15
|
//# sourceMappingURL=setup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../../../src/playwright/setup.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAGnD;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,UAAU,GAAU,UAAU,iBAAiB,kBAI3D,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { BrowserContext, Page } from '@playwright/test';
|
|
2
|
+
import type { SetupClerkTestingTokenOptions } from '../common';
|
|
3
|
+
type SetupClerkTestingTokenParams = {
|
|
4
|
+
context?: BrowserContext;
|
|
5
|
+
page?: Page;
|
|
6
|
+
options?: SetupClerkTestingTokenOptions;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Bypasses bot protection by appending the testing token in the Frontend API requests.
|
|
10
|
+
*
|
|
11
|
+
* @param params.context - The Playwright browser context object.
|
|
12
|
+
* @param params.page - The Playwright page object.
|
|
13
|
+
* @param params.options.frontendApiUrl - The frontend API URL for your Clerk dev instance, without the protocol.
|
|
14
|
+
* @returns A promise that resolves when the bot protection bypass is set up.
|
|
15
|
+
* @throws An error if the Frontend API URL is not provided.
|
|
16
|
+
* @example
|
|
17
|
+
* import { setupClerkTestingToken } from '@clerk/testing/playwright';
|
|
18
|
+
*
|
|
19
|
+
* test('should bypass bot protection', async ({ context }) => {
|
|
20
|
+
* await setupClerkTestingToken({ context });
|
|
21
|
+
* const page = await context.newPage();
|
|
22
|
+
* await page.goto('https://your-app.com');
|
|
23
|
+
* // Continue with your test...
|
|
24
|
+
* });
|
|
25
|
+
*/
|
|
26
|
+
export declare const setupClerkTestingToken: ({ context, options, page }: SetupClerkTestingTokenParams) => Promise<void>;
|
|
27
|
+
export {};
|
|
28
|
+
//# sourceMappingURL=setupClerkTestingToken.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setupClerkTestingToken.d.ts","sourceRoot":"","sources":["../../../src/playwright/setupClerkTestingToken.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAE7D,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,WAAW,CAAC;AAG/D,KAAK,4BAA4B,GAAG;IAClC,OAAO,CAAC,EAAE,cAAc,CAAC;IACzB,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,OAAO,CAAC,EAAE,6BAA6B,CAAC;CACzC,CAAC;AAEF;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,sBAAsB,GAAU,4BAA4B,4BAA4B,kBAoDpG,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/playwright/unstable/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAEzD,YAAY,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { EnhancedPage } from './app';
|
|
2
|
+
export declare const createAPIKeysComponentPageObject: (testArgs: {
|
|
3
|
+
page: EnhancedPage;
|
|
4
|
+
}) => {
|
|
5
|
+
waitForMounted: () => Promise<import("@playwright/test").ElementHandle<SVGElement | HTMLElement>>;
|
|
6
|
+
clickAddButton: () => Promise<void>;
|
|
7
|
+
waitForFormOpened: () => Promise<import("@playwright/test").ElementHandle<SVGElement | HTMLElement>>;
|
|
8
|
+
waitForFormClosed: () => Promise<import("@playwright/test").ElementHandle<SVGElement | HTMLElement> | null>;
|
|
9
|
+
waitForRevokeModalOpened: () => Promise<import("@playwright/test").ElementHandle<SVGElement | HTMLElement>>;
|
|
10
|
+
waitForRevokeModalClosed: () => Promise<import("@playwright/test").ElementHandle<SVGElement | HTMLElement> | null>;
|
|
11
|
+
waitForCopyModalOpened: () => Promise<import("@playwright/test").ElementHandle<SVGElement | HTMLElement>>;
|
|
12
|
+
waitForCopyModalClosed: () => Promise<import("@playwright/test").ElementHandle<SVGElement | HTMLElement> | null>;
|
|
13
|
+
clickCopyAndCloseButton: () => Promise<void>;
|
|
14
|
+
typeName: (value: string) => Promise<void>;
|
|
15
|
+
typeDescription: (value: string) => Promise<void>;
|
|
16
|
+
selectExpiration: (value?: "never" | "1d" | "7d" | "30d" | "60d" | "90d" | "180d" | "1y") => Promise<void>;
|
|
17
|
+
clickSaveButton: () => Promise<void>;
|
|
18
|
+
typeRevokeConfirmation: (value: string) => Promise<void>;
|
|
19
|
+
clickConfirmRevokeButton: () => Promise<void>;
|
|
20
|
+
continue: () => Promise<void>;
|
|
21
|
+
setEmailAddress: (val: string) => Promise<void>;
|
|
22
|
+
setPassword: (val: string) => Promise<void>;
|
|
23
|
+
setPasswordConfirmation: (val: string) => Promise<void>;
|
|
24
|
+
enterOtpCode: (code: string, opts?: {
|
|
25
|
+
name?: string;
|
|
26
|
+
awaitRequests?: boolean;
|
|
27
|
+
awaitPrepare?: boolean;
|
|
28
|
+
awaitAttempt?: boolean;
|
|
29
|
+
}) => Promise<void>;
|
|
30
|
+
enterTestOtpCode: (opts?: {
|
|
31
|
+
name?: string;
|
|
32
|
+
awaitRequests?: boolean;
|
|
33
|
+
awaitPrepare?: boolean;
|
|
34
|
+
awaitAttempt?: boolean;
|
|
35
|
+
}) => Promise<void>;
|
|
36
|
+
fillTestOtpCode: (name: string, opts?: Omit<{
|
|
37
|
+
name?: string;
|
|
38
|
+
awaitRequests?: boolean;
|
|
39
|
+
awaitPrepare?: boolean;
|
|
40
|
+
awaitAttempt?: boolean;
|
|
41
|
+
}, "name">) => Promise<void>;
|
|
42
|
+
getIdentifierInput: () => import("@playwright/test").Locator;
|
|
43
|
+
getEmailAddressInput: () => import("@playwright/test").Locator;
|
|
44
|
+
getPhoneNumberInput: () => import("@playwright/test").Locator;
|
|
45
|
+
getUsernameInput: () => import("@playwright/test").Locator;
|
|
46
|
+
getPasswordInput: () => import("@playwright/test").Locator;
|
|
47
|
+
getLegalAccepted: () => import("@playwright/test").Locator;
|
|
48
|
+
getFirstNameInput: () => import("@playwright/test").Locator;
|
|
49
|
+
getLastNameInput: () => import("@playwright/test").Locator;
|
|
50
|
+
waitForSession: () => Promise<import("@playwright/test").JSHandle<boolean>>;
|
|
51
|
+
};
|
|
52
|
+
//# sourceMappingURL=apiKeys.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apiKeys.d.ts","sourceRoot":"","sources":["../../../../../src/playwright/unstable/page-objects/apiKeys.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAG1C,eAAO,MAAM,gCAAgC,GAAI,UAAU;IAAE,IAAI,EAAE,YAAY,CAAA;CAAE;;;;;;;;;;sBA2C3D,MAAM;6BAGC,MAAM;;;oCAUC,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAQzC,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { Page } from '@playwright/test';
|
|
2
|
+
export type EnhancedPage = ReturnType<typeof createAppPageObject>;
|
|
3
|
+
export declare const createAppPageObject: (testArgs: {
|
|
4
|
+
page: Page;
|
|
5
|
+
useTestingToken?: boolean;
|
|
6
|
+
}, app: {
|
|
7
|
+
baseURL?: string;
|
|
8
|
+
}) => Page & {
|
|
9
|
+
goToAppHome: () => Promise<void>;
|
|
10
|
+
goToRelative: (path: string, opts?: {
|
|
11
|
+
waitUntil?: any;
|
|
12
|
+
searchParams?: URLSearchParams;
|
|
13
|
+
timeout?: number;
|
|
14
|
+
}) => Promise<import("@playwright/test").Response | null>;
|
|
15
|
+
waitForClerkJsLoaded: () => Promise<import("@playwright/test").JSHandle<boolean>>;
|
|
16
|
+
signOut: () => Promise<import("@playwright/test").JSHandle<void>>;
|
|
17
|
+
waitForClerkComponentMounted: () => Promise<import("@playwright/test").ElementHandle<SVGElement | HTMLElement>>;
|
|
18
|
+
waitForAppUrl: (relativePath: string) => Promise<void>;
|
|
19
|
+
/**
|
|
20
|
+
* Get the cookies for the URL the page is currently at.
|
|
21
|
+
* Suffixed cookies can be accessed by using the wildcard character `*` at the end of the cookie name,
|
|
22
|
+
* eg `get('__session')` and `get('__session_*')`.
|
|
23
|
+
*/
|
|
24
|
+
cookies: () => Promise<Map<string, import("@playwright/test").Cookie> & {
|
|
25
|
+
raw: () => import("@playwright/test").Cookie[];
|
|
26
|
+
}>;
|
|
27
|
+
};
|
|
28
|
+
//# sourceMappingURL=app.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../../../../../src/playwright/unstable/page-objects/app.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAI7C,MAAM,MAAM,YAAY,GAAG,UAAU,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAClE,eAAO,MAAM,mBAAmB,GAAI,UAAU;IAAE,IAAI,EAAE,IAAI,CAAC;IAAC,eAAe,CAAC,EAAE,OAAO,CAAA;CAAE,EAAE,KAAK;IAAE,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE;;yBAsBtG,MAAM,SACN;QAAE,SAAS,CAAC,EAAE,GAAG,CAAC;QAAC,YAAY,CAAC,EAAE,eAAe,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE;;;;kCAgDzC,MAAM;IAQ1C;;;;OAIG;;;;CAoBN,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { EnhancedPage } from './app';
|
|
2
|
+
export declare const createCheckoutPageObject: (testArgs: {
|
|
3
|
+
page: EnhancedPage;
|
|
4
|
+
}) => {
|
|
5
|
+
waitForMounted: (selector?: string) => Promise<import("@playwright/test").ElementHandle<SVGElement | HTMLElement>>;
|
|
6
|
+
closeDrawer: () => Promise<void>;
|
|
7
|
+
fillTestCard: () => Promise<void>;
|
|
8
|
+
fillCard: (card: {
|
|
9
|
+
number: string;
|
|
10
|
+
expiration: string;
|
|
11
|
+
cvc: string;
|
|
12
|
+
country: string;
|
|
13
|
+
zip: string;
|
|
14
|
+
}) => Promise<void>;
|
|
15
|
+
waitForStripeElements: ({ state }?: {
|
|
16
|
+
state?: "visible" | "hidden";
|
|
17
|
+
}) => Promise<void>;
|
|
18
|
+
clickPayOrSubscribe: () => Promise<void>;
|
|
19
|
+
waitForSubscribeButton: () => Promise<void>;
|
|
20
|
+
confirmAndContinue: () => Promise<void>;
|
|
21
|
+
clickAddPaymentMethod: () => Promise<void>;
|
|
22
|
+
clickPaymentMethods: () => Promise<void>;
|
|
23
|
+
root: import("@playwright/test").Locator;
|
|
24
|
+
continue: () => Promise<void>;
|
|
25
|
+
setEmailAddress: (val: string) => Promise<void>;
|
|
26
|
+
setPassword: (val: string) => Promise<void>;
|
|
27
|
+
setPasswordConfirmation: (val: string) => Promise<void>;
|
|
28
|
+
enterOtpCode: (code: string, opts?: {
|
|
29
|
+
name?: string;
|
|
30
|
+
awaitRequests?: boolean;
|
|
31
|
+
awaitPrepare?: boolean;
|
|
32
|
+
awaitAttempt?: boolean;
|
|
33
|
+
}) => Promise<void>;
|
|
34
|
+
enterTestOtpCode: (opts?: {
|
|
35
|
+
name?: string;
|
|
36
|
+
awaitRequests?: boolean;
|
|
37
|
+
awaitPrepare?: boolean;
|
|
38
|
+
awaitAttempt?: boolean;
|
|
39
|
+
}) => Promise<void>;
|
|
40
|
+
fillTestOtpCode: (name: string, opts?: Omit<{
|
|
41
|
+
name?: string;
|
|
42
|
+
awaitRequests?: boolean;
|
|
43
|
+
awaitPrepare?: boolean;
|
|
44
|
+
awaitAttempt?: boolean;
|
|
45
|
+
}, "name">) => Promise<void>;
|
|
46
|
+
getIdentifierInput: () => import("@playwright/test").Locator;
|
|
47
|
+
getEmailAddressInput: () => import("@playwright/test").Locator;
|
|
48
|
+
getPhoneNumberInput: () => import("@playwright/test").Locator;
|
|
49
|
+
getUsernameInput: () => import("@playwright/test").Locator;
|
|
50
|
+
getPasswordInput: () => import("@playwright/test").Locator;
|
|
51
|
+
getLegalAccepted: () => import("@playwright/test").Locator;
|
|
52
|
+
getFirstNameInput: () => import("@playwright/test").Locator;
|
|
53
|
+
getLastNameInput: () => import("@playwright/test").Locator;
|
|
54
|
+
waitForSession: () => Promise<import("@playwright/test").JSHandle<boolean>>;
|
|
55
|
+
};
|
|
56
|
+
//# sourceMappingURL=checkout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkout.d.ts","sourceRoot":"","sources":["../../../../../src/playwright/unstable/page-objects/checkout.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAG1C,eAAO,MAAM,wBAAwB,GAAI,UAAU;IAAE,IAAI,EAAE,YAAY,CAAA;CAAE;;;;qBAmB9C;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE;wCASnD;QAAE,KAAK,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAA;KAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiCxF,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { EnhancedPage } from './app';
|
|
2
|
+
export declare const createClerkPageObject: ({ page }: {
|
|
3
|
+
page: EnhancedPage;
|
|
4
|
+
}) => {
|
|
5
|
+
toBeLoaded: () => Promise<import("@playwright/test").JSHandle<boolean>>;
|
|
6
|
+
getClientSideActor: () => Promise<import("@clerk/shared/types").ActClaim | null | undefined>;
|
|
7
|
+
toBeLoading: () => Promise<import("@playwright/test").JSHandle<boolean>>;
|
|
8
|
+
toBeReady: () => Promise<import("@playwright/test").JSHandle<boolean>>;
|
|
9
|
+
toBeDegraded: () => Promise<import("@playwright/test").JSHandle<boolean>>;
|
|
10
|
+
getClientSideUser: () => Promise<import("@clerk/shared/types").UserResource | null | undefined>;
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=clerk.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clerk.d.ts","sourceRoot":"","sources":["../../../../../src/playwright/unstable/page-objects/clerk.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAE1C,eAAO,MAAM,qBAAqB,GAAI,UAAU;IAAE,IAAI,EAAE,YAAY,CAAA;CAAE;;;;;;;CAiCrE,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { EnhancedPage } from './app';
|
|
2
|
+
type EnterOtpCodeOptions = {
|
|
3
|
+
name?: string;
|
|
4
|
+
awaitRequests?: boolean;
|
|
5
|
+
awaitPrepare?: boolean;
|
|
6
|
+
awaitAttempt?: boolean;
|
|
7
|
+
};
|
|
8
|
+
export declare const common: ({ page }: {
|
|
9
|
+
page: EnhancedPage;
|
|
10
|
+
}) => {
|
|
11
|
+
continue: () => Promise<void>;
|
|
12
|
+
setEmailAddress: (val: string) => Promise<void>;
|
|
13
|
+
setPassword: (val: string) => Promise<void>;
|
|
14
|
+
setPasswordConfirmation: (val: string) => Promise<void>;
|
|
15
|
+
enterOtpCode: (code: string, opts?: EnterOtpCodeOptions) => Promise<void>;
|
|
16
|
+
enterTestOtpCode: (opts?: EnterOtpCodeOptions) => Promise<void>;
|
|
17
|
+
fillTestOtpCode: (name: string, opts?: Omit<EnterOtpCodeOptions, "name">) => Promise<void>;
|
|
18
|
+
getIdentifierInput: () => import("@playwright/test").Locator;
|
|
19
|
+
getEmailAddressInput: () => import("@playwright/test").Locator;
|
|
20
|
+
getPhoneNumberInput: () => import("@playwright/test").Locator;
|
|
21
|
+
getUsernameInput: () => import("@playwright/test").Locator;
|
|
22
|
+
getPasswordInput: () => import("@playwright/test").Locator;
|
|
23
|
+
getLegalAccepted: () => import("@playwright/test").Locator;
|
|
24
|
+
getFirstNameInput: () => import("@playwright/test").Locator;
|
|
25
|
+
getLastNameInput: () => import("@playwright/test").Locator;
|
|
26
|
+
waitForSession: () => Promise<import("@playwright/test").JSHandle<boolean>>;
|
|
27
|
+
};
|
|
28
|
+
export {};
|
|
29
|
+
//# sourceMappingURL=common.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../../../src/playwright/unstable/page-objects/common.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAE1C,KAAK,mBAAmB,GAAG;IACzB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB,CAAC;AAEF,eAAO,MAAM,MAAM,GAAI,UAAU;IAAE,IAAI,EAAE,YAAY,CAAA;CAAE;;2BAK5B,MAAM;uBAGV,MAAM;mCAGM,MAAM;yBAGV,MAAM,SAAS,mBAAmB;8BAoC7B,mBAAmB;4BAIrB,MAAM,SAAS,IAAI,CAAC,mBAAmB,EAAE,MAAM,CAAC;;;;;;;;;;CAmCjF,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Response } from '@playwright/test';
|
|
2
|
+
import type { EnhancedPage } from './app';
|
|
3
|
+
export declare const createExpectPageObject: ({ page }: {
|
|
4
|
+
page: EnhancedPage;
|
|
5
|
+
}) => {
|
|
6
|
+
toBeHandshake: (res: Response) => Promise<void>;
|
|
7
|
+
toBeSignedOut: (args?: {
|
|
8
|
+
timeOut: number;
|
|
9
|
+
}) => Promise<import("@playwright/test").JSHandle<boolean>>;
|
|
10
|
+
toBeSignedIn: () => Promise<import("@playwright/test").JSHandle<boolean>>;
|
|
11
|
+
toBeSignedInAsActor: () => Promise<import("@playwright/test").JSHandle<boolean>>;
|
|
12
|
+
toHaveResolvedTask: () => Promise<import("@playwright/test").JSHandle<boolean>>;
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=expect.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"expect.d.ts","sourceRoot":"","sources":["../../../../../src/playwright/unstable/page-objects/expect.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAGjD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAE1C,eAAO,MAAM,sBAAsB,GAAI,UAAU;IAAE,IAAI,EAAE,YAAY,CAAA;CAAE;yBAExC,QAAQ;2BAOZ;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE;;;;CAyB7C,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { EnhancedPage } from './app';
|
|
2
|
+
export declare const createImpersonationPageObject: (testArgs: {
|
|
3
|
+
page: EnhancedPage;
|
|
4
|
+
}) => {
|
|
5
|
+
waitForMounted: (selector?: string) => Promise<import("@playwright/test").ElementHandle<SVGElement | HTMLElement>>;
|
|
6
|
+
getSignOutLink: () => import("@playwright/test").Locator;
|
|
7
|
+
};
|
|
8
|
+
//# sourceMappingURL=impersonation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"impersonation.d.ts","sourceRoot":"","sources":["../../../../../src/playwright/unstable/page-objects/impersonation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAE1C,eAAO,MAAM,6BAA6B,GAAI,UAAU;IAAE,IAAI,EAAE,YAAY,CAAA;CAAE;;;CAW7E,CAAC"}
|