@bigbinary/neeto-playwright-commons 2.2.1 → 2.2.3
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/index.cjs.js +69 -0
- package/index.cjs.js.map +1 -1
- package/index.d.ts +2 -0
- package/index.js +69 -0
- package/index.js.map +1 -1
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -4450,6 +4450,7 @@ declare class OrganizationPage {
|
|
|
4450
4450
|
constructor(page: Page, neetoPlaywrightUtilities: CustomCommands);
|
|
4451
4451
|
private fillOTP;
|
|
4452
4452
|
private submitEmail;
|
|
4453
|
+
private dismissAuthenticatorSetupPromptIfPresent;
|
|
4453
4454
|
/**
|
|
4454
4455
|
*
|
|
4455
4456
|
* Used to create a new organization. It takes the following parameters:
|
|
@@ -6931,6 +6932,7 @@ declare const LOGIN_SELECTORS: {
|
|
|
6931
6932
|
twitterAuthenticationButton: string;
|
|
6932
6933
|
authenticatorAppOtpInput: string;
|
|
6933
6934
|
enterOtpInputError: string;
|
|
6935
|
+
authenticatorAppLaterButton: string;
|
|
6934
6936
|
};
|
|
6935
6937
|
/**
|
|
6936
6938
|
*
|
package/index.js
CHANGED
|
@@ -5412,6 +5412,7 @@ const LOGIN_SELECTORS = {
|
|
|
5412
5412
|
twitterAuthenticationButton: "twitter-authentication-button",
|
|
5413
5413
|
authenticatorAppOtpInput: "authenticator-app-otp-login-code-input",
|
|
5414
5414
|
enterOtpInputError: "enter-otp-input-error",
|
|
5415
|
+
authenticatorAppLaterButton: "authenticator-app-promo-later-button",
|
|
5415
5416
|
};
|
|
5416
5417
|
|
|
5417
5418
|
const MEMBER_SELECTORS = {
|
|
@@ -8540,6 +8541,10 @@ class OrganizationPage {
|
|
|
8540
8541
|
await submitButton.click();
|
|
8541
8542
|
await expect(submitButton).toBeHidden({ timeout: 35_000 });
|
|
8542
8543
|
};
|
|
8544
|
+
dismissAuthenticatorSetupPromptIfPresent = async () => {
|
|
8545
|
+
const maybeLaterButton = this.page.getByTestId(LOGIN_SELECTORS.authenticatorAppLaterButton);
|
|
8546
|
+
(await maybeLaterButton.isVisible()) && (await maybeLaterButton.click());
|
|
8547
|
+
};
|
|
8543
8548
|
createOrganization = async ({ email, businessName, subdomainName, firstName, lastName, appName, }) => {
|
|
8544
8549
|
if (shouldSkipSetupAndTeardown())
|
|
8545
8550
|
return;
|
|
@@ -8683,11 +8688,13 @@ class OrganizationPage {
|
|
|
8683
8688
|
}
|
|
8684
8689
|
await this.fillEmailAndSubmit(email, loginTimeout);
|
|
8685
8690
|
await this.fillOTP();
|
|
8691
|
+
await this.dismissAuthenticatorSetupPromptIfPresent();
|
|
8686
8692
|
};
|
|
8687
8693
|
loginWithFastmailEmail = async ({ email, loginTimeout = 2 * 60 * 1000, fetchOtpFromEmail, }) => {
|
|
8688
8694
|
await this.fillEmailAndSubmit(email, loginTimeout);
|
|
8689
8695
|
const otp = await fetchOtpFromEmail({ email, timeout: 4 * 60 * 1000 });
|
|
8690
8696
|
await this.fillOTP(otp);
|
|
8697
|
+
await this.dismissAuthenticatorSetupPromptIfPresent();
|
|
8691
8698
|
};
|
|
8692
8699
|
setupProfile = async ({ firstName = faker.person.firstName(), lastName = faker.person.lastName(), country, } = {}) => {
|
|
8693
8700
|
if (IS_DEV_ENV)
|
|
@@ -125691,6 +125698,66 @@ function requireMain () {
|
|
|
125691
125698
|
var mainExports = requireMain();
|
|
125692
125699
|
var dotenvExpand = /*@__PURE__*/getDefaultExportFromCjs(mainExports);
|
|
125693
125700
|
|
|
125701
|
+
const E2E_TEST_DIR = "e2e/tests";
|
|
125702
|
+
const LOG_PREFIX = "[playwright.config]";
|
|
125703
|
+
const logInfo = (message) => process.stdout.write(`${LOG_PREFIX} ${message}\n`);
|
|
125704
|
+
const logError = (message) => process.stderr.write(`${LOG_PREFIX} ${message}\n`);
|
|
125705
|
+
/**
|
|
125706
|
+
* Patterns are often anchored for paths under `e2e/tests`, but Playwright
|
|
125707
|
+
* matches `testMatch` against absolute paths — so we also allow the same
|
|
125708
|
+
* pattern after any path ending in `/e2e/tests/`.
|
|
125709
|
+
*/
|
|
125710
|
+
const normalizeSpecPattern = (pattern) => {
|
|
125711
|
+
if (!pattern.startsWith("^") || pattern.includes(E2E_TEST_DIR)) {
|
|
125712
|
+
return pattern;
|
|
125713
|
+
}
|
|
125714
|
+
return `(?:${pattern}|^.*\\/${E2E_TEST_DIR}\\/${pattern.slice(1)})`;
|
|
125715
|
+
};
|
|
125716
|
+
const compilePatterns = (patternStrings) => patternStrings.flatMap((pattern, index) => {
|
|
125717
|
+
const normalized = normalizeSpecPattern(pattern);
|
|
125718
|
+
try {
|
|
125719
|
+
return [new RegExp(normalized)];
|
|
125720
|
+
}
|
|
125721
|
+
catch (error) {
|
|
125722
|
+
logError(`Failed to compile spec pattern at index ${index}: ${pattern}. Normalized pattern: ${normalized}. ${error}`);
|
|
125723
|
+
return [];
|
|
125724
|
+
}
|
|
125725
|
+
});
|
|
125726
|
+
const parseSpecPatterns = () => {
|
|
125727
|
+
let parsed;
|
|
125728
|
+
const raw = process.env.PLAYWRIGHT_SPEC_PATTERNS_JSON?.trim();
|
|
125729
|
+
if (!raw) {
|
|
125730
|
+
logInfo("PLAYWRIGHT_SPEC_PATTERNS_JSON missing; using default test discovery.");
|
|
125731
|
+
return undefined;
|
|
125732
|
+
}
|
|
125733
|
+
logInfo(`PLAYWRIGHT_SPEC_PATTERNS_JSON received: ${raw}`);
|
|
125734
|
+
try {
|
|
125735
|
+
parsed = JSON.parse(raw);
|
|
125736
|
+
}
|
|
125737
|
+
catch (error) {
|
|
125738
|
+
logError(`Failed to parse PLAYWRIGHT_SPEC_PATTERNS_JSON; using default test discovery. ${error}`);
|
|
125739
|
+
return undefined;
|
|
125740
|
+
}
|
|
125741
|
+
if (!Array.isArray(parsed) || parsed.length === 0) {
|
|
125742
|
+
logError("Parsed spec patterns are empty or non-array; using default test discovery.");
|
|
125743
|
+
return undefined;
|
|
125744
|
+
}
|
|
125745
|
+
const patternStrings = parsed.filter((p) => typeof p === "string");
|
|
125746
|
+
if (patternStrings.length !== parsed.length) {
|
|
125747
|
+
logError(`Parsed spec patterns contain non-strings (${parsed.length - patternStrings.length}); using default test discovery.`);
|
|
125748
|
+
return undefined;
|
|
125749
|
+
}
|
|
125750
|
+
const compiledPatterns = compilePatterns(patternStrings);
|
|
125751
|
+
if (compiledPatterns.length === 0) {
|
|
125752
|
+
logError("No valid regex patterns compiled; using default test discovery.");
|
|
125753
|
+
return undefined;
|
|
125754
|
+
}
|
|
125755
|
+
logInfo(`Compiled spec regex patterns: ${compiledPatterns
|
|
125756
|
+
.map(pattern => pattern.toString())
|
|
125757
|
+
.join(", ")}`);
|
|
125758
|
+
return compiledPatterns;
|
|
125759
|
+
};
|
|
125760
|
+
|
|
125694
125761
|
// @ts-check
|
|
125695
125762
|
const loadEnv = (path) => dotenvExpand.expand(dotenv.config({ path, quiet: true }));
|
|
125696
125763
|
const envBasePath = "./e2e/config/.env";
|
|
@@ -125780,6 +125847,7 @@ const definePlaywrightConfig = (overrides) => {
|
|
|
125780
125847
|
],
|
|
125781
125848
|
];
|
|
125782
125849
|
}
|
|
125850
|
+
const specPatterns = parseSpecPatterns();
|
|
125783
125851
|
return defineConfig({
|
|
125784
125852
|
testDir: "./e2e/tests",
|
|
125785
125853
|
fullyParallel: true,
|
|
@@ -125788,6 +125856,7 @@ const definePlaywrightConfig = (overrides) => {
|
|
|
125788
125856
|
timeout: 5 * 60 * 1000,
|
|
125789
125857
|
workers: isCI ? 6 : 5,
|
|
125790
125858
|
reporter: isCI ? reporter : [["line"]],
|
|
125859
|
+
...(specPatterns && { testMatch: specPatterns }),
|
|
125791
125860
|
...(IS_DEV_ENV && {
|
|
125792
125861
|
webServer: [
|
|
125793
125862
|
{
|