@bigbinary/neeto-playwright-commons 4.8.12 → 4.8.14

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.
Files changed (3) hide show
  1. package/index.d.ts +2 -1
  2. package/index.js +14 -6
  3. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -686,7 +686,7 @@ declare class CustomCommands {
686
686
  *
687
687
  * Method to verify the presence and content of the unsaved changes modal.
688
688
  *
689
- * shouldLeavePage (optional): A boolean indicating whether to simulate leaving the page (true) or staying on the page (false).Defaults to false.
689
+ * shouldLeavePage (optional): A boolean indicating whether to leave the page by discarding the changes (true) or stay on the page by closing the modal without saving (false). Defaults to false.
690
690
  *
691
691
  * @example
692
692
  *
@@ -8080,6 +8080,7 @@ declare const NEETO_EDITOR_SELECTORS: {
8080
8080
  paragraphOption: string;
8081
8081
  calloutOption: string;
8082
8082
  attachmentPreview: string;
8083
+ attachmentActionsButton: string;
8083
8084
  imageUploadLinkButton: string;
8084
8085
  errorText: string;
8085
8086
  content: string;
package/index.js CHANGED
@@ -1523,6 +1523,7 @@ const NEETO_EDITOR_SELECTORS = {
1523
1523
  paragraphOption: fixedMenuSelector("font-size-option-body2"),
1524
1524
  calloutOption: fixedMenuSelector("callout-option"),
1525
1525
  attachmentPreview: "ne-attachments-wrapper",
1526
+ attachmentActionsButton: "neeto-editor-attachment-actions",
1526
1527
  imageUploadLinkButton: "neeto-editor-media-uploader-link-tab",
1527
1528
  errorText: "neeto-editor-error-text",
1528
1529
  content: "editor-content",
@@ -2481,10 +2482,12 @@ class CustomCommands {
2481
2482
  ).toHaveText("Are you sure you want to leave? All unsaved changes will be lost."),
2482
2483
  expect(this.page.getByTestId(COMMON_SELECTORS.alertTitle)).toHaveText("You have unsaved changes"),
2483
2484
  ]);
2484
- const buttonSelector = shouldLeavePage
2485
- ? COMMON_SELECTORS.alertCancelButton
2486
- : COMMON_SELECTORS.alertModalSubmitButton;
2487
- await alertBox.getByTestId(buttonSelector).click();
2485
+ const actionButton = shouldLeavePage
2486
+ ? alertBox.getByTestId(COMMON_SELECTORS.alertCancelButton)
2487
+ : alertBox
2488
+ .getByTestId(COMMON_SELECTORS.dialogCloseButton)
2489
+ .or(alertBox.getByTestId(COMMON_SELECTORS.alertModalCrossIcon));
2490
+ await actionButton.click();
2488
2491
  await expect(alertBox).toBeHidden();
2489
2492
  };
2490
2493
  setSliderValue = async ({ parentLocator = this.page, valueAsPercent, startFromCenter = false, }) => {
@@ -18466,9 +18469,12 @@ class OrganizationPage {
18466
18469
  const countrySelector = this.page.getByTestId(COMMON_SELECTORS.customSelectContainer("country"));
18467
18470
  await countrySelector.click();
18468
18471
  await countrySelector.pressSequentially(country);
18472
+ // TODO: Remove the country-select-option fallback once all products use the neeto-atoms version with per-option testids.
18469
18473
  await this.page
18474
+ .getByTestId(COMMON_SELECTORS.selectOption(country))
18475
+ .or(this.page
18470
18476
  .getByTestId(COMMON_SELECTORS.selectOption("country"))
18471
- .filter({ hasText: new RegExp(`^${country}$`) })
18477
+ .filter({ hasText: new RegExp(`^${country}$`) }))
18472
18478
  .click();
18473
18479
  await expect(countrySelector).toContainText(country);
18474
18480
  };
@@ -120934,8 +120940,10 @@ class EditorPage {
120934
120940
  await fileUploader.setFiles(imagePath);
120935
120941
  await expect(this.attachmentPreview).toBeVisible();
120936
120942
  if (shouldRemoveAttachment) {
120943
+ // TODO: Remove the dropdownIcon fallback once all products use the v2 neeto-editor.
120937
120944
  await this.attachmentPreview
120938
- .getByTestId(COMMON_SELECTORS.dropdownIcon)
120945
+ .getByTestId(NEETO_EDITOR_SELECTORS.attachmentActionsButton)
120946
+ .or(this.attachmentPreview.getByTestId(COMMON_SELECTORS.dropdownIcon))
120939
120947
  .click();
120940
120948
  await this.page
120941
120949
  .getByTestId(NEETO_EDITOR_SELECTORS.attachmentPreviewDeleteButton)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bigbinary/neeto-playwright-commons",
3
- "version": "4.8.12",
3
+ "version": "4.8.14",
4
4
  "description": "A package encapsulating common playwright code across neeto projects.",
5
5
  "repository": "git@github.com:bigbinary/neeto-playwright-commons.git",
6
6
  "license": "apache-2.0",