@bigbinary/neeto-playwright-commons 1.26.9 → 1.26.11
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 +28 -30
- package/index.cjs.js.map +1 -1
- package/index.d.ts +3 -0
- package/index.js +28 -30
- package/index.js.map +1 -1
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -3937,6 +3937,8 @@ declare class OrganizationPage {
|
|
|
3937
3937
|
* @endexample
|
|
3938
3938
|
*/
|
|
3939
3939
|
baseUrlGenerator: (appName: string) => string;
|
|
3940
|
+
private fillOTP;
|
|
3941
|
+
private submitEmail;
|
|
3940
3942
|
/**
|
|
3941
3943
|
*
|
|
3942
3944
|
* Used to create a new organization. It takes the following parameters:
|
|
@@ -6674,6 +6676,7 @@ declare const SIGNUP_SELECTORS: {
|
|
|
6674
6676
|
signupViaEmailButton: string;
|
|
6675
6677
|
submitButton: string;
|
|
6676
6678
|
subdomainNameTextField: string;
|
|
6679
|
+
subdomainAvailabilityMsg: string;
|
|
6677
6680
|
subdomainError: string;
|
|
6678
6681
|
tryFreeButton: string;
|
|
6679
6682
|
/** @deprecated Use unregisteredEmailError instead. */
|
package/index.js
CHANGED
|
@@ -5296,6 +5296,7 @@ const SIGNUP_SELECTORS = {
|
|
|
5296
5296
|
signupViaEmailButton: "signup-via-email-button",
|
|
5297
5297
|
submitButton: "signup-email-submit-button",
|
|
5298
5298
|
subdomainNameTextField: "signup-organization-subdomain-text-field",
|
|
5299
|
+
subdomainAvailabilityMsg: "subdomain-availability-message",
|
|
5299
5300
|
subdomainError: "subdomain-input-error",
|
|
5300
5301
|
tryFreeButton: "neeto-auth-signup-link",
|
|
5301
5302
|
/** @deprecated Use unregisteredEmailError instead. */
|
|
@@ -116419,7 +116420,7 @@ class GooglePage extends IntegrationBase {
|
|
|
116419
116420
|
.click();
|
|
116420
116421
|
await this.page.waitForLoadState("load", { timeout: 25000 });
|
|
116421
116422
|
await this.page.waitForURL(new RegExp(THIRD_PARTY_ROUTES.google.password));
|
|
116422
|
-
await expect(this.page.getByText(GOOGLE_LOGIN_TEXTS.showPassword)).toBeVisible();
|
|
116423
|
+
await expect(this.page.getByText(GOOGLE_LOGIN_TEXTS.showPassword)).toBeVisible({ timeout: 10000 });
|
|
116423
116424
|
await this.page
|
|
116424
116425
|
.getByLabel(GOOGLE_LOGIN_TEXTS.enterYourPassword)
|
|
116425
116426
|
.pressSequentially(process.env.GOOGLE_LOGIN_PASSWORD, { delay: 10 });
|
|
@@ -116438,7 +116439,7 @@ class GooglePage extends IntegrationBase {
|
|
|
116438
116439
|
level: 2,
|
|
116439
116440
|
exact: true,
|
|
116440
116441
|
});
|
|
116441
|
-
await expect(twoStepVerification).toBeVisible();
|
|
116442
|
+
await expect(twoStepVerification).toBeVisible({ timeout: 15000 });
|
|
116442
116443
|
await this.enterTotpCode(twoStepVerification);
|
|
116443
116444
|
await this.page.waitForLoadState("load", { timeout: 25000 });
|
|
116444
116445
|
await this.page.waitForURL(new RegExp(THIRD_PARTY_ROUTES.google.myAccount));
|
|
@@ -118485,22 +118486,29 @@ class OrganizationPage {
|
|
|
118485
118486
|
const { subdomainName } = getGlobalUserState();
|
|
118486
118487
|
return `https://${subdomainName}.${appName}.net`;
|
|
118487
118488
|
};
|
|
118489
|
+
this.fillOTP = async (otp = faker.string.numeric(6)) => {
|
|
118490
|
+
await this.neetoPlaywrightUtilities.waitForPageLoad();
|
|
118491
|
+
const otpTextBox = this.page.getByTestId(SIGNUP_SELECTORS.otpTextBox);
|
|
118492
|
+
await otpTextBox.fill(otp);
|
|
118493
|
+
await expect(otpTextBox).toBeHidden({ timeout: 35000 });
|
|
118494
|
+
};
|
|
118495
|
+
this.submitEmail = async (email) => {
|
|
118496
|
+
await this.neetoPlaywrightUtilities.waitForPageLoad();
|
|
118497
|
+
await this.page.getByTestId(SIGNUP_SELECTORS.emailTextField).fill(email);
|
|
118498
|
+
const submitButton = this.page.getByTestId(SIGNUP_SELECTORS.submitButton);
|
|
118499
|
+
await submitButton.click();
|
|
118500
|
+
await expect(submitButton).toBeHidden({ timeout: 35000 });
|
|
118501
|
+
};
|
|
118488
118502
|
this.createOrganization = async ({ email, businessName, subdomainName, firstName, lastName, appName, }) => {
|
|
118489
118503
|
if (!IS_STAGING_ENV || shouldSkipSetupAndTeardown())
|
|
118490
118504
|
return;
|
|
118491
|
-
const defaultOtp = "123456";
|
|
118492
118505
|
const appNameInLowerCase = appName.toLowerCase();
|
|
118493
118506
|
const isNeetoAuth = appNameInLowerCase === "neetoauth";
|
|
118494
118507
|
isNeetoAuth
|
|
118495
118508
|
? await this.page.goto(ROUTES.neetoAuthSignup, { timeout: 20000 })
|
|
118496
118509
|
: await this.page.goto(`${ROUTES.neetoAuthSignup}?redirect_uri=${appNameInLowerCase}.net/admin`, { timeout: 20000 });
|
|
118497
|
-
await this.
|
|
118498
|
-
|
|
118499
|
-
await this.page.getByTestId(SIGNUP_SELECTORS.emailTextField).fill(email);
|
|
118500
|
-
await submitButton.click();
|
|
118501
|
-
await expect(submitButton).toBeHidden({ timeout: 30000 });
|
|
118502
|
-
await this.neetoPlaywrightUtilities.waitForPageLoad();
|
|
118503
|
-
await this.page.getByTestId(SIGNUP_SELECTORS.otpTextBox).fill(defaultOtp);
|
|
118510
|
+
await this.submitEmail(email);
|
|
118511
|
+
await this.fillOTP();
|
|
118504
118512
|
await this.fillOrganizationDetails({
|
|
118505
118513
|
credentials: {
|
|
118506
118514
|
firstName,
|
|
@@ -118574,6 +118582,7 @@ class OrganizationPage {
|
|
|
118574
118582
|
}
|
|
118575
118583
|
};
|
|
118576
118584
|
this.fillEmailAndSubmit = async (email, loginTimeout) => {
|
|
118585
|
+
await this.neetoPlaywrightUtilities.waitForPageLoad();
|
|
118577
118586
|
await this.page.getByTestId(LOGIN_SELECTORS.emailTextField).fill(email);
|
|
118578
118587
|
const unregisteredEmailError = this.page.getByTestId(SIGNUP_SELECTORS.unregisteredEmailError);
|
|
118579
118588
|
await expect(async () => {
|
|
@@ -118584,19 +118593,15 @@ class OrganizationPage {
|
|
|
118584
118593
|
};
|
|
118585
118594
|
this.loginViaSSO = async (email = generateRandomBypassEmail(), loginTimeout = 2 * 60 * 1000) => {
|
|
118586
118595
|
await this.fillEmailAndSubmit(email, loginTimeout);
|
|
118587
|
-
await this.
|
|
118588
|
-
.getByTestId(SIGNUP_SELECTORS.otpTextBox)
|
|
118589
|
-
.fill(faker.string.numeric(6));
|
|
118596
|
+
await this.fillOTP();
|
|
118590
118597
|
};
|
|
118591
118598
|
this.loginWithFastmailEmail = async ({ email, loginTimeout = 2 * 60 * 1000, fetchOtpFromEmail, }) => {
|
|
118592
118599
|
await this.fillEmailAndSubmit(email, loginTimeout);
|
|
118593
|
-
const otp = await fetchOtpFromEmail({
|
|
118594
|
-
|
|
118595
|
-
timeout: 4 * 60 * 1000,
|
|
118596
|
-
});
|
|
118597
|
-
await this.page.getByTestId(SIGNUP_SELECTORS.otpTextBox).fill(otp);
|
|
118600
|
+
const otp = await fetchOtpFromEmail({ email, timeout: 4 * 60 * 1000 });
|
|
118601
|
+
await this.fillOTP(otp);
|
|
118598
118602
|
};
|
|
118599
118603
|
this.setupProfile = async ({ firstName = faker.person.firstName(), lastName = faker.person.lastName(), country, } = {}) => {
|
|
118604
|
+
await this.neetoPlaywrightUtilities.waitForPageLoad();
|
|
118600
118605
|
await this.page
|
|
118601
118606
|
.getByTestId(SIGNUP_SELECTORS.firstNameTextField)
|
|
118602
118607
|
.fill(firstName);
|
|
@@ -118626,19 +118631,14 @@ class OrganizationPage {
|
|
|
118626
118631
|
this.signUp = async ({ credentials, fetchOtpFromEmail, appName, }) => {
|
|
118627
118632
|
let otp = "123456";
|
|
118628
118633
|
await this.page.goto(`${ROUTES.neetoAuthSignup}?redirect_uri=${credentials.domain}`, { timeout: 20000 });
|
|
118629
|
-
await this.
|
|
118630
|
-
.getByTestId(SIGNUP_SELECTORS.emailTextField)
|
|
118631
|
-
.fill(credentials.email);
|
|
118632
|
-
const submitButton = this.page.getByTestId(SIGNUP_SELECTORS.submitButton);
|
|
118633
|
-
await submitButton.click();
|
|
118634
|
-
await expect(submitButton).toBeHidden({ timeout: 10000 });
|
|
118634
|
+
await this.submitEmail(credentials.email);
|
|
118635
118635
|
if (fetchOtpFromEmail !== undefined) {
|
|
118636
118636
|
otp = await fetchOtpFromEmail({
|
|
118637
118637
|
email: credentials.email,
|
|
118638
118638
|
timeout: 4 * 60 * 1000,
|
|
118639
118639
|
});
|
|
118640
118640
|
}
|
|
118641
|
-
await this.
|
|
118641
|
+
await this.fillOTP(otp);
|
|
118642
118642
|
await this.fillOrganizationDetails({
|
|
118643
118643
|
credentials,
|
|
118644
118644
|
appName,
|
|
@@ -118650,6 +118650,7 @@ class OrganizationPage {
|
|
|
118650
118650
|
this.fillOrganizationDetails = async ({ credentials, appName, }) => {
|
|
118651
118651
|
const subdomainError = this.page.getByTestId(SIGNUP_SELECTORS.subdomainError);
|
|
118652
118652
|
const organizationSubmitButton = this.page.getByTestId(SIGNUP_SELECTORS.organizationSubmitButton);
|
|
118653
|
+
await this.neetoPlaywrightUtilities.waitForPageLoad();
|
|
118653
118654
|
await this.page
|
|
118654
118655
|
.getByTestId(SIGNUP_SELECTORS.organizationNameTextField)
|
|
118655
118656
|
.fill(humanize(credentials.businessName));
|
|
@@ -118658,10 +118659,7 @@ class OrganizationPage {
|
|
|
118658
118659
|
.fill(credentials.subdomainName);
|
|
118659
118660
|
const subdomainErrorCount = await subdomainError.count();
|
|
118660
118661
|
subdomainErrorCount !== 0 && (await this.updateSubdomainIfExists(appName));
|
|
118661
|
-
|
|
118662
|
-
await expect(this.page.getByTitle(ORGANIZATION_TEXTS.subdomainAvailable)).toBeVisible({
|
|
118663
|
-
timeout: 45000,
|
|
118664
|
-
});
|
|
118662
|
+
await expect(this.page.getByTestId(SIGNUP_SELECTORS.subdomainAvailabilityMsg)).toBeVisible({ timeout: 45000 });
|
|
118665
118663
|
await organizationSubmitButton.click();
|
|
118666
118664
|
await Promise.all([
|
|
118667
118665
|
expect(organizationSubmitButton).toBeHidden({ timeout: 45 * 1000 }),
|
|
@@ -118843,7 +118841,7 @@ class CustomDomainPage {
|
|
|
118843
118841
|
await this.neetoPlaywrightUtilities.verifyToast({
|
|
118844
118842
|
message: this.t("neetoCustomDomains.validation.successMessage"),
|
|
118845
118843
|
});
|
|
118846
|
-
}).toPass({ timeout: 60000 });
|
|
118844
|
+
}).toPass({ timeout: 2 * 60000 });
|
|
118847
118845
|
if (isCertificateLimitExceeded) {
|
|
118848
118846
|
test$1.skip(true, CERTIFICATE_LIMIT_EXCEEDED_MESSAGE);
|
|
118849
118847
|
return;
|