vease 1.49.0-rc.2 → 1.49.0-rc.4

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.
@@ -1,6 +1,7 @@
1
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
+ import { expect } from "@playwright/test";
4
5
  //#region tests/e2e/utils/camera_interaction.ts
5
6
  async function resetCamera(window) {
6
7
  await window.getByTestId("resetCameraButton").click();
@@ -110,6 +111,44 @@ async function selectShrinkDatasets(window, datasetName, index = 0) {
110
111
  await select.click();
111
112
  await waitForActionSettled(window);
112
113
  }
114
+ async function toggleThresholdFilter(window) {
115
+ await window.getByTestId("thresholdFilterButton").click();
116
+ await waitForActionSettled(window);
117
+ }
118
+ async function selectThresholdOption(window, selectTestId, name) {
119
+ await window.getByTestId(selectTestId).click();
120
+ await waitForActionSettled(window);
121
+ await window.getByRole("option", {
122
+ name,
123
+ exact: true
124
+ }).click();
125
+ await waitForActionSettled(window);
126
+ }
127
+ async function selectThresholdAttribute(window, datasetName, attributeType, attributeName) {
128
+ await selectThresholdOption(window, "thresholdDatasetSelect", datasetName);
129
+ await selectThresholdOption(window, "thresholdAttributeTypeSelect", attributeType);
130
+ await selectThresholdOption(window, "thresholdAttributeSelect", attributeName);
131
+ }
132
+ async function selectThresholdCellAttribute(window, datasetName, attributeName) {
133
+ await selectThresholdAttribute(window, datasetName, "cell attribute", attributeName);
134
+ }
135
+ async function selectThresholdBlockPolyhedron(window, datasetName, attributeName) {
136
+ await selectThresholdAttribute(window, datasetName, "Block polyhedron attribute", attributeName);
137
+ }
138
+ async function setThresholdMinimum(window, minimum) {
139
+ const input = window.getByTestId("thresholdFilterPanel").getByTestId("attributeMinInput").locator("input");
140
+ await input.fill(minimum.toString());
141
+ await input.press("Enter");
142
+ await waitForActionSettled(window);
143
+ }
144
+ async function resetThresholdFilter(window) {
145
+ await window.getByTestId("resetThresholdButton").click();
146
+ await waitForActionSettled(window);
147
+ }
148
+ async function removeThresholdFilter(window) {
149
+ await window.getByTestId("removeThresholdButton").click();
150
+ await waitForActionSettled(window);
151
+ }
113
152
  async function toggleRuler(window) {
114
153
  await closeAllMenus(window);
115
154
  await window.getByTestId("rulerButton").click();
@@ -129,5 +168,21 @@ async function clearRuler(window) {
129
168
  await window.getByTestId("rulerClearButton").click();
130
169
  await waitForActionSettled(window);
131
170
  }
171
+ async function activateZoomToBox(window) {
172
+ await closeAllMenus(window);
173
+ await window.getByTestId("zoomToBoxButton").click();
174
+ await waitForActionSettled(window);
175
+ await expect(window.getByTestId("zoomBoxActiveChip")).toBeVisible();
176
+ }
177
+ async function drawZoomBox(window, deltaX, deltaY) {
178
+ const overlay = window.getByTestId("zoomBoxOverlay");
179
+ await dragElement(window, overlay, {
180
+ deltaX,
181
+ deltaY
182
+ });
183
+ await moveMouseOutOfTheWay(window);
184
+ await waitForActionSettled(window);
185
+ await expect(window.getByTestId("zoomBoxActiveChip")).toBeHidden();
186
+ }
132
187
  //#endregion
133
- export { clearRuler, closeCameraManager, ensureHighlightMenuOpen, resetCamera, resetShrinkFilter, restoreCameraPosition, rotateCamera, saveCameraPosition, selectCameraOrientation, selectShrinkDatasets, setRulerPointInput, setShrinkFactor, setZScaling, toggleCameraManager, toggleCameraOrientation, toggleCenterOnClick, toggleGridScale, toggleRuler, toggleRulerSnap, toggleShrinkFilter, toggleShrinkTargetAllVisible };
188
+ export { activateZoomToBox, clearRuler, closeCameraManager, drawZoomBox, ensureHighlightMenuOpen, removeThresholdFilter, resetCamera, resetShrinkFilter, resetThresholdFilter, restoreCameraPosition, rotateCamera, saveCameraPosition, selectCameraOrientation, selectShrinkDatasets, selectThresholdBlockPolyhedron, selectThresholdCellAttribute, setRulerPointInput, setShrinkFactor, setThresholdMinimum, setZScaling, toggleCameraManager, toggleCameraOrientation, toggleCenterOnClick, toggleGridScale, toggleRuler, toggleRulerSnap, toggleShrinkFilter, toggleShrinkTargetAllVisible, toggleThresholdFilter };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vease",
3
- "version": "1.49.0-rc.2",
3
+ "version": "1.49.0-rc.4",
4
4
  "description": "Desktop and cloud software for data visualization",
5
5
  "keywords": [
6
6
  "Desktop",
@@ -1,4 +1,4 @@
1
- import type { Page } from "@playwright/test";
1
+ import { type Page, expect } from "@playwright/test";
2
2
 
3
3
  import { closeAllMenus, moveMouseOutOfTheWay } from "./app_interaction";
4
4
  import { dragElement, getHybridViewerCanvas } from "./viewer_interaction";
@@ -139,6 +139,69 @@ async function selectShrinkDatasets(window: Page, datasetName: string, index = 0
139
139
  await waitForActionSettled(window);
140
140
  }
141
141
 
142
+ async function toggleThresholdFilter(window: Page): Promise<void> {
143
+ await window.getByTestId("thresholdFilterButton").click();
144
+ await waitForActionSettled(window);
145
+ }
146
+
147
+ async function selectThresholdOption(
148
+ window: Page,
149
+ selectTestId: string,
150
+ name: string,
151
+ ): Promise<void> {
152
+ await window.getByTestId(selectTestId).click();
153
+ await waitForActionSettled(window);
154
+ await window.getByRole("option", { name, exact: true }).click();
155
+ await waitForActionSettled(window);
156
+ }
157
+
158
+ async function selectThresholdAttribute(
159
+ window: Page,
160
+ datasetName: string,
161
+ attributeType: string,
162
+ attributeName: string,
163
+ ): Promise<void> {
164
+ await selectThresholdOption(window, "thresholdDatasetSelect", datasetName);
165
+ await selectThresholdOption(window, "thresholdAttributeTypeSelect", attributeType);
166
+ await selectThresholdOption(window, "thresholdAttributeSelect", attributeName);
167
+ }
168
+
169
+ async function selectThresholdCellAttribute(
170
+ window: Page,
171
+ datasetName: string,
172
+ attributeName: string,
173
+ ): Promise<void> {
174
+ await selectThresholdAttribute(window, datasetName, "cell attribute", attributeName);
175
+ }
176
+
177
+ async function selectThresholdBlockPolyhedron(
178
+ window: Page,
179
+ datasetName: string,
180
+ attributeName: string,
181
+ ): Promise<void> {
182
+ await selectThresholdAttribute(window, datasetName, "Block polyhedron attribute", attributeName);
183
+ }
184
+
185
+ async function setThresholdMinimum(window: Page, minimum: number): Promise<void> {
186
+ const input = window
187
+ .getByTestId("thresholdFilterPanel")
188
+ .getByTestId("attributeMinInput")
189
+ .locator("input");
190
+ await input.fill(minimum.toString());
191
+ await input.press("Enter");
192
+ await waitForActionSettled(window);
193
+ }
194
+
195
+ async function resetThresholdFilter(window: Page): Promise<void> {
196
+ await window.getByTestId("resetThresholdButton").click();
197
+ await waitForActionSettled(window);
198
+ }
199
+
200
+ async function removeThresholdFilter(window: Page): Promise<void> {
201
+ await window.getByTestId("removeThresholdButton").click();
202
+ await waitForActionSettled(window);
203
+ }
204
+
142
205
  async function toggleRuler(window: Page): Promise<void> {
143
206
  await closeAllMenus(window);
144
207
  await window.getByTestId("rulerButton").click();
@@ -172,6 +235,21 @@ async function clearRuler(window: Page): Promise<void> {
172
235
  await waitForActionSettled(window);
173
236
  }
174
237
 
238
+ async function activateZoomToBox(window: Page): Promise<void> {
239
+ await closeAllMenus(window);
240
+ await window.getByTestId("zoomToBoxButton").click();
241
+ await waitForActionSettled(window);
242
+ await expect(window.getByTestId("zoomBoxActiveChip")).toBeVisible();
243
+ }
244
+
245
+ async function drawZoomBox(window: Page, deltaX: number, deltaY: number): Promise<void> {
246
+ const overlay = window.getByTestId("zoomBoxOverlay");
247
+ await dragElement(window, overlay, { deltaX, deltaY });
248
+ await moveMouseOutOfTheWay(window);
249
+ await waitForActionSettled(window);
250
+ await expect(window.getByTestId("zoomBoxActiveChip")).toBeHidden();
251
+ }
252
+
175
253
  export {
176
254
  setZScaling,
177
255
  resetCamera,
@@ -190,8 +268,16 @@ export {
190
268
  resetShrinkFilter,
191
269
  toggleShrinkTargetAllVisible,
192
270
  selectShrinkDatasets,
271
+ toggleThresholdFilter,
272
+ selectThresholdCellAttribute,
273
+ selectThresholdBlockPolyhedron,
274
+ setThresholdMinimum,
275
+ resetThresholdFilter,
276
+ removeThresholdFilter,
193
277
  toggleRuler,
194
278
  toggleRulerSnap,
195
279
  setRulerPointInput,
196
280
  clearRuler,
281
+ activateZoomToBox,
282
+ drawZoomBox,
197
283
  };