vease 1.48.0-rc.21 → 1.48.0-rc.23

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 (42) hide show
  1. package/package.json +1 -1
  2. package/tests/e2e/utils/app_interaction.js +11 -3
  3. package/tests/e2e/utils/app_interaction.ts +14 -4
  4. package/tests/e2e/utils/camera_interaction.js +28 -28
  5. package/tests/e2e/utils/camera_interaction.ts +28 -28
  6. package/tests/e2e/utils/clipping_planes_interaction.js +10 -10
  7. package/tests/e2e/utils/clipping_planes_interaction.ts +10 -10
  8. package/tests/e2e/utils/create_objects.js +13 -13
  9. package/tests/e2e/utils/create_objects.ts +13 -13
  10. package/tests/e2e/utils/data/helpers/attribute.js +18 -18
  11. package/tests/e2e/utils/data/helpers/attribute.ts +18 -18
  12. package/tests/e2e/utils/data/helpers/color.js +5 -5
  13. package/tests/e2e/utils/data/helpers/color.ts +5 -5
  14. package/tests/e2e/utils/data/helpers/color_picker.js +6 -6
  15. package/tests/e2e/utils/data/helpers/color_picker.ts +6 -6
  16. package/tests/e2e/utils/data/mesh/cells/attribute.js +4 -3
  17. package/tests/e2e/utils/data/mesh/cells/attribute.ts +8 -8
  18. package/tests/e2e/utils/data/mesh/edges/attribute.js +4 -3
  19. package/tests/e2e/utils/data/mesh/edges/attribute.ts +8 -8
  20. package/tests/e2e/utils/data/mesh/points/attribute.js +4 -3
  21. package/tests/e2e/utils/data/mesh/points/attribute.ts +3 -3
  22. package/tests/e2e/utils/data/mesh/polygon/attribute.js +4 -3
  23. package/tests/e2e/utils/data/mesh/polygon/attribute.ts +3 -3
  24. package/tests/e2e/utils/data/mesh/polyhedra/attribute.js +4 -3
  25. package/tests/e2e/utils/data/mesh/polyhedra/attribute.ts +3 -3
  26. package/tests/e2e/utils/data_manager.js +12 -12
  27. package/tests/e2e/utils/data_manager.ts +12 -12
  28. package/tests/e2e/utils/fixtures.js +1 -1
  29. package/tests/e2e/utils/load.js +1 -1
  30. package/tests/e2e/utils/navigate.js +1 -1
  31. package/tests/e2e/utils/object_trees/common.js +14 -13
  32. package/tests/e2e/utils/object_trees/common.ts +13 -13
  33. package/tests/e2e/utils/object_trees/main_object_tree.js +7 -7
  34. package/tests/e2e/utils/object_trees/main_object_tree.ts +7 -7
  35. package/tests/e2e/utils/object_trees/model_components_object_tree.js +6 -6
  36. package/tests/e2e/utils/object_trees/model_components_object_tree.ts +10 -6
  37. package/tests/e2e/utils/project_interaction.js +5 -4
  38. package/tests/e2e/utils/project_interaction.ts +4 -4
  39. package/tests/e2e/utils/viewer_interaction.js +17 -16
  40. package/tests/e2e/utils/viewer_interaction.ts +19 -15
  41. package/tests/e2e/utils/wait_for_action_settled.js +53 -0
  42. package/tests/e2e/utils/wait_for_action_settled.ts +82 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vease",
3
- "version": "1.48.0-rc.21",
3
+ "version": "1.48.0-rc.23",
4
4
  "description": "Desktop and cloud software for data visualization",
5
5
  "keywords": [
6
6
  "Desktop",
@@ -1,11 +1,19 @@
1
- import { afterActionWait } from "./constants.js";
1
+ import { waitForActionSettled } from "./wait_for_action_settled.js";
2
+ import { expect } from "@playwright/test";
2
3
  //#region tests/e2e/utils/app_interaction.ts
3
4
  async function moveMouseOutOfTheWay(window) {
4
5
  await window.mouse.move(0, 0);
5
6
  }
6
7
  async function closeAllMenus(window) {
7
8
  await window.keyboard.press("Escape");
8
- await window.waitForTimeout(afterActionWait);
9
+ await waitForActionSettled(window);
10
+ }
11
+ async function closeFeedbackSnackbar(window) {
12
+ const snackbar = window.getByTestId("feedbackSnackbar");
13
+ if (await snackbar.isVisible()) {
14
+ await snackbar.getByRole("button").click();
15
+ await expect(snackbar).not.toBeVisible();
16
+ }
9
17
  }
10
18
  //#endregion
11
- export { closeAllMenus, moveMouseOutOfTheWay };
19
+ export { closeAllMenus, closeFeedbackSnackbar, moveMouseOutOfTheWay };
@@ -1,12 +1,22 @@
1
- import type { Page } from "@playwright/test";
2
- import { afterActionWait } from "./constants";
1
+ import { type Page, expect } from "@playwright/test";
2
+ import { waitForActionSettled } from "./wait_for_action_settled";
3
3
 
4
4
  async function moveMouseOutOfTheWay(window: Page): Promise<void> {
5
5
  await window.mouse.move(0, 0);
6
6
  }
7
7
  async function closeAllMenus(window: Page): Promise<void> {
8
8
  await window.keyboard.press("Escape");
9
- await window.waitForTimeout(afterActionWait);
9
+ await waitForActionSettled(window);
10
10
  }
11
11
 
12
- export { closeAllMenus, moveMouseOutOfTheWay };
12
+ // Snackbars auto-dismiss after 10s (see feedback store), which is too slow to rely on between tests.
13
+ // Not every action produces a snackbar (e.g. a successful visibility toggle doesn't), so only close it if present.
14
+ async function closeFeedbackSnackbar(window: Page): Promise<void> {
15
+ const snackbar = window.getByTestId("feedbackSnackbar");
16
+ if (await snackbar.isVisible()) {
17
+ await snackbar.getByRole("button").click();
18
+ await expect(snackbar).not.toBeVisible();
19
+ }
20
+ }
21
+
22
+ export { closeAllMenus, closeFeedbackSnackbar, moveMouseOutOfTheWay };
@@ -1,11 +1,11 @@
1
- import { afterActionWait } from "./constants.js";
1
+ import { waitForActionSettled } from "./wait_for_action_settled.js";
2
2
  import { closeAllMenus, moveMouseOutOfTheWay } from "./app_interaction.js";
3
3
  import { dragElement, getHybridViewerCanvas } from "./viewer_interaction.js";
4
4
  //#region tests/e2e/utils/camera_interaction.ts
5
5
  async function resetCamera(window) {
6
6
  await window.getByTestId("resetCameraButton").click();
7
7
  await moveMouseOutOfTheWay(window);
8
- await window.waitForTimeout(afterActionWait);
8
+ await waitForActionSettled(window);
9
9
  }
10
10
  async function rotateCamera(window, deltaX, deltaY = 0) {
11
11
  const hybridViewerCanvas = getHybridViewerCanvas(window);
@@ -16,69 +16,69 @@ async function rotateCamera(window, deltaX, deltaY = 0) {
16
16
  }
17
17
  async function toggleCenterOnClick(window) {
18
18
  await window.getByTestId("centerOnClickButton").click();
19
- await window.waitForTimeout(afterActionWait);
19
+ await waitForActionSettled(window);
20
20
  }
21
21
  async function toggleGridScale(window) {
22
22
  await closeAllMenus(window);
23
23
  await window.getByTestId("gridScaleButton").click();
24
- await window.waitForTimeout(afterActionWait);
24
+ await waitForActionSettled(window);
25
25
  }
26
26
  async function setZScaling(window, zScaleValue) {
27
27
  await closeAllMenus(window);
28
28
  await window.getByTestId("zScalingButton").click();
29
- await window.waitForTimeout(afterActionWait);
29
+ await waitForActionSettled(window);
30
30
  const panel = window.getByTestId("zScaleInput");
31
31
  if (!await panel.isVisible()) {
32
32
  await window.getByTestId("zScalingButton").click();
33
- await window.waitForTimeout(afterActionWait);
33
+ await waitForActionSettled(window);
34
34
  }
35
35
  const input = panel.locator("input");
36
36
  await input.fill(zScaleValue.toString());
37
37
  await input.press("Enter");
38
- await window.waitForTimeout(afterActionWait);
38
+ await waitForActionSettled(window);
39
39
  await window.getByTestId("toolPanelActionButton").click();
40
- await window.waitForTimeout(afterActionWait);
40
+ await waitForActionSettled(window);
41
41
  }
42
42
  async function toggleCameraManager(window) {
43
43
  await window.getByTestId("cameraManagerButton").click();
44
- await window.waitForTimeout(afterActionWait);
44
+ await waitForActionSettled(window);
45
45
  }
46
46
  async function saveCameraPosition(window, name) {
47
47
  await window.getByTestId("cameraPositionNameInput").locator("input").fill(name);
48
- await window.waitForTimeout(afterActionWait);
48
+ await waitForActionSettled(window);
49
49
  await window.getByTestId("saveCameraPositionButton").click();
50
- await window.waitForTimeout(afterActionWait);
50
+ await waitForActionSettled(window);
51
51
  }
52
52
  async function closeCameraManager(window) {
53
53
  await window.getByTestId("closeCameraManagerButton").click();
54
- await window.waitForTimeout(afterActionWait);
54
+ await waitForActionSettled(window);
55
55
  }
56
56
  async function toggleCameraOrientation(window) {
57
57
  await window.getByTestId("cameraOrientationButton").click();
58
- await window.waitForTimeout(afterActionWait);
58
+ await waitForActionSettled(window);
59
59
  }
60
60
  async function selectCameraOrientation(window, label) {
61
61
  const vtkKey = label.replace("+", "Plus").replace("-", "Minus");
62
62
  await window.getByTestId(`cameraOrientation${vtkKey}Button`).click();
63
- await window.waitForTimeout(afterActionWait);
63
+ await waitForActionSettled(window);
64
64
  }
65
65
  async function restoreCameraPosition(window, name) {
66
66
  await window.getByTestId(`restoreCameraPosition${name}Button`).click();
67
- await window.waitForTimeout(afterActionWait);
67
+ await waitForActionSettled(window);
68
68
  }
69
69
  async function ensureHighlightMenuOpen(window, childButtonTestId) {
70
70
  if (!await window.getByTestId(childButtonTestId).isVisible()) {
71
71
  await window.getByTestId("highlightOnHoverButton").click();
72
- await window.waitForTimeout(afterActionWait);
72
+ await waitForActionSettled(window);
73
73
  if (!await window.getByTestId(childButtonTestId).isVisible()) {
74
74
  await window.getByTestId("highlightOnHoverButton").click();
75
- await window.waitForTimeout(afterActionWait);
75
+ await waitForActionSettled(window);
76
76
  }
77
77
  }
78
78
  }
79
79
  async function toggleShrinkFilter(window) {
80
80
  await window.getByTestId("shrinkFilterButton").click();
81
- await window.waitForTimeout(afterActionWait);
81
+ await waitForActionSettled(window);
82
82
  }
83
83
  async function setShrinkFactor(window, shrinkFactorValue) {
84
84
  const slider = window.getByTestId("shrinkFactorSlider");
@@ -89,43 +89,43 @@ async function setShrinkFactor(window, shrinkFactorValue) {
89
89
  x: clickX,
90
90
  y: box.height / 2
91
91
  } });
92
- await window.waitForTimeout(afterActionWait);
92
+ await waitForActionSettled(window);
93
93
  }
94
94
  async function resetShrinkFilter(window) {
95
95
  await window.getByTestId("resetShrinkButton").click();
96
- await window.waitForTimeout(afterActionWait);
96
+ await waitForActionSettled(window);
97
97
  }
98
98
  async function toggleShrinkTargetAllVisible(window) {
99
99
  await window.getByTestId("shrinkTargetAllVisibleSwitch").getByRole("checkbox").click();
100
- await window.waitForTimeout(afterActionWait);
100
+ await waitForActionSettled(window);
101
101
  }
102
102
  async function selectShrinkDatasets(window, datasetName, index = 0) {
103
103
  const select = window.getByTestId("shrinkSelectedDatasetsSelect");
104
104
  await select.click();
105
- await window.waitForTimeout(afterActionWait);
105
+ await waitForActionSettled(window);
106
106
  await window.getByRole("option", { name: datasetName }).nth(index).click();
107
- await window.waitForTimeout(afterActionWait);
107
+ await waitForActionSettled(window);
108
108
  await select.click();
109
- await window.waitForTimeout(afterActionWait);
109
+ await waitForActionSettled(window);
110
110
  }
111
111
  async function toggleRuler(window) {
112
112
  await closeAllMenus(window);
113
113
  await window.getByTestId("rulerButton").click();
114
- await window.waitForTimeout(afterActionWait);
114
+ await waitForActionSettled(window);
115
115
  }
116
116
  async function toggleRulerSnap(window) {
117
117
  await window.getByTestId("rulerSnapToggle").getByRole("checkbox").click();
118
- await window.waitForTimeout(afterActionWait);
118
+ await waitForActionSettled(window);
119
119
  }
120
120
  async function setRulerPointInput(window, pointIndex, coords) {
121
121
  const card = window.getByTestId("rulerPointCard").nth(pointIndex - 1);
122
122
  for (let axis = 0; axis < coords.length; axis += 1) await card.getByTestId("rulerPointCoordInput").nth(axis).locator("input").fill(coords[axis].toString());
123
123
  await window.getByTestId("rulerApplyButton").click();
124
- await window.waitForTimeout(afterActionWait);
124
+ await waitForActionSettled(window);
125
125
  }
126
126
  async function clearRuler(window) {
127
127
  await window.getByTestId("rulerClearButton").click();
128
- await window.waitForTimeout(afterActionWait);
128
+ await waitForActionSettled(window);
129
129
  }
130
130
  //#endregion
131
131
  export { clearRuler, closeCameraManager, ensureHighlightMenuOpen, resetCamera, resetShrinkFilter, restoreCameraPosition, rotateCamera, saveCameraPosition, selectCameraOrientation, selectShrinkDatasets, setRulerPointInput, setShrinkFactor, setZScaling, toggleCameraManager, toggleCameraOrientation, toggleCenterOnClick, toggleGridScale, toggleRuler, toggleRulerSnap, toggleShrinkFilter, toggleShrinkTargetAllVisible };
@@ -1,12 +1,12 @@
1
1
  import type { Page } from "@playwright/test";
2
2
 
3
- import { afterActionWait, dragElement, getHybridViewerCanvas } from "./viewer_interaction";
4
3
  import { closeAllMenus, moveMouseOutOfTheWay } from "./app_interaction";
4
+ import { dragElement, getHybridViewerCanvas, waitForActionSettled } from "./viewer_interaction";
5
5
 
6
6
  async function resetCamera(window: Page): Promise<void> {
7
7
  await window.getByTestId("resetCameraButton").click();
8
8
  await moveMouseOutOfTheWay(window);
9
- await window.waitForTimeout(afterActionWait);
9
+ await waitForActionSettled(window);
10
10
  }
11
11
 
12
12
  async function rotateCamera(window: Page, deltaX: number, deltaY = 0): Promise<void> {
@@ -16,82 +16,82 @@ async function rotateCamera(window: Page, deltaX: number, deltaY = 0): Promise<v
16
16
 
17
17
  async function toggleCenterOnClick(window: Page): Promise<void> {
18
18
  await window.getByTestId("centerOnClickButton").click();
19
- await window.waitForTimeout(afterActionWait);
19
+ await waitForActionSettled(window);
20
20
  }
21
21
 
22
22
  async function toggleGridScale(window: Page): Promise<void> {
23
23
  await closeAllMenus(window);
24
24
  await window.getByTestId("gridScaleButton").click();
25
- await window.waitForTimeout(afterActionWait);
25
+ await waitForActionSettled(window);
26
26
  }
27
27
 
28
28
  async function setZScaling(window: Page, zScaleValue: number): Promise<void> {
29
29
  await closeAllMenus(window);
30
30
  await window.getByTestId("zScalingButton").click();
31
- await window.waitForTimeout(afterActionWait);
31
+ await waitForActionSettled(window);
32
32
 
33
33
  const panel = window.getByTestId("zScaleInput");
34
34
  if (!(await panel.isVisible())) {
35
35
  await window.getByTestId("zScalingButton").click();
36
- await window.waitForTimeout(afterActionWait);
36
+ await waitForActionSettled(window);
37
37
  }
38
38
 
39
39
  const input = panel.locator("input");
40
40
  await input.fill(zScaleValue.toString());
41
41
  await input.press("Enter");
42
- await window.waitForTimeout(afterActionWait);
42
+ await waitForActionSettled(window);
43
43
  await window.getByTestId("toolPanelActionButton").click();
44
- await window.waitForTimeout(afterActionWait);
44
+ await waitForActionSettled(window);
45
45
  }
46
46
 
47
47
  async function toggleCameraManager(window: Page): Promise<void> {
48
48
  await window.getByTestId("cameraManagerButton").click();
49
- await window.waitForTimeout(afterActionWait);
49
+ await waitForActionSettled(window);
50
50
  }
51
51
 
52
52
  async function saveCameraPosition(window: Page, name: string): Promise<void> {
53
53
  const input = window.getByTestId("cameraPositionNameInput").locator("input");
54
54
  await input.fill(name);
55
- await window.waitForTimeout(afterActionWait);
55
+ await waitForActionSettled(window);
56
56
  await window.getByTestId("saveCameraPositionButton").click();
57
- await window.waitForTimeout(afterActionWait);
57
+ await waitForActionSettled(window);
58
58
  }
59
59
 
60
60
  async function closeCameraManager(window: Page): Promise<void> {
61
61
  await window.getByTestId("closeCameraManagerButton").click();
62
- await window.waitForTimeout(afterActionWait);
62
+ await waitForActionSettled(window);
63
63
  }
64
64
 
65
65
  async function toggleCameraOrientation(window: Page): Promise<void> {
66
66
  await window.getByTestId("cameraOrientationButton").click();
67
- await window.waitForTimeout(afterActionWait);
67
+ await waitForActionSettled(window);
68
68
  }
69
69
 
70
70
  async function selectCameraOrientation(window: Page, label: string): Promise<void> {
71
71
  const vtkKey = label.replace("+", "Plus").replace("-", "Minus");
72
72
  await window.getByTestId(`cameraOrientation${vtkKey}Button`).click();
73
- await window.waitForTimeout(afterActionWait);
73
+ await waitForActionSettled(window);
74
74
  }
75
75
 
76
76
  async function restoreCameraPosition(window: Page, name: string): Promise<void> {
77
77
  await window.getByTestId(`restoreCameraPosition${name}Button`).click();
78
- await window.waitForTimeout(afterActionWait);
78
+ await waitForActionSettled(window);
79
79
  }
80
80
 
81
81
  async function ensureHighlightMenuOpen(window: Page, childButtonTestId: string): Promise<void> {
82
82
  if (!(await window.getByTestId(childButtonTestId).isVisible())) {
83
83
  await window.getByTestId("highlightOnHoverButton").click();
84
- await window.waitForTimeout(afterActionWait);
84
+ await waitForActionSettled(window);
85
85
  if (!(await window.getByTestId(childButtonTestId).isVisible())) {
86
86
  await window.getByTestId("highlightOnHoverButton").click();
87
- await window.waitForTimeout(afterActionWait);
87
+ await waitForActionSettled(window);
88
88
  }
89
89
  }
90
90
  }
91
91
 
92
92
  async function toggleShrinkFilter(window: Page): Promise<void> {
93
93
  await window.getByTestId("shrinkFilterButton").click();
94
- await window.waitForTimeout(afterActionWait);
94
+ await waitForActionSettled(window);
95
95
  }
96
96
 
97
97
  async function setShrinkFactor(window: Page, shrinkFactorValue: number): Promise<void> {
@@ -102,43 +102,43 @@ async function setShrinkFactor(window: Page, shrinkFactorValue: number): Promise
102
102
  }
103
103
  const clickX = box.width * shrinkFactorValue;
104
104
  await slider.click({ position: { x: clickX, y: box.height / 2 } });
105
- await window.waitForTimeout(afterActionWait);
105
+ await waitForActionSettled(window);
106
106
  }
107
107
 
108
108
  async function resetShrinkFilter(window: Page): Promise<void> {
109
109
  await window.getByTestId("resetShrinkButton").click();
110
- await window.waitForTimeout(afterActionWait);
110
+ await waitForActionSettled(window);
111
111
  }
112
112
 
113
113
  async function toggleShrinkTargetAllVisible(window: Page): Promise<void> {
114
114
  const switchElement = window.getByTestId("shrinkTargetAllVisibleSwitch");
115
115
  const checkbox = switchElement.getByRole("checkbox");
116
116
  await checkbox.click();
117
- await window.waitForTimeout(afterActionWait);
117
+ await waitForActionSettled(window);
118
118
  }
119
119
 
120
120
  async function selectShrinkDatasets(window: Page, datasetName: string, index = 0): Promise<void> {
121
121
  const select = window.getByTestId("shrinkSelectedDatasetsSelect");
122
122
  await select.click();
123
- await window.waitForTimeout(afterActionWait);
123
+ await waitForActionSettled(window);
124
124
  const option = window.getByRole("option", { name: datasetName }).nth(index);
125
125
  await option.click();
126
- await window.waitForTimeout(afterActionWait);
126
+ await waitForActionSettled(window);
127
127
  await select.click();
128
- await window.waitForTimeout(afterActionWait);
128
+ await waitForActionSettled(window);
129
129
  }
130
130
 
131
131
  async function toggleRuler(window: Page): Promise<void> {
132
132
  await closeAllMenus(window);
133
133
  await window.getByTestId("rulerButton").click();
134
- await window.waitForTimeout(afterActionWait);
134
+ await waitForActionSettled(window);
135
135
  }
136
136
 
137
137
  async function toggleRulerSnap(window: Page): Promise<void> {
138
138
  const switchElement = window.getByTestId("rulerSnapToggle");
139
139
  const checkbox = switchElement.getByRole("checkbox");
140
140
  await checkbox.click();
141
- await window.waitForTimeout(afterActionWait);
141
+ await waitForActionSettled(window);
142
142
  }
143
143
 
144
144
  async function setRulerPointInput(
@@ -153,12 +153,12 @@ async function setRulerPointInput(
153
153
  await input.fill(coords[axis].toString());
154
154
  }
155
155
  await window.getByTestId("rulerApplyButton").click();
156
- await window.waitForTimeout(afterActionWait);
156
+ await waitForActionSettled(window);
157
157
  }
158
158
 
159
159
  async function clearRuler(window: Page): Promise<void> {
160
160
  await window.getByTestId("rulerClearButton").click();
161
- await window.waitForTimeout(afterActionWait);
161
+ await waitForActionSettled(window);
162
162
  }
163
163
 
164
164
  export {
@@ -1,13 +1,13 @@
1
- import { afterActionWait } from "./constants.js";
1
+ import { waitForActionSettled } from "./wait_for_action_settled.js";
2
2
  import "./viewer_interaction.js";
3
3
  //#region tests/e2e/utils/clipping_planes_interaction.ts
4
4
  async function toggleClippingPlanes(window) {
5
5
  await window.getByTestId("clippingPlanesButton").click();
6
- await window.waitForTimeout(afterActionWait);
6
+ await waitForActionSettled(window);
7
7
  }
8
8
  async function invertPlaneNormal(window, planeIndex = 0) {
9
9
  await window.getByTestId("invertNormalButton").nth(planeIndex).click();
10
- await window.waitForTimeout(afterActionWait);
10
+ await waitForActionSettled(window);
11
11
  }
12
12
  async function setPlaneOrigin(window, planeIndex, origin) {
13
13
  const card = window.getByTestId("planeCard").nth(planeIndex);
@@ -16,7 +16,7 @@ async function setPlaneOrigin(window, planeIndex, origin) {
16
16
  await input.fill(origin[axis].toString());
17
17
  await input.press("Enter");
18
18
  }
19
- await window.waitForTimeout(afterActionWait);
19
+ await waitForActionSettled(window);
20
20
  }
21
21
  async function setPlaneNormal(window, planeIndex, normal) {
22
22
  const card = window.getByTestId("planeCard").nth(planeIndex);
@@ -25,23 +25,23 @@ async function setPlaneNormal(window, planeIndex, normal) {
25
25
  await input.fill(normal[axis].toString());
26
26
  await input.press("Enter");
27
27
  }
28
- await window.waitForTimeout(afterActionWait);
28
+ await waitForActionSettled(window);
29
29
  }
30
30
  async function addClippingPlane(window) {
31
31
  await window.getByTestId("addPlaneButton").click();
32
- await window.waitForTimeout(afterActionWait);
32
+ await waitForActionSettled(window);
33
33
  }
34
34
  async function toggleTargetAllVisible(window) {
35
35
  await window.getByTestId("targetAllVisibleSwitch").getByRole("checkbox").click();
36
- await window.waitForTimeout(afterActionWait);
36
+ await waitForActionSettled(window);
37
37
  }
38
38
  async function selectClippingDatasets(window, datasetName, index = 0) {
39
39
  await window.getByTestId("selectedDatasetsSelect").click();
40
- await window.waitForTimeout(afterActionWait);
40
+ await waitForActionSettled(window);
41
41
  await window.getByRole("option", { name: datasetName }).nth(index).click();
42
- await window.waitForTimeout(afterActionWait);
42
+ await waitForActionSettled(window);
43
43
  await window.getByTestId("selectedDatasetsSelect").click();
44
- await window.waitForTimeout(afterActionWait);
44
+ await waitForActionSettled(window);
45
45
  }
46
46
  //#endregion
47
47
  export { addClippingPlane, invertPlaneNormal, selectClippingDatasets, setPlaneNormal, setPlaneOrigin, toggleClippingPlanes, toggleTargetAllVisible };
@@ -1,14 +1,14 @@
1
1
  import type { Page } from "@playwright/test";
2
- import { afterActionWait } from "./viewer_interaction";
2
+ import { waitForActionSettled } from "./viewer_interaction";
3
3
 
4
4
  async function toggleClippingPlanes(window: Page): Promise<void> {
5
5
  await window.getByTestId("clippingPlanesButton").click();
6
- await window.waitForTimeout(afterActionWait);
6
+ await waitForActionSettled(window);
7
7
  }
8
8
 
9
9
  async function invertPlaneNormal(window: Page, planeIndex = 0): Promise<void> {
10
10
  await window.getByTestId("invertNormalButton").nth(planeIndex).click();
11
- await window.waitForTimeout(afterActionWait);
11
+ await waitForActionSettled(window);
12
12
  }
13
13
 
14
14
  async function setPlaneOrigin(window: Page, planeIndex: number, origin: number[]): Promise<void> {
@@ -19,7 +19,7 @@ async function setPlaneOrigin(window: Page, planeIndex: number, origin: number[]
19
19
  await input.fill(origin[axis].toString());
20
20
  await input.press("Enter");
21
21
  }
22
- await window.waitForTimeout(afterActionWait);
22
+ await waitForActionSettled(window);
23
23
  }
24
24
 
25
25
  async function setPlaneNormal(window: Page, planeIndex: number, normal: number[]): Promise<void> {
@@ -30,26 +30,26 @@ async function setPlaneNormal(window: Page, planeIndex: number, normal: number[]
30
30
  await input.press("Enter");
31
31
  // oxlint-enable no-await-in-loop
32
32
  }
33
- await window.waitForTimeout(afterActionWait);
33
+ await waitForActionSettled(window);
34
34
  }
35
35
 
36
36
  async function addClippingPlane(window: Page): Promise<void> {
37
37
  await window.getByTestId("addPlaneButton").click();
38
- await window.waitForTimeout(afterActionWait);
38
+ await waitForActionSettled(window);
39
39
  }
40
40
 
41
41
  async function toggleTargetAllVisible(window: Page): Promise<void> {
42
42
  await window.getByTestId("targetAllVisibleSwitch").getByRole("checkbox").click();
43
- await window.waitForTimeout(afterActionWait);
43
+ await waitForActionSettled(window);
44
44
  }
45
45
 
46
46
  async function selectClippingDatasets(window: Page, datasetName: string, index = 0): Promise<void> {
47
47
  await window.getByTestId("selectedDatasetsSelect").click();
48
- await window.waitForTimeout(afterActionWait);
48
+ await waitForActionSettled(window);
49
49
  await window.getByRole("option", { name: datasetName }).nth(index).click();
50
- await window.waitForTimeout(afterActionWait);
50
+ await waitForActionSettled(window);
51
51
  await window.getByTestId("selectedDatasetsSelect").click();
52
- await window.waitForTimeout(afterActionWait);
52
+ await waitForActionSettled(window);
53
53
  }
54
54
 
55
55
  export {
@@ -1,4 +1,4 @@
1
- import { afterActionWait } from "./constants.js";
1
+ import { waitForActionSettled } from "./wait_for_action_settled.js";
2
2
  import { getHybridViewerCanvas } from "./viewer_interaction.js";
3
3
  //#region tests/e2e/utils/create_objects.ts
4
4
  function getCreateToolsPanelButton(window) {
@@ -7,31 +7,31 @@ function getCreateToolsPanelButton(window) {
7
7
  async function openCreateToolsPanel(window) {
8
8
  if (!await getCreateToolsPanelButton(window).isVisible()) {
9
9
  await window.getByTestId("createButton").click();
10
- await window.waitForTimeout(afterActionWait);
10
+ await waitForActionSettled(window);
11
11
  }
12
12
  }
13
13
  async function closeCreateToolsPanel(window) {
14
14
  if (await getCreateToolsPanelButton(window).isVisible()) {
15
15
  await window.getByTestId("createButton").click();
16
- await window.waitForTimeout(afterActionWait);
16
+ await waitForActionSettled(window);
17
17
  }
18
18
  }
19
19
  async function selectCreateTool(window, toolId) {
20
20
  await window.getByTestId(`createToolCard-${toolId}`).click();
21
- await window.waitForTimeout(afterActionWait);
21
+ await waitForActionSettled(window);
22
22
  }
23
23
  async function fillPointCoords(window, index, x, y, z) {
24
24
  const inputs = window.getByTestId(`point-${index}`).locator("input");
25
25
  await inputs.nth(0).fill(x.toString());
26
- await window.waitForTimeout(afterActionWait);
26
+ await waitForActionSettled(window);
27
27
  await inputs.nth(1).fill(y.toString());
28
- await window.waitForTimeout(afterActionWait);
28
+ await waitForActionSettled(window);
29
29
  await inputs.nth(2).fill(z.toString());
30
- await window.waitForTimeout(afterActionWait);
30
+ await waitForActionSettled(window);
31
31
  }
32
32
  async function addPointRow(window) {
33
33
  await window.getByTestId("addPointButton").click();
34
- await window.waitForTimeout(afterActionWait);
34
+ await waitForActionSettled(window);
35
35
  }
36
36
  async function fillPointsCoords(window, coords) {
37
37
  async function fillNext(index) {
@@ -46,26 +46,26 @@ async function fillPointsCoords(window, coords) {
46
46
  }
47
47
  async function clickPickButton(window) {
48
48
  await window.getByTestId("pickButton").click();
49
- await window.waitForTimeout(afterActionWait);
49
+ await waitForActionSettled(window);
50
50
  }
51
51
  async function pickPointInViewer(window, x, y) {
52
52
  await getHybridViewerCanvas(window).click({ position: {
53
53
  x,
54
54
  y
55
55
  } });
56
- await window.waitForTimeout(afterActionWait);
56
+ await waitForActionSettled(window);
57
57
  }
58
58
  async function submitCreateObject(window) {
59
59
  await window.getByTestId("submitButton").click();
60
- await window.waitForTimeout(afterActionWait);
60
+ await waitForActionSettled(window);
61
61
  }
62
62
  async function closePickingBanner(window) {
63
63
  await window.getByTestId("pickingActiveChip").click();
64
- await window.waitForTimeout(afterActionWait);
64
+ await waitForActionSettled(window);
65
65
  }
66
66
  async function toggleClosedCurve(window) {
67
67
  await window.getByTestId("closedCurveCheckbox").getByRole("checkbox").check();
68
- await window.waitForTimeout(afterActionWait);
68
+ await waitForActionSettled(window);
69
69
  }
70
70
  //#endregion
71
71
  export { addPointRow, clickPickButton, closeCreateToolsPanel, closePickingBanner, fillPointCoords, fillPointsCoords, openCreateToolsPanel, pickPointInViewer, selectCreateTool, submitCreateObject, toggleClosedCurve };