@rickcedwhat/playwright-smart-table 6.3.1 → 6.3.2

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/dist/plugins.d.ts CHANGED
@@ -10,6 +10,7 @@ export declare const Plugins: {
10
10
  Glide: {
11
11
  Strategies: {
12
12
  fill: import("./types").FillStrategy;
13
+ fillSimple: import("./types").FillStrategy;
13
14
  pagination: import("./types").PaginationStrategy;
14
15
  header: (context: import("./types").StrategyContext, options?: {
15
16
  limit?: number;
@@ -33,7 +33,17 @@ const glideGoRight = (context) => __awaiter(void 0, void 0, void 0, function* ()
33
33
  exports.glideGoRight = glideGoRight;
34
34
  const glideGoHome = (context) => __awaiter(void 0, void 0, void 0, function* () {
35
35
  const { root, page } = context;
36
- yield root.focus();
36
+ // Glide renders to canvas - the accessibility table (root) is inside the canvas
37
+ // We need to find and focus the canvas element that contains our root
38
+ yield root.evaluate((el) => {
39
+ var _a;
40
+ // Find the closest canvas ancestor
41
+ const canvas = el.closest('canvas') || ((_a = el.parentElement) === null || _a === void 0 ? void 0 : _a.querySelector('canvas'));
42
+ if (canvas instanceof HTMLCanvasElement) {
43
+ canvas.tabIndex = 0;
44
+ canvas.focus();
45
+ }
46
+ });
37
47
  yield page.waitForTimeout(100);
38
48
  // Reset to top-left - Cross-OS sequence (Mac/Windows)
39
49
  yield page.keyboard.press('Control+Home');
@@ -1,5 +1,15 @@
1
1
  import { FillStrategy } from '../types';
2
+ /**
3
+ * Fill strategy for Glide Data Grid with textarea validation.
4
+ * This is the default strategy that works with the standard Glide Data Grid editor.
5
+ */
2
6
  export declare const glideFillStrategy: FillStrategy;
7
+ /**
8
+ * Simple fill strategy for Glide Data Grid.
9
+ * Use this if your Glide implementation doesn't use the standard textarea editor.
10
+ * This is faster but may not work for all Glide configurations.
11
+ */
12
+ export declare const glideFillSimple: FillStrategy;
3
13
  export declare const glidePaginationStrategy: import("../types").PaginationStrategy;
4
14
  export declare const glideGetCellLocator: ({ row, columnIndex }: any) => any;
5
15
  export declare const glideGetActiveCell: ({ page }: any) => Promise<{
@@ -9,6 +19,7 @@ export declare const glideGetActiveCell: ({ page }: any) => Promise<{
9
19
  } | null>;
10
20
  export declare const GlideStrategies: {
11
21
  fill: FillStrategy;
22
+ fillSimple: FillStrategy;
12
23
  pagination: import("../types").PaginationStrategy;
13
24
  header: (context: import("../types").StrategyContext, options?: {
14
25
  limit?: number;
@@ -9,11 +9,15 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.GlideStrategies = exports.glideGetActiveCell = exports.glideGetCellLocator = exports.glidePaginationStrategy = exports.glideFillStrategy = void 0;
12
+ exports.GlideStrategies = exports.glideGetActiveCell = exports.glideGetCellLocator = exports.glidePaginationStrategy = exports.glideFillSimple = exports.glideFillStrategy = void 0;
13
13
  const columns_1 = require("./glide/columns");
14
14
  const headers_1 = require("./glide/headers");
15
15
  const pagination_1 = require("./pagination");
16
16
  const stabilization_1 = require("./stabilization");
17
+ /**
18
+ * Fill strategy for Glide Data Grid with textarea validation.
19
+ * This is the default strategy that works with the standard Glide Data Grid editor.
20
+ */
17
21
  const glideFillStrategy = (_a) => __awaiter(void 0, [_a], void 0, function* ({ value, page }) {
18
22
  // Edit Cell
19
23
  yield page.keyboard.press('Enter');
@@ -44,6 +48,17 @@ const glideFillStrategy = (_a) => __awaiter(void 0, [_a], void 0, function* ({ v
44
48
  yield page.waitForTimeout(300);
45
49
  });
46
50
  exports.glideFillStrategy = glideFillStrategy;
51
+ /**
52
+ * Simple fill strategy for Glide Data Grid.
53
+ * Use this if your Glide implementation doesn't use the standard textarea editor.
54
+ * This is faster but may not work for all Glide configurations.
55
+ */
56
+ const glideFillSimple = (_a) => __awaiter(void 0, [_a], void 0, function* ({ value, page }) {
57
+ yield page.keyboard.press('Enter');
58
+ yield page.keyboard.type(String(value));
59
+ yield page.keyboard.press('Enter');
60
+ });
61
+ exports.glideFillSimple = glideFillSimple;
47
62
  exports.glidePaginationStrategy = pagination_1.PaginationStrategies.infiniteScroll({
48
63
  scrollTarget: 'xpath=//ancestor::body//div[contains(@class, "dvn-scroller")]',
49
64
  scrollAmount: 500,
@@ -90,6 +105,7 @@ const glideGetActiveCell = (_a) => __awaiter(void 0, [_a], void 0, function* ({
90
105
  exports.glideGetActiveCell = glideGetActiveCell;
91
106
  exports.GlideStrategies = {
92
107
  fill: exports.glideFillStrategy,
108
+ fillSimple: exports.glideFillSimple,
93
109
  pagination: exports.glidePaginationStrategy,
94
110
  header: headers_1.scrollRightHeader,
95
111
  navigation: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rickcedwhat/playwright-smart-table",
3
- "version": "6.3.1",
3
+ "version": "6.3.2",
4
4
  "description": "Smart, column-aware table interactions for Playwright",
5
5
  "author": "Cedrick Catalan",
6
6
  "license": "MIT",