@bigbinary/neeto-playwright-commons 1.26.20 → 1.26.22
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 +39 -0
- package/index.cjs.js.map +1 -1
- package/index.d.ts +20 -2
- package/index.js +39 -1
- package/index.js.map +1 -1
- package/package.json +3 -2
package/index.cjs.js
CHANGED
|
@@ -308,6 +308,7 @@ const ENVIRONMENT = {
|
|
|
308
308
|
const EXAMPLE_URL = "https://example.com";
|
|
309
309
|
const IS_STAGING_ENV = process.env.TEST_ENV === ENVIRONMENT.staging;
|
|
310
310
|
const IS_DEV_ENV = process.env.TEST_ENV === ENVIRONMENT.development;
|
|
311
|
+
const DEFAULT_WEBHOOKS_RESPONSE_TEXT = JSON.stringify({ success: true });
|
|
311
312
|
const STORAGE_STATE = "./e2e/auth/user.json";
|
|
312
313
|
const GLOBAL_TRANSLATIONS_PATTERN = "../node_modules/@bigbinary/**/translations/en.json";
|
|
313
314
|
const PROJECT_TRANSLATIONS_PATH = "../app/javascript/src/translations/en.json";
|
|
@@ -423,6 +424,9 @@ class WebhookSiteApi {
|
|
|
423
424
|
this.WEBHOOK_SITE_BASE_URL = "https://webhook.site/token";
|
|
424
425
|
this.create = () => this.request.post(this.WEBHOOK_SITE_BASE_URL);
|
|
425
426
|
this.fetch = (token) => this.request.get(`${this.WEBHOOK_SITE_BASE_URL}/${token}/request/latest`);
|
|
427
|
+
this.configure = (tokenId, content = DEFAULT_WEBHOOKS_RESPONSE_TEXT) => this.request.put(`${THIRD_PARTY_ROUTES.webhooks.site}token/${tokenId}`, {
|
|
428
|
+
data: neetoCist.keysToSnakeCase({ defaultContent: content }),
|
|
429
|
+
});
|
|
426
430
|
}
|
|
427
431
|
}
|
|
428
432
|
|
|
@@ -4847,6 +4851,7 @@ const THANK_YOU_SELECTORS = {
|
|
|
4847
4851
|
previewImage: "preview-image",
|
|
4848
4852
|
thankYouMessageEditor: "thank-you-message-editor",
|
|
4849
4853
|
thankYouMessageWrapper: "thank-you-message-wrapper",
|
|
4854
|
+
countLabel: "thank-you-pages-count",
|
|
4850
4855
|
};
|
|
4851
4856
|
|
|
4852
4857
|
const generateStagingData = (product = "invoice") => {
|
|
@@ -5556,6 +5561,9 @@ const TABLE_SELECTORS = {
|
|
|
5556
5561
|
hideButton: "hide-column-menu-button",
|
|
5557
5562
|
columnHeaderTitle: (columnName) => `${neetoCist.hyphenate(columnName)}-header-title`,
|
|
5558
5563
|
columnMenuButton: "column-menu-button",
|
|
5564
|
+
columnInfoIcon: "column-info-icon",
|
|
5565
|
+
columnMenuBtn: (action) => `${action}-column-menu-button`,
|
|
5566
|
+
moveColumnBtn: (position) => `move-column-${position}-menu-button`,
|
|
5559
5567
|
};
|
|
5560
5568
|
|
|
5561
5569
|
const THEMES_SELECTORS = {
|
|
@@ -5584,6 +5592,7 @@ const CUSTOM_DOMAIN_SELECTORS = {
|
|
|
5584
5592
|
nameInputError: "domain-name-input-error",
|
|
5585
5593
|
};
|
|
5586
5594
|
const API_KEYS_SELECTORS = {
|
|
5595
|
+
countLabel: "api-keys-count",
|
|
5587
5596
|
editApiKeyButton: "api-key-edit-button",
|
|
5588
5597
|
deleteApiKeyButton: "api-key-delete-button",
|
|
5589
5598
|
addApiKeyButton: "add-api-key-button",
|
|
@@ -118841,6 +118850,27 @@ class OrganizationPage {
|
|
|
118841
118850
|
await this.page.getByTestId(COMMON_SELECTORS.selectOption(country)).click();
|
|
118842
118851
|
await test.expect(countrySelector).toContainText(country);
|
|
118843
118852
|
};
|
|
118853
|
+
this.loginViaGoogleAuth = async () => {
|
|
118854
|
+
const googlePage = new GooglePage({
|
|
118855
|
+
neetoPlaywrightUtilities: this.neetoPlaywrightUtilities,
|
|
118856
|
+
page: this.page,
|
|
118857
|
+
integration: "google",
|
|
118858
|
+
});
|
|
118859
|
+
const heading = this.page.getByText(GOOGLE_LOGIN_TEXTS.chooseAnAccount, {
|
|
118860
|
+
exact: true,
|
|
118861
|
+
});
|
|
118862
|
+
await this.page
|
|
118863
|
+
.getByTestId(LOGIN_SELECTORS.googleAuthenticationButton)
|
|
118864
|
+
.click();
|
|
118865
|
+
await test.expect(heading).toBeVisible({ timeout: 10000 });
|
|
118866
|
+
await this.page
|
|
118867
|
+
.getByRole("link", { name: GOOGLE_LOGIN_TEXTS.neetoAutomation })
|
|
118868
|
+
.click();
|
|
118869
|
+
await test.expect(heading).toBeHidden({ timeout: 10000 });
|
|
118870
|
+
this.page.url().includes(THIRD_PARTY_ROUTES.google.totpChallenge) &&
|
|
118871
|
+
(await googlePage.enterTotpCode());
|
|
118872
|
+
await this.page.waitForLoadState();
|
|
118873
|
+
};
|
|
118844
118874
|
this.page = page;
|
|
118845
118875
|
this.neetoPlaywrightUtilities = neetoPlaywrightUtilities;
|
|
118846
118876
|
}
|
|
@@ -124827,6 +124857,14 @@ const definePlaywrightConfig = (overrides) => {
|
|
|
124827
124857
|
},
|
|
124828
124858
|
dependencies: ["setup"],
|
|
124829
124859
|
},
|
|
124860
|
+
{
|
|
124861
|
+
name: "webkit",
|
|
124862
|
+
use: {
|
|
124863
|
+
...test.devices["Desktop Safari"],
|
|
124864
|
+
storageState: STORAGE_STATE,
|
|
124865
|
+
},
|
|
124866
|
+
dependencies: ["setup"],
|
|
124867
|
+
},
|
|
124830
124868
|
{
|
|
124831
124869
|
name: "lighthouse-audits",
|
|
124832
124870
|
testDir: "e2e/lighthouse-audits",
|
|
@@ -124869,6 +124907,7 @@ exports.CustomDomainPage = CustomDomainPage;
|
|
|
124869
124907
|
exports.DATE_PICKER_SELECTORS = DATE_PICKER_SELECTORS;
|
|
124870
124908
|
exports.DATE_RANGES = DATE_RANGES;
|
|
124871
124909
|
exports.DATE_TEXTS = DATE_TEXTS;
|
|
124910
|
+
exports.DEFAULT_WEBHOOKS_RESPONSE_TEXT = DEFAULT_WEBHOOKS_RESPONSE_TEXT;
|
|
124872
124911
|
exports.DESCRIPTION_EDITOR_TEXTS = DESCRIPTION_EDITOR_TEXTS;
|
|
124873
124912
|
exports.EMBED_SELECTORS = EMBED_SELECTORS;
|
|
124874
124913
|
exports.EMOJI_LABEL = EMOJI_LABEL;
|