@bigbinary/neeto-playwright-commons 1.21.2 → 1.21.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 +31 -58
- package/index.cjs.js.map +1 -1
- package/index.d.ts +18 -28
- package/index.js +31 -58
- package/index.js.map +1 -1
- package/package.json +1 -1
package/index.cjs.js
CHANGED
|
@@ -188841,12 +188841,12 @@ const ROUTES = {
|
|
|
188841
188841
|
dashboard: "/dashboard",
|
|
188842
188842
|
neetoThankYou: "/neeto_thank_you_engine",
|
|
188843
188843
|
adminPanel: {
|
|
188844
|
-
roles: "/admin/admin-panel/roles",
|
|
188845
|
-
index: "/admin/admin-panel",
|
|
188846
|
-
auditLogs: "/admin/admin-panel/audit-logs",
|
|
188847
|
-
apiKeys: "/admin/admin-panel/apiKeys",
|
|
188848
|
-
customDomain: "/admin/admin-panel/custom-domain",
|
|
188849
|
-
ipRestriction: "/admin/admin-panel/ip-restriction",
|
|
188844
|
+
roles: "/admin/general/admin-panel/roles",
|
|
188845
|
+
index: "/admin/general/admin-panel",
|
|
188846
|
+
auditLogs: "/admin/admin-panel/general/audit-logs",
|
|
188847
|
+
apiKeys: "/admin/admin-panel/general/apiKeys",
|
|
188848
|
+
customDomain: "/admin/admin-panel/general/custom-domain",
|
|
188849
|
+
ipRestriction: "/admin/admin-panel/general/ip-restriction",
|
|
188850
188850
|
},
|
|
188851
188851
|
};
|
|
188852
188852
|
const API_ROUTES = {
|
|
@@ -191401,14 +191401,15 @@ class SlackPage extends IntegrationBase {
|
|
|
191401
191401
|
const loginButton = this.page.getByRole("button", {
|
|
191402
191402
|
name: this.t("neetoSlack.slack.connect.loginButton"),
|
|
191403
191403
|
});
|
|
191404
|
+
const allowButton = this.page.getByRole("button", {
|
|
191405
|
+
name: SLACK_WEB_TEXTS.allow,
|
|
191406
|
+
});
|
|
191404
191407
|
if (await loginButton.isVisible()) {
|
|
191405
191408
|
await loginButton.click({ delay: 5000 });
|
|
191406
191409
|
await this.page.waitForURL(RegExp("(.*)slack.com/.*"));
|
|
191407
191410
|
}
|
|
191408
|
-
|
|
191409
|
-
|
|
191410
|
-
});
|
|
191411
|
-
await test$1.expect(allowButton).toBeEnabled({ timeout: 30000 });
|
|
191411
|
+
await this.page.waitForLoadState("domcontentloaded", { timeout: 25000 });
|
|
191412
|
+
await test$1.expect(allowButton).toBeEnabled({ timeout: 45000 });
|
|
191412
191413
|
const currentWorkspace = (await this.page
|
|
191413
191414
|
.locator(SLACK_SELECTORS.teamPicketButtonContent)
|
|
191414
191415
|
.textContent()) || "";
|
|
@@ -191485,6 +191486,7 @@ class SlackPage extends IntegrationBase {
|
|
|
191485
191486
|
ramda.isNotNil(slackLoginPassword) &&
|
|
191486
191487
|
ramda.isNotNil(slackLoginEmail)) {
|
|
191487
191488
|
await slackWebappPage.goto(THIRD_PARTY_ROUTES.slack.loginWithPassword(slackWorkspace), { timeout: 20000 });
|
|
191489
|
+
await slackWebappPage.waitForLoadState("load", { timeout: 25000 });
|
|
191488
191490
|
await slackWebappPage
|
|
191489
191491
|
.locator(SLACK_SELECTORS.loginEmail)
|
|
191490
191492
|
.pressSequentially(slackLoginEmail, { delay: 10 });
|
|
@@ -191492,6 +191494,9 @@ class SlackPage extends IntegrationBase {
|
|
|
191492
191494
|
.locator(SLACK_SELECTORS.loginPassword)
|
|
191493
191495
|
.pressSequentially(slackLoginPassword, { delay: 10 });
|
|
191494
191496
|
await slackWebappPage.locator(SLACK_SELECTORS.signInButton).click();
|
|
191497
|
+
await slackWebappPage.waitForLoadState("domcontentloaded", {
|
|
191498
|
+
timeout: 25000,
|
|
191499
|
+
});
|
|
191495
191500
|
const redirectOpenInBrowser = slackWebappPage.locator(SLACK_SELECTORS.redirectOpenInBrowser);
|
|
191496
191501
|
await test$1.expect(redirectOpenInBrowser).toBeVisible({ timeout: 25000 });
|
|
191497
191502
|
await redirectOpenInBrowser.click();
|
|
@@ -193110,44 +193115,7 @@ class AuditLogsPage {
|
|
|
193110
193115
|
}
|
|
193111
193116
|
|
|
193112
193117
|
class CustomDomainPage {
|
|
193113
|
-
constructor(page, neetoPlaywrightUtilities,
|
|
193114
|
-
) {
|
|
193115
|
-
this.addCustomDomainViaUI = async (domainName) => {
|
|
193116
|
-
const addCustomDomainButton = this.page.getByTestId(CUSTOM_DOMAIN_SELECTORS.addCustomDomainButton);
|
|
193117
|
-
await test$1.expect(addCustomDomainButton).toBeVisible();
|
|
193118
|
-
(await addCustomDomainButton.isDisabled()) &&
|
|
193119
|
-
(await this.deleteCustomDomainViaUI());
|
|
193120
|
-
await addCustomDomainButton.click();
|
|
193121
|
-
await test$1.expect(this.page.getByTestId(COMMON_SELECTORS.paneBody)).toBeVisible();
|
|
193122
|
-
await this.page
|
|
193123
|
-
.getByTestId(CUSTOM_DOMAIN_SELECTORS.customDomainInputField)
|
|
193124
|
-
.fill(domainName);
|
|
193125
|
-
await this.page
|
|
193126
|
-
.getByTestId(CUSTOM_DOMAIN_SELECTORS.submitCustomDomainButton)
|
|
193127
|
-
.click();
|
|
193128
|
-
await Promise.all([
|
|
193129
|
-
test$1.expect(this.page.getByTestId(COMMON_SELECTORS.paneBody).getByText(domainName)).toBeVisible(),
|
|
193130
|
-
test$1.expect(this.page.getByTestId(CUSTOM_DOMAIN_SELECTORS.customDomainValidateButton)).toBeVisible(),
|
|
193131
|
-
]);
|
|
193132
|
-
await this.page.getByTestId(COMMON_SELECTORS.paneModalCrossIcon).click();
|
|
193133
|
-
await Promise.all([
|
|
193134
|
-
test$1.expect(this.page.getByTestId(COMMON_SELECTORS.paneBody)).toBeHidden(),
|
|
193135
|
-
test$1.expect(addCustomDomainButton).toBeDisabled(),
|
|
193136
|
-
test$1.expect(this.page.getByTestId(COMMON_SELECTORS.pendingTagContainer)).toBeVisible(),
|
|
193137
|
-
]);
|
|
193138
|
-
};
|
|
193139
|
-
this.deleteCustomDomainViaUI = async () => {
|
|
193140
|
-
await this.page.getByTestId(CUSTOM_DOMAIN_SELECTORS.dropdownButton).click();
|
|
193141
|
-
await this.page
|
|
193142
|
-
.getByTestId(CUSTOM_DOMAIN_SELECTORS.deleteCustomDomainButton)
|
|
193143
|
-
.click();
|
|
193144
|
-
await test$1.expect(this.page.getByTestId(COMMON_SELECTORS.alertTitle)).toHaveText(this.t("neetoCustomDomains.delete"));
|
|
193145
|
-
await this.page
|
|
193146
|
-
.getByTestId(COMMON_SELECTORS.alertModalSubmitButton)
|
|
193147
|
-
.click();
|
|
193148
|
-
await this.neetoPlaywrightUtilities.verifyToast();
|
|
193149
|
-
await test$1.expect(this.page.getByTestId(COMMON_SELECTORS.noDataTitle)).toBeVisible();
|
|
193150
|
-
};
|
|
193118
|
+
constructor({ browser, page, neetoPlaywrightUtilities, product, }) {
|
|
193151
193119
|
this.getCustomDomain = (newSubdomain) => {
|
|
193152
193120
|
const { subdomainName } = getGlobalUserState();
|
|
193153
193121
|
this.subdomain = newSubdomain !== null && newSubdomain !== void 0 ? newSubdomain : subdomainName;
|
|
@@ -193173,6 +193141,7 @@ class CustomDomainPage {
|
|
|
193173
193141
|
await test$1.expect(async () => {
|
|
193174
193142
|
await validateButton.click();
|
|
193175
193143
|
await this.neetoPlaywrightUtilities.verifyToast({
|
|
193144
|
+
timeout: 15000,
|
|
193176
193145
|
message: this.t("neetoCustomDomains.validation.successMessage"),
|
|
193177
193146
|
});
|
|
193178
193147
|
}).toPass({ timeout: 60000 });
|
|
@@ -193180,13 +193149,14 @@ class CustomDomainPage {
|
|
|
193180
193149
|
await test$1.expect(this.page.getByTestId(CUSTOM_DOMAIN_SELECTORS.activeTagContainer)).toBeVisible();
|
|
193181
193150
|
};
|
|
193182
193151
|
this.loginToCustomDomain = async () => {
|
|
193183
|
-
|
|
193152
|
+
await this.page.close();
|
|
193184
193153
|
const loginPage = this.loginPage;
|
|
193185
193154
|
const { email } = getGlobalUserState();
|
|
193186
193155
|
const loginUrl = `${this.baseURL}${ROUTES.admin}`;
|
|
193187
193156
|
const playwrightUtils = new CustomCommands(loginPage, loginPage.request);
|
|
193188
193157
|
const organizationPage = new OrganizationPage(loginPage, playwrightUtils);
|
|
193189
193158
|
await loginPage.goto(loginUrl);
|
|
193159
|
+
await playwrightUtils.waitForPageLoad();
|
|
193190
193160
|
await organizationPage.loginViaSSO(email);
|
|
193191
193161
|
await test$1.expect(loginPage).toHaveURL(RegExp(loginUrl), { timeout: 15000 });
|
|
193192
193162
|
await playwrightUtils.waitForPageLoad();
|
|
@@ -193211,21 +193181,22 @@ class CustomDomainPage {
|
|
|
193211
193181
|
updateCredentials({ key: "baseUrl", value: this.baseURL });
|
|
193212
193182
|
updateCredentials({ key: "domain", value: CUSTOM_DOMAIN_SUFFIX });
|
|
193213
193183
|
};
|
|
193214
|
-
this.setupCustomDomain = async (
|
|
193184
|
+
this.setupCustomDomain = async () => {
|
|
193215
193185
|
if (shouldSkipCustomDomainSetup())
|
|
193216
193186
|
return;
|
|
193217
|
-
await this.connectCustomDomain(
|
|
193187
|
+
await this.connectCustomDomain();
|
|
193218
193188
|
const context = await this.browser.newContext(EMPTY_STORAGE_STATE);
|
|
193219
193189
|
this.loginPage = await context.newPage();
|
|
193220
193190
|
await this.loginToCustomDomain();
|
|
193221
193191
|
await this.saveCustomDomainState();
|
|
193222
193192
|
};
|
|
193223
|
-
this.connectCustomDomain = async (
|
|
193193
|
+
this.connectCustomDomain = async (subdomain) => {
|
|
193224
193194
|
if (shouldSkipCustomDomainSetup())
|
|
193225
193195
|
return;
|
|
193226
|
-
const baseURL = baseURLGenerator(product, subdomain);
|
|
193196
|
+
const baseURL = baseURLGenerator(this.product, subdomain);
|
|
193227
193197
|
const domain = this.getCustomDomain(subdomain);
|
|
193228
193198
|
this.baseURL = `https://${domain}`;
|
|
193199
|
+
await this.neetoPlaywrightUtilities.waitForPageLoad();
|
|
193229
193200
|
await this.page.goto(`${baseURL}${ROUTES.adminPanel.customDomain}`);
|
|
193230
193201
|
await this.neetoPlaywrightUtilities.waitForPageLoad();
|
|
193231
193202
|
await this.addCustomDomain(domain);
|
|
@@ -193233,10 +193204,11 @@ class CustomDomainPage {
|
|
|
193233
193204
|
process.env.BASE_URL = this.baseURL;
|
|
193234
193205
|
await this.waitForTrustedSSL();
|
|
193235
193206
|
};
|
|
193236
|
-
this.disconnectCustomDomain = async (
|
|
193207
|
+
this.disconnectCustomDomain = async () => {
|
|
193237
193208
|
if (shouldSkipCustomDomainSetup())
|
|
193238
193209
|
return;
|
|
193239
|
-
const baseURL = baseURLGenerator(product, subdomain);
|
|
193210
|
+
const baseURL = baseURLGenerator(this.product, this.subdomain);
|
|
193211
|
+
await this.neetoPlaywrightUtilities.waitForPageLoad();
|
|
193240
193212
|
await this.page.goto(`${baseURL}${ROUTES.adminPanel.customDomain}`);
|
|
193241
193213
|
await this.neetoPlaywrightUtilities.waitForPageLoad();
|
|
193242
193214
|
await this.page.getByTestId(CUSTOM_DOMAIN_SELECTORS.dropdownButton).click();
|
|
@@ -193250,10 +193222,11 @@ class CustomDomainPage {
|
|
|
193250
193222
|
await this.neetoPlaywrightUtilities.verifyToast();
|
|
193251
193223
|
await test$1.expect(this.page.getByTestId(COMMON_SELECTORS.noDataTitle)).toBeVisible();
|
|
193252
193224
|
};
|
|
193253
|
-
this.browser = browser;
|
|
193254
193225
|
this.page = page;
|
|
193255
|
-
this.
|
|
193226
|
+
this.browser = browser;
|
|
193227
|
+
this.product = product;
|
|
193256
193228
|
this.t = playwrightI18nextFixture.getI18nInstance().t;
|
|
193229
|
+
this.neetoPlaywrightUtilities = neetoPlaywrightUtilities;
|
|
193257
193230
|
}
|
|
193258
193231
|
}
|
|
193259
193232
|
|
|
@@ -195482,7 +195455,7 @@ exports.CREDENTIALS = CREDENTIALS;
|
|
|
195482
195455
|
exports.CUSTOM_DOMAIN_SELECTORS = CUSTOM_DOMAIN_SELECTORS;
|
|
195483
195456
|
exports.CUSTOM_DOMAIN_SUFFIX = CUSTOM_DOMAIN_SUFFIX;
|
|
195484
195457
|
exports.CustomCommands = CustomCommands;
|
|
195485
|
-
exports.
|
|
195458
|
+
exports.CustomDomainPage = CustomDomainPage;
|
|
195486
195459
|
exports.DATE_PICKER_SELECTORS = DATE_PICKER_SELECTORS;
|
|
195487
195460
|
exports.DATE_TEXTS = DATE_TEXTS;
|
|
195488
195461
|
exports.DESCRIPTION_EDITOR_TEXTS = DESCRIPTION_EDITOR_TEXTS;
|