@bigbinary/neeto-playwright-commons 4.2.2 → 4.2.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.
Files changed (3) hide show
  1. package/index.d.ts +1 -0
  2. package/index.js +7 -5
  3. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -6867,6 +6867,7 @@ declare const NEETO_EDITOR_SELECTORS: {
6867
6867
  neetoEditorHighlightTextColor: (textColorIndex: number) => string;
6868
6868
  neetoEditorHighlightBgColor: (bgColorIndex: number) => string;
6869
6869
  todoList: string;
6870
+ selectedText: string;
6870
6871
  commandListItem: (index: number) => string;
6871
6872
  itemBlockHeading: string;
6872
6873
  };
package/index.js CHANGED
@@ -1377,6 +1377,7 @@ const NEETO_EDITOR_SELECTORS = {
1377
1377
  neetoEditorHighlightTextColor: (textColorIndex) => `neeto-editor-highlight-text-color-dot-${textColorIndex}`,
1378
1378
  neetoEditorHighlightBgColor: (bgColorIndex) => `neeto-editor-highlight-background-color-dot-${bgColorIndex}`,
1379
1379
  todoList: "[data-type='todoList']",
1380
+ selectedText: ".selected-text",
1380
1381
  commandListItem: (index) => `neeto-editor-command-list-item-${index}`,
1381
1382
  itemBlockHeading: "neeto-editor-command-list-item-block-heading",
1382
1383
  };
@@ -2385,11 +2386,12 @@ class CustomCommands {
2385
2386
  const isMacOS = os.platform() === "darwin";
2386
2387
  const rightArrowKey = isMacOS ? "Meta+ArrowRight" : "End";
2387
2388
  const downArrowKey = isMacOS ? "Meta+ArrowDown" : "PageDown";
2388
- await this.page.keyboard.press(rightArrowKey);
2389
- await this.page.keyboard.press(rightArrowKey);
2390
- await this.page.keyboard.press(downArrowKey);
2391
- // eslint-disable-next-line playwright/no-wait-for-timeout
2392
- await this.page.waitForTimeout(500); // Adding some delay for DOM to react
2389
+ await expect(async () => {
2390
+ await this.page.keyboard.press(rightArrowKey);
2391
+ await this.page.keyboard.press(rightArrowKey);
2392
+ await this.page.keyboard.press(downArrowKey);
2393
+ await expect(this.page.locator(NEETO_EDITOR_SELECTORS.selectedText)).toHaveCount(0, { timeout: 2_000 });
2394
+ }).toPass({ timeout: 15_000 });
2393
2395
  await this.page.keyboard.press("Enter");
2394
2396
  };
2395
2397
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bigbinary/neeto-playwright-commons",
3
- "version": "4.2.2",
3
+ "version": "4.2.3",
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",