@bigbinary/neeto-playwright-commons 1.22.33 → 1.22.35
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 +31 -11
- package/index.cjs.js.map +1 -1
- package/index.d.ts +36 -45
- package/index.js +31 -11
- package/index.js.map +1 -1
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -1886,15 +1886,18 @@ type GooglePageParams = {
|
|
|
1886
1886
|
neetoPlaywrightUtilities: CustomCommands;
|
|
1887
1887
|
integration: string;
|
|
1888
1888
|
integrationRouteIndex?: string;
|
|
1889
|
+
appName?: string;
|
|
1889
1890
|
};
|
|
1890
1891
|
declare class GooglePage extends IntegrationBase {
|
|
1891
1892
|
totp: TOTP;
|
|
1892
1893
|
t: TFunction;
|
|
1894
|
+
appName: string;
|
|
1893
1895
|
constructor({
|
|
1894
1896
|
page,
|
|
1895
1897
|
neetoPlaywrightUtilities,
|
|
1896
1898
|
integration,
|
|
1897
|
-
integrationRouteIndex
|
|
1899
|
+
integrationRouteIndex,
|
|
1900
|
+
appName
|
|
1898
1901
|
}: GooglePageParams);
|
|
1899
1902
|
waitForGoogleAuthURL: () => Promise<void>;
|
|
1900
1903
|
/**
|
|
@@ -1908,7 +1911,7 @@ declare class GooglePage extends IntegrationBase {
|
|
|
1908
1911
|
* await googlePage.connectGoogleAccount("neetoForm");
|
|
1909
1912
|
* @endexample
|
|
1910
1913
|
*/
|
|
1911
|
-
connectGoogleAccount: (appName
|
|
1914
|
+
connectGoogleAccount: (appName?: string) => Promise<void>;
|
|
1912
1915
|
/**
|
|
1913
1916
|
*
|
|
1914
1917
|
* Selects the Google account to be used during the integration. If a verification code is required (e.g., for 2FA), it enters the TOTP code.
|
|
@@ -1920,7 +1923,7 @@ declare class GooglePage extends IntegrationBase {
|
|
|
1920
1923
|
* await googlePage.selectGoogleAccount("neetoForm");
|
|
1921
1924
|
* @endexample
|
|
1922
1925
|
*/
|
|
1923
|
-
selectGoogleAccount: (appName
|
|
1926
|
+
selectGoogleAccount: (appName?: string) => Promise<void>;
|
|
1924
1927
|
/**
|
|
1925
1928
|
*
|
|
1926
1929
|
* Automates the login process to a Google account, filling in the email, password, and handling 2FA (Two-Factor Authentication) via TOTP.
|
|
@@ -1973,13 +1976,29 @@ declare class GooglePage extends IntegrationBase {
|
|
|
1973
1976
|
allowPermissions
|
|
1974
1977
|
}?: Partial<StagingConsentFlowParams>) => Promise<void>;
|
|
1975
1978
|
private handleNotVerifiedPage;
|
|
1979
|
+
/**
|
|
1980
|
+
*
|
|
1981
|
+
* Revokes permissions for the Google integration by navigating to Google's connections page and removing the application connection. This method handles the complete flow of disconnecting the app from Google's side.
|
|
1982
|
+
*
|
|
1983
|
+
* @example
|
|
1984
|
+
*
|
|
1985
|
+
* await googlePage.revokePermissions();
|
|
1986
|
+
* @endexample
|
|
1987
|
+
*/
|
|
1988
|
+
revokePermissions: () => Promise<void>;
|
|
1976
1989
|
}
|
|
1977
1990
|
type AsyncNoArgsFunction = () => Promise<void>;
|
|
1978
1991
|
type RedirectUrl = string | RegExp | ((url: URL) => boolean);
|
|
1979
1992
|
type PartialInterceptMultipleResponsesParams = Partial<InterceptMultipleResponsesParams>;
|
|
1980
1993
|
type UpdateConfigureSlackChannelParams = {
|
|
1981
1994
|
newSlackChannel: string;
|
|
1995
|
+
/**
|
|
1996
|
+
* @deprecated This option is no longer used.
|
|
1997
|
+
*/
|
|
1982
1998
|
interceptMultipleResponsesParams?: PartialInterceptMultipleResponsesParams;
|
|
1999
|
+
/**
|
|
2000
|
+
* @deprecated This option is no longer used.
|
|
2001
|
+
*/
|
|
1983
2002
|
refreshInterceptMultipleResponsesParams?: PartialInterceptMultipleResponsesParams;
|
|
1984
2003
|
refreshChannelList?: boolean;
|
|
1985
2004
|
};
|
|
@@ -2048,10 +2067,6 @@ declare class SlackPage extends IntegrationBase {
|
|
|
2048
2067
|
*
|
|
2049
2068
|
* newSlackChannel: The name of the slack channel to which the update will be applied.
|
|
2050
2069
|
*
|
|
2051
|
-
* interceptMultipleResponsesParams (optional): Parameters for intercepting multiple responses.
|
|
2052
|
-
*
|
|
2053
|
-
* refreshInterceptMultipleResponsesParams (optional): Parameters for refreshing intercepting multiple responses.
|
|
2054
|
-
*
|
|
2055
2070
|
* refreshChannelList (optional): Whether to refresh the channel list.
|
|
2056
2071
|
*
|
|
2057
2072
|
* @example
|
|
@@ -2060,23 +2075,6 @@ declare class SlackPage extends IntegrationBase {
|
|
|
2060
2075
|
* newSlackChannel: "example-channel",
|
|
2061
2076
|
* refreshChannelList: true
|
|
2062
2077
|
* });
|
|
2063
|
-
* //or
|
|
2064
|
-
* await slackPage.updateConfigureSlackChannel({
|
|
2065
|
-
* newSlackChannel: "example-channel",
|
|
2066
|
-
* refreshChannelList: true,
|
|
2067
|
-
* refreshInterceptMultipleResponsesParams:{
|
|
2068
|
-
* responseUrl: "/auth";
|
|
2069
|
-
* times:1;
|
|
2070
|
-
* baseUrl: "https://www.zoom.com";
|
|
2071
|
-
* responseStatus: 200;
|
|
2072
|
-
* },
|
|
2073
|
-
* interceptMultipleResponsesParams:{
|
|
2074
|
-
* responseUrl: "/auth";
|
|
2075
|
-
* times:1;
|
|
2076
|
-
* baseUrl: "https://www.zoom.com";
|
|
2077
|
-
* responseStatus: 200;
|
|
2078
|
-
* }
|
|
2079
|
-
* });
|
|
2080
2078
|
* @endexample
|
|
2081
2079
|
*/
|
|
2082
2080
|
updateConfigureSlackChannel: ({
|
|
@@ -2885,13 +2883,10 @@ declare class TeamMembers {
|
|
|
2885
2883
|
*
|
|
2886
2884
|
* email (required): The email of the member to be searched.
|
|
2887
2885
|
*
|
|
2888
|
-
* interceptOptions (optional): The options to be passed to the waitForMultipleResponse command.
|
|
2889
|
-
*
|
|
2890
2886
|
* @example
|
|
2891
2887
|
*
|
|
2892
2888
|
* await teamMembers.searchAndVerifyMemberByEmail({
|
|
2893
2889
|
* email: "sam@example.com",
|
|
2894
|
-
* interceptOptions: { timeout: 10000, requestCount: 1 },
|
|
2895
2890
|
* });
|
|
2896
2891
|
* @endexample
|
|
2897
2892
|
*/
|
|
@@ -2900,6 +2895,9 @@ declare class TeamMembers {
|
|
|
2900
2895
|
interceptOptions
|
|
2901
2896
|
}: {
|
|
2902
2897
|
email: string;
|
|
2898
|
+
/**
|
|
2899
|
+
* @deprecated This option is no longer used.
|
|
2900
|
+
*/
|
|
2903
2901
|
interceptOptions?: Partial<Omit<InterceptMultipleResponsesParams, "responseUrl">>;
|
|
2904
2902
|
}) => Promise<void>;
|
|
2905
2903
|
/**
|
|
@@ -3978,7 +3976,6 @@ declare class TagsPage {
|
|
|
3978
3976
|
* await tagsPage.addTagViaUI({
|
|
3979
3977
|
* tagName: "tagName",
|
|
3980
3978
|
* addTagsLabel: "Add new tag",
|
|
3981
|
-
* tagsResponseUrl: API_ROUTES.tags.index,
|
|
3982
3979
|
* });
|
|
3983
3980
|
* @endexample
|
|
3984
3981
|
*/
|
|
@@ -3989,6 +3986,9 @@ declare class TagsPage {
|
|
|
3989
3986
|
}: {
|
|
3990
3987
|
tagName: string;
|
|
3991
3988
|
addTagsLabel: string;
|
|
3989
|
+
/**
|
|
3990
|
+
* @deprecated This option is no longer used.
|
|
3991
|
+
*/
|
|
3992
3992
|
tagsResponseUrl?: string;
|
|
3993
3993
|
}) => Promise<void>;
|
|
3994
3994
|
/**
|
|
@@ -4437,6 +4437,7 @@ declare const THIRD_PARTY_ROUTES: {
|
|
|
4437
4437
|
signin: string;
|
|
4438
4438
|
password: string;
|
|
4439
4439
|
totpChallenge: string;
|
|
4440
|
+
connections: string;
|
|
4440
4441
|
challengeSelection: string;
|
|
4441
4442
|
myAccount: string;
|
|
4442
4443
|
chooseAccount: string;
|
|
@@ -4694,6 +4695,7 @@ declare const GOOGLE_LOGIN_TEXTS: {
|
|
|
4694
4695
|
connectYourGoogleAccount: string;
|
|
4695
4696
|
signInWithGoogle: string;
|
|
4696
4697
|
signInHeading: (appName: string) => RegExp;
|
|
4698
|
+
stagingAppName: (appName: string) => string;
|
|
4697
4699
|
continue: string;
|
|
4698
4700
|
selectAll: string;
|
|
4699
4701
|
appNotVerified: string;
|
|
@@ -6957,6 +6959,9 @@ declare const initializeTestData: (product: NeetoProducts) => {
|
|
|
6957
6959
|
};
|
|
6958
6960
|
interface LoginProps {
|
|
6959
6961
|
page: Page;
|
|
6962
|
+
/**
|
|
6963
|
+
* @deprecated This option is no longer used.
|
|
6964
|
+
*/
|
|
6960
6965
|
neetoPlaywrightUtilities: CustomCommands;
|
|
6961
6966
|
loginPath?: string;
|
|
6962
6967
|
}
|
|
@@ -6968,17 +6973,11 @@ interface LoginProps {
|
|
|
6968
6973
|
*
|
|
6969
6974
|
* page: A page object
|
|
6970
6975
|
*
|
|
6971
|
-
* neetoPlaywrightUtilities: An object of type NeetoPlaywrightUtilities
|
|
6972
|
-
*
|
|
6973
6976
|
* @example
|
|
6974
6977
|
*
|
|
6975
6978
|
* import { loginWithoutSSO } from "@bigbinary/neeto-playwright-commons"
|
|
6976
6979
|
*
|
|
6977
|
-
* await loginWithoutSSO({
|
|
6978
|
-
* page,
|
|
6979
|
-
* neetoPlaywrightUtilities,
|
|
6980
|
-
* loginPath:"/home"
|
|
6981
|
-
* })
|
|
6980
|
+
* await loginWithoutSSO({ page, loginPath:"/home" })
|
|
6982
6981
|
* @endexample
|
|
6983
6982
|
*/
|
|
6984
6983
|
declare const loginWithoutSSO: ({
|
|
@@ -6988,25 +6987,17 @@ declare const loginWithoutSSO: ({
|
|
|
6988
6987
|
}: LoginProps) => Promise<void>;
|
|
6989
6988
|
/**
|
|
6990
6989
|
*
|
|
6991
|
-
* Used to Login to App
|
|
6992
|
-
*
|
|
6993
|
-
* Only works in staging environment. It takes the following parameters:
|
|
6990
|
+
* Used to Login to App. Only works in staging environment. It takes the following parameters:
|
|
6994
6991
|
*
|
|
6995
6992
|
* loginPath (optional): The path to which the user should be redirected for login. Default is /
|
|
6996
6993
|
*
|
|
6997
6994
|
* page: A page object
|
|
6998
6995
|
*
|
|
6999
|
-
* neetoPlaywrightUtilities: An object of type NeetoPlaywrightUtilities
|
|
7000
|
-
*
|
|
7001
6996
|
* @example
|
|
7002
6997
|
*
|
|
7003
6998
|
* import { login } from "@bigbinary/neeto-playwright-commons"
|
|
7004
6999
|
*
|
|
7005
|
-
* login({
|
|
7006
|
-
* page,
|
|
7007
|
-
* neetoPlaywrightUtilities,
|
|
7008
|
-
* loginPath:"/home"
|
|
7009
|
-
* })
|
|
7000
|
+
* await login({ page, loginPath:"/home" })
|
|
7010
7001
|
* @endexample
|
|
7011
7002
|
*/
|
|
7012
7003
|
declare const login: ({
|
package/index.js
CHANGED
|
@@ -96,6 +96,7 @@ const THIRD_PARTY_ROUTES = {
|
|
|
96
96
|
signin: "https://accounts.google.com/v3/signin/identifier?hl=en-gb&ifkv=ASKXGp0nW770RS7xin2puSwbGDpGCeaVKDtCgfpEU73fYmhMKbqUjukBQ5x8kdvEVxQ7OvcrnUo8sg&flowName=GlifWebSignIn&flowEntry=ServiceLogin&dsh=S688843923%3A1704795906762870&theme=glif",
|
|
97
97
|
password: "https://accounts.google.com/v3/signin/challenge/pwd",
|
|
98
98
|
totpChallenge: "https://accounts.google.com/v3/signin/challenge/totp",
|
|
99
|
+
connections: "https://myaccount.google.com/connections",
|
|
99
100
|
challengeSelection: "https://accounts.google.com/v3/signin/challenge/selection",
|
|
100
101
|
myAccount: "https://myaccount.google.com/",
|
|
101
102
|
chooseAccount: "accounts.google.com/o/oauth2/auth/oauthchooseaccount",
|
|
@@ -189172,6 +189173,7 @@ const GOOGLE_LOGIN_TEXTS = {
|
|
|
189172
189173
|
connectYourGoogleAccount: "Connect your Google account",
|
|
189173
189174
|
signInWithGoogle: "Sign in with Google",
|
|
189174
189175
|
signInHeading: (appName) => new RegExp(`(You’re signing back in to ${appName}\\.net|Sign in to ${appName}\\.net)`, "i"),
|
|
189176
|
+
stagingAppName: (appName) => `${appName} - Staging`,
|
|
189175
189177
|
continue: "Continue",
|
|
189176
189178
|
selectAll: "Select All",
|
|
189177
189179
|
appNotVerified: "Google hasn’t verified this app",
|
|
@@ -191448,7 +191450,7 @@ class IntegrationBase {
|
|
|
191448
191450
|
}
|
|
191449
191451
|
|
|
191450
191452
|
class GooglePage extends IntegrationBase {
|
|
191451
|
-
constructor({ page, neetoPlaywrightUtilities, integration, integrationRouteIndex, }) {
|
|
191453
|
+
constructor({ page, neetoPlaywrightUtilities, integration, integrationRouteIndex, appName, }) {
|
|
191452
191454
|
var _a;
|
|
191453
191455
|
super({
|
|
191454
191456
|
page,
|
|
@@ -191460,7 +191462,7 @@ class GooglePage extends IntegrationBase {
|
|
|
191460
191462
|
await this.page.waitForLoadState("load", { timeout: 25000 });
|
|
191461
191463
|
await this.page.waitForURL(new RegExp(`${THIRD_PARTY_ROUTES.google.accountchooser}|${THIRD_PARTY_ROUTES.google.chooseAccount}`));
|
|
191462
191464
|
};
|
|
191463
|
-
this.connectGoogleAccount = async (appName) => {
|
|
191465
|
+
this.connectGoogleAccount = async (appName = this.appName) => {
|
|
191464
191466
|
await this.waitForGoogleAuthURL();
|
|
191465
191467
|
await this.selectGoogleAccount(appName);
|
|
191466
191468
|
await this.page.waitForLoadState("load", { timeout: 25000 });
|
|
@@ -191469,7 +191471,7 @@ class GooglePage extends IntegrationBase {
|
|
|
191469
191471
|
.getByRole("button", { name: GOOGLE_LOGIN_TEXTS.allow })
|
|
191470
191472
|
.click();
|
|
191471
191473
|
};
|
|
191472
|
-
this.selectGoogleAccount = async (appName) => {
|
|
191474
|
+
this.selectGoogleAccount = async (appName = this.appName) => {
|
|
191473
191475
|
const chooseAnAccountHeading = this.page.getByText(GOOGLE_LOGIN_TEXTS.chooseAnAccount, { exact: true });
|
|
191474
191476
|
await expect(chooseAnAccountHeading).toBeVisible({ timeout: 10000 });
|
|
191475
191477
|
await this.page
|
|
@@ -191585,11 +191587,28 @@ class GooglePage extends IntegrationBase {
|
|
|
191585
191587
|
name: GOOGLE_LOGIN_TEXTS.backToSafety,
|
|
191586
191588
|
})).toBeHidden({ timeout: 10000 });
|
|
191587
191589
|
};
|
|
191590
|
+
this.revokePermissions = async () => {
|
|
191591
|
+
const stagingAppName = GOOGLE_LOGIN_TEXTS.stagingAppName(this.appName);
|
|
191592
|
+
await this.page.goto(THIRD_PARTY_ROUTES.google.connections);
|
|
191593
|
+
await this.page.waitForLoadState("load", { timeout: 15000 });
|
|
191594
|
+
const app = this.page.getByRole("link", { name: stagingAppName });
|
|
191595
|
+
if (await app.isHidden())
|
|
191596
|
+
return;
|
|
191597
|
+
await app.click();
|
|
191598
|
+
await this.page
|
|
191599
|
+
.getByRole("button", { name: GOOGLE_LOGIN_TEXTS.deleteConnections })
|
|
191600
|
+
.click();
|
|
191601
|
+
await this.page
|
|
191602
|
+
.getByRole("button", { name: GOOGLE_LOGIN_TEXTS.confirm })
|
|
191603
|
+
.click();
|
|
191604
|
+
await expect(this.page.getByText(GOOGLE_LOGIN_TEXTS.noLongerConnected)).toBeVisible();
|
|
191605
|
+
};
|
|
191606
|
+
this.t = getI18nInstance().t;
|
|
191607
|
+
this.appName = appName !== null && appName !== void 0 ? appName : "";
|
|
191588
191608
|
this.totp = initializeTotp({
|
|
191589
191609
|
issuer: "Google",
|
|
191590
191610
|
secret: (_a = process.env.GOOGLE_2FA_SECRET_KEY) !== null && _a !== void 0 ? _a : "",
|
|
191591
191611
|
});
|
|
191592
|
-
this.t = getI18nInstance().t;
|
|
191593
191612
|
}
|
|
191594
191613
|
}
|
|
191595
191614
|
|
|
@@ -192855,6 +192874,9 @@ class TeamMembers {
|
|
|
192855
192874
|
this.addMemberViaUI = async ({ emails = [faker.internet.exampleEmail()], role = "standard", } = {}) => {
|
|
192856
192875
|
await this.page.getByTestId(MEMBER_SELECTORS.newButton).click();
|
|
192857
192876
|
await this.neetoPlaywrightUtilities.waitForPageLoad();
|
|
192877
|
+
const continueButton = this.page.getByTestId(MEMBER_SELECTORS.continueButton);
|
|
192878
|
+
await expect(continueButton).toBeVisible();
|
|
192879
|
+
await expect(continueButton.getByTestId(COMMON_SELECTORS.uiSpinner)).toBeHidden({ timeout: 35000 });
|
|
192858
192880
|
await this.page
|
|
192859
192881
|
.getByTestId(MEMBER_FORM_SELECTORS.emailTextField)
|
|
192860
192882
|
.fill(emails.join(", "));
|
|
@@ -192862,7 +192884,7 @@ class TeamMembers {
|
|
|
192862
192884
|
await this.neetoPlaywrightUtilities.toggleElement({
|
|
192863
192885
|
locator: this.page.getByTestId(MEMBER_SELECTORS.roleLabel(role)),
|
|
192864
192886
|
});
|
|
192865
|
-
await
|
|
192887
|
+
await continueButton.click();
|
|
192866
192888
|
if (IS_STAGING_ENV) {
|
|
192867
192889
|
await this.page
|
|
192868
192890
|
.getByTestId(COMMON_SELECTORS.paneBody)
|
|
@@ -193056,6 +193078,7 @@ neetoPlaywrightUtilities, loginPath = "/", }) => {
|
|
|
193056
193078
|
if (shouldSkipSetupAndTeardown())
|
|
193057
193079
|
return;
|
|
193058
193080
|
await page.goto(loginPath, { timeout: 20000 });
|
|
193081
|
+
await page.waitForLoadState("load", { timeout: 35000 });
|
|
193059
193082
|
await page
|
|
193060
193083
|
.getByTestId(LOGIN_SELECTORS.emailTextField)
|
|
193061
193084
|
.fill(CREDENTIALS.email);
|
|
@@ -193088,9 +193111,7 @@ class OrganizationPage {
|
|
|
193088
193111
|
return `https://${subdomainName}.${appName}.net`;
|
|
193089
193112
|
};
|
|
193090
193113
|
this.createOrganization = async ({ email, businessName, subdomainName, firstName, lastName, appName, }) => {
|
|
193091
|
-
if (!IS_STAGING_ENV)
|
|
193092
|
-
return;
|
|
193093
|
-
if (shouldSkipSetupAndTeardown())
|
|
193114
|
+
if (!IS_STAGING_ENV || shouldSkipSetupAndTeardown())
|
|
193094
193115
|
return;
|
|
193095
193116
|
const defaultOtp = "123456";
|
|
193096
193117
|
const appNameInLowerCase = appName.toLowerCase();
|
|
@@ -193098,6 +193119,7 @@ class OrganizationPage {
|
|
|
193098
193119
|
isNeetoAuth
|
|
193099
193120
|
? await this.page.goto(ROUTES.neetoAuthSignup, { timeout: 20000 })
|
|
193100
193121
|
: await this.page.goto(`${ROUTES.neetoAuthSignup}?redirect_uri=${appNameInLowerCase}.net/admin`, { timeout: 20000 });
|
|
193122
|
+
await this.neetoPlaywrightUtilities.waitForPageLoad();
|
|
193101
193123
|
const submitButton = this.page.getByTestId(SIGNUP_SELECTORS.submitButton);
|
|
193102
193124
|
await this.page.getByTestId(SIGNUP_SELECTORS.emailTextField).fill(email);
|
|
193103
193125
|
await submitButton.click();
|
|
@@ -193121,9 +193143,7 @@ class OrganizationPage {
|
|
|
193121
193143
|
});
|
|
193122
193144
|
};
|
|
193123
193145
|
this.setupOrganization = async (product) => {
|
|
193124
|
-
if (!IS_STAGING_ENV)
|
|
193125
|
-
return;
|
|
193126
|
-
if (shouldSkipSetupAndTeardown())
|
|
193146
|
+
if (!IS_STAGING_ENV || shouldSkipSetupAndTeardown())
|
|
193127
193147
|
return;
|
|
193128
193148
|
const { user } = readFileSyncIfExists();
|
|
193129
193149
|
await this.createOrganization({
|