@bigbinary/neeto-playwright-commons 1.26.20 → 1.26.21

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 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
  }
@@ -124869,6 +124899,7 @@ exports.CustomDomainPage = CustomDomainPage;
124869
124899
  exports.DATE_PICKER_SELECTORS = DATE_PICKER_SELECTORS;
124870
124900
  exports.DATE_RANGES = DATE_RANGES;
124871
124901
  exports.DATE_TEXTS = DATE_TEXTS;
124902
+ exports.DEFAULT_WEBHOOKS_RESPONSE_TEXT = DEFAULT_WEBHOOKS_RESPONSE_TEXT;
124872
124903
  exports.DESCRIPTION_EDITOR_TEXTS = DESCRIPTION_EDITOR_TEXTS;
124873
124904
  exports.EMBED_SELECTORS = EMBED_SELECTORS;
124874
124905
  exports.EMOJI_LABEL = EMOJI_LABEL;