@geode/opengeodeweb-front 11.2.0-rc.2 → 11.2.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.
Files changed (77) hide show
  1. package/.build/_virtual/_rolldown/runtime.js +13 -0
  2. package/.build/tests/browser/helpers/object_trees/model_component_relations.js +20 -0
  3. package/.build/tests/browser/helpers/suite_runtime.js +1 -0
  4. package/.build/tests/browser/suites/grid_scale.js +32 -0
  5. package/.build/tests/browser/suites/index.js +52 -0
  6. package/.build/tests/browser/suites/mesh/edged_curve.js +91 -0
  7. package/.build/tests/browser/suites/mesh/grid2d.js +108 -0
  8. package/.build/tests/browser/suites/mesh/grid3d.js +107 -0
  9. package/.build/tests/browser/suites/mesh/point_set.js +69 -0
  10. package/.build/tests/browser/suites/mesh/polygonal_surface.js +147 -0
  11. package/.build/tests/browser/suites/mesh/solid.js +134 -0
  12. package/.build/tests/browser/suites/mesh/tetrahedral_solid.js +116 -0
  13. package/.build/tests/browser/suites/mesh/triangulated_surface.js +114 -0
  14. package/.build/tests/browser/suites/model/blocks.js +92 -0
  15. package/.build/tests/browser/suites/model/collections.js +60 -0
  16. package/.build/tests/browser/suites/model/corners.js +71 -0
  17. package/.build/tests/browser/suites/model/display.js +62 -0
  18. package/.build/tests/browser/suites/model/edges.js +59 -0
  19. package/.build/tests/browser/suites/model/lines.js +88 -0
  20. package/.build/tests/browser/suites/model/points.js +59 -0
  21. package/.build/tests/browser/suites/model/structural_model.js +105 -0
  22. package/.build/tests/browser/suites/model/surfaces.js +107 -0
  23. package/.build/tests/browser/suites/object_tree/component_relations.js +40 -0
  24. package/.build/tests/browser/suites/object_tree/controls.js +125 -0
  25. package/.build/tests/browser/suites/object_tree/group_context_menu.js +71 -0
  26. package/.build/tests/browser/suites/object_tree/multi_type_import.js +20 -0
  27. package/.build/tests/browser/suites/time_series.js +107 -0
  28. package/app/components/Viewer/ObjectTree/Base/TreeRow.vue +2 -2
  29. package/app/components/Viewer/ObjectTree/Views/ModelTree.vue +10 -3
  30. package/app/composables/model_tree.ts +118 -4
  31. package/app/composables/tree_keyboard_nav.ts +2 -2
  32. package/app/composables/virtual_tree.ts +14 -1
  33. package/app/composables/virtual_tree_flatten.ts +33 -10
  34. package/app/composables/virtual_tree_types.ts +4 -0
  35. package/app/stores/data.ts +2 -1
  36. package/app/stores/data_helpers/relations.ts +36 -1
  37. package/package.json +7 -1
  38. package/tests/browser/data/grid.og_rgd3d +0 -0
  39. package/tests/browser/data/model_time_series.og_brep +0 -0
  40. package/tests/browser/data/test.og_brep +0 -0
  41. package/tests/browser/data/test.og_edc3d +0 -0
  42. package/tests/browser/data/test.og_hso3d +0 -0
  43. package/tests/browser/data/test.og_psf3d +0 -0
  44. package/tests/browser/data/test.og_pts3d +0 -0
  45. package/tests/browser/data/test.og_rgd2d +4 -0
  46. package/tests/browser/data/test.og_strm +0 -0
  47. package/tests/browser/data/test.og_tsf3d +0 -0
  48. package/tests/browser/data/test.og_tso3d +0 -0
  49. package/tests/browser/data/test_texture.png +0 -0
  50. package/tests/browser/data/test_translated.og_psf3d +0 -0
  51. package/tests/browser/data/time_series.og_psf3d +0 -0
  52. package/tests/browser/helpers/object_trees/model_component_relations.ts +39 -0
  53. package/tests/browser/helpers/suite_runtime.ts +28 -0
  54. package/tests/browser/suites/grid_scale.ts +48 -0
  55. package/tests/browser/suites/index.ts +22 -0
  56. package/tests/browser/suites/mesh/edged_curve.ts +125 -0
  57. package/tests/browser/suites/mesh/grid2d.ts +150 -0
  58. package/tests/browser/suites/mesh/grid3d.ts +149 -0
  59. package/tests/browser/suites/mesh/point_set.ts +98 -0
  60. package/tests/browser/suites/mesh/polygonal_surface.ts +206 -0
  61. package/tests/browser/suites/mesh/solid.ts +183 -0
  62. package/tests/browser/suites/mesh/tetrahedral_solid.ts +160 -0
  63. package/tests/browser/suites/mesh/triangulated_surface.ts +157 -0
  64. package/tests/browser/suites/model/blocks.ts +135 -0
  65. package/tests/browser/suites/model/collections.ts +85 -0
  66. package/tests/browser/suites/model/corners.ts +103 -0
  67. package/tests/browser/suites/model/display.ts +89 -0
  68. package/tests/browser/suites/model/edges.ts +106 -0
  69. package/tests/browser/suites/model/lines.ts +124 -0
  70. package/tests/browser/suites/model/points.ts +106 -0
  71. package/tests/browser/suites/model/structural_model.ts +145 -0
  72. package/tests/browser/suites/model/surfaces.ts +165 -0
  73. package/tests/browser/suites/object_tree/component_relations.ts +66 -0
  74. package/tests/browser/suites/object_tree/controls.ts +194 -0
  75. package/tests/browser/suites/object_tree/group_context_menu.ts +101 -0
  76. package/tests/browser/suites/object_tree/multi_type_import.ts +32 -0
  77. package/tests/browser/suites/time_series.ts +151 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@geode/opengeodeweb-front",
3
- "version": "11.2.0-rc.2",
3
+ "version": "11.2.0-rc.4",
4
4
  "description": "OpenSource Vue/Nuxt/Pinia/Vuetify framework for web applications",
5
5
  "homepage": "https://github.com/Geode-solutions/OpenGeodeWeb-Front",
6
6
  "bugs": {
@@ -22,6 +22,8 @@
22
22
  "server",
23
23
  "shared",
24
24
  "tests/browser/helpers",
25
+ "tests/browser/suites",
26
+ "tests/browser/data",
25
27
  ".build",
26
28
  "nuxt.config.ts",
27
29
  "opengeodeweb_front_schemas.json",
@@ -47,6 +49,10 @@
47
49
  "types": "./tests/browser/helpers/*.ts",
48
50
  "default": "./.build/tests/browser/helpers/*.js"
49
51
  },
52
+ "./tests/browser/suites/*.js": {
53
+ "types": "./tests/browser/suites/*.ts",
54
+ "default": "./.build/tests/browser/suites/*.js"
55
+ },
50
56
  "./shared/*.js": {
51
57
  "types": "./shared/*.ts",
52
58
  "default": "./.build/shared/*.js"
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -0,0 +1,4 @@
1
+ [diffend] Oversized file quarantined before diffing.
2
+ name: package/tests/browser/data/test.og_rgd2d
3
+ size: 43896958 bytes
4
+ sha256: aa3a25d7faafdba30bff5df7c273b312a52bfdf761a3054d0a474c21d168b1ba
Binary file
Binary file
Binary file
@@ -0,0 +1,39 @@
1
+ // The relations of the components, under their rows in the model components tree
2
+
3
+ // Third party imports
4
+ import type { Locator, Page } from "@playwright/test";
5
+
6
+ // Local imports
7
+ import { getModelComponentsObjectTree } from "./model_components_object_tree";
8
+ import { moveMouseOutOfTheWay } from "#browser_helpers/app_interaction";
9
+ import { waitForActionSettled } from "#browser_helpers/wait_for_action_settled";
10
+
11
+ function getModelComponentsTreeRows(window: Page): Locator {
12
+ return getModelComponentsObjectTree(window).getByTestId("treeRowWrapper");
13
+ }
14
+
15
+ // The relation groups of the expanded components ("Boundaries (4)")
16
+ function getModelComponentBoundariesRows(window: Page): Locator {
17
+ return getModelComponentsTreeRows(window).filter({ hasText: "Boundaries (" });
18
+ }
19
+
20
+ // The first component of the opened type that has relations: its row can be expanded
21
+ function getFirstExpandableModelComponentRow(window: Page): Locator {
22
+ return getModelComponentsObjectTree(window)
23
+ .locator(".leaf-row")
24
+ .filter({ has: window.getByTestId("expandTreeRowButton") })
25
+ .first();
26
+ }
27
+
28
+ async function expandModelComponentRow(window: Page, row: Locator): Promise<void> {
29
+ await row.getByTestId("expandTreeRowButton").first().click();
30
+ await moveMouseOutOfTheWay(window);
31
+ await waitForActionSettled(window);
32
+ }
33
+
34
+ export {
35
+ expandModelComponentRow,
36
+ getFirstExpandableModelComponentRow,
37
+ getModelComponentBoundariesRows,
38
+ getModelComponentsTreeRows,
39
+ };
@@ -0,0 +1,28 @@
1
+ // What the shared suites need from the app running them: its test fixture (Playwright's in the apps, the Vitest
2
+ // Shim of ../shim in this layer) and its data loader
3
+
4
+ // Third party imports
5
+ import type { Locator, Page } from "@playwright/test";
6
+
7
+ interface SuiteFixtures {
8
+ window: Page;
9
+ screenshotMask: { locators: Locator[] };
10
+ }
11
+
12
+ interface SuiteTest {
13
+ (title: string, body: (fixtures: SuiteFixtures) => Promise<void>): void;
14
+ describe: { configure: (options: { mode: "serial" }) => void };
15
+ slow: () => void;
16
+ }
17
+
18
+ interface SuiteRuntime {
19
+ test: SuiteTest;
20
+ // Loads files of tests/browser/data
21
+ loadTestDatas: (
22
+ window: Page,
23
+ inputDataFilenames: string[],
24
+ options?: { loadTimeout?: number },
25
+ ) => Promise<void>;
26
+ }
27
+
28
+ export type { SuiteFixtures, SuiteRuntime, SuiteTest };
@@ -0,0 +1,48 @@
1
+ // Node imports
2
+
3
+ // Third party imports
4
+
5
+ // Local imports
6
+ import {
7
+ removeClippingPlanes,
8
+ resetClippingPlanes,
9
+ toggleClippingPlanes,
10
+ } from "#browser_helpers/clipping_planes_interaction";
11
+ import { resetCamera, toggleGridScale } from "#browser_helpers/camera_interaction";
12
+ import { moveMouseOutOfTheWay } from "#browser_helpers/app_interaction";
13
+
14
+ import type { SuiteRuntime } from "#browser_helpers/suite_runtime";
15
+
16
+ // Constants
17
+ const brepFilename = "test.og_brep";
18
+ const rgd3dFilename = "grid.og_rgd3d";
19
+
20
+ // Shared with the apps built on this layer: each one runs it with its own test fixture and data loader
21
+ function registerTests({ test, loadTestDatas }: SuiteRuntime): void {
22
+ test.describe.configure({ mode: "serial" });
23
+
24
+ test("load", async ({ window }) => {
25
+ await loadTestDatas(window, [brepFilename]);
26
+ await resetCamera(window);
27
+ });
28
+
29
+ test("grid scale fits the clipped data", async ({ window }) => {
30
+ await toggleClippingPlanes(window);
31
+ await toggleGridScale(window);
32
+ await moveMouseOutOfTheWay(window);
33
+ });
34
+
35
+ test("grid scale refits after clipping removal", async ({ window }) => {
36
+ await toggleClippingPlanes(window);
37
+ await removeClippingPlanes(window);
38
+ await moveMouseOutOfTheWay(window);
39
+ });
40
+
41
+ test("grid scale fits data imported with an active clipping", async ({ window }) => {
42
+ await resetClippingPlanes(window);
43
+ await loadTestDatas(window, [rgd3dFilename]);
44
+ await resetCamera(window);
45
+ });
46
+ }
47
+
48
+ export { registerTests };
@@ -0,0 +1,22 @@
1
+ // Every shared suite, by its path in tests/browser/suites without .ts (e.g. "mesh/edged_curve"): the apps built on this
2
+ // Layer run them all from one test file, each suite in its own describe. Collected from the folder, a new suite file is
3
+ // Run by these apps without any change on their side
4
+
5
+ import type { SuiteRuntime } from "#browser_helpers/suite_runtime";
6
+
7
+ interface SuiteModule {
8
+ registerTests: (runtime: SuiteRuntime) => void;
9
+ }
10
+
11
+ const SUITE_PATH_REGEX = /^\.\/(?<name>.+)\.ts$/u;
12
+
13
+ const suiteModules = import.meta.glob<SuiteModule>(["./**/*.ts", "!./index.ts"], { eager: true });
14
+
15
+ const suites: Record<string, SuiteModule["registerTests"]> = Object.fromEntries(
16
+ Object.entries(suiteModules).map(([file, { registerTests }]) => [
17
+ SUITE_PATH_REGEX.exec(file)?.groups?.name ?? file,
18
+ registerTests,
19
+ ]),
20
+ );
21
+
22
+ export { suites };
@@ -0,0 +1,125 @@
1
+ // Node imports
2
+ // Third party imports
3
+ // Local imports
4
+ import { defaultDataName, edgedCurveGeodeObjectType } from "#browser_helpers/constants";
5
+ import {
6
+ expandMainObjectTree,
7
+ highlightData,
8
+ } from "#browser_helpers/object_trees/main_object_tree";
9
+ import {
10
+ openMeshEdgesMenu,
11
+ setMeshEdgesColorWithSlider,
12
+ setMeshEdgesEdgeAttribute,
13
+ setMeshEdgesItem,
14
+ setMeshEdgesNoDataColor,
15
+ setMeshEdgesOpacity,
16
+ setMeshEdgesVertexAttribute,
17
+ setMeshEdgesVisibility,
18
+ setMeshEdgesWidth,
19
+ setMeshPointsColorWithSlider,
20
+ setMeshPointsSize,
21
+ setMeshPointsVisibility,
22
+ } from "#browser_helpers/data/index";
23
+ import { toggleInfoCard, viewerContextMenu } from "#browser_helpers/viewer_interaction";
24
+
25
+ import type { SuiteRuntime } from "#browser_helpers/suite_runtime";
26
+
27
+ // Constants
28
+ const inputFilename = "test.og_edc3d";
29
+ const edgeAttributeName = "test_edge";
30
+ const edgeAttributeColorMap = "acton";
31
+ const vertexAttributeName = "test_vertex";
32
+ const vertexAttributeName2 = "test_vertex2";
33
+ const vertexAttributeColorMap = "vikO";
34
+ const edgesOpacity = 50;
35
+ const edgesWidth = 5;
36
+ const pointsSize = 2;
37
+
38
+ // Shared with the apps built on this layer: each one runs it with its own test fixture and data loader
39
+ function registerTests({ test, loadTestDatas }: SuiteRuntime): void {
40
+ test.describe.configure({ mode: "serial" });
41
+
42
+ test("load", async ({ window }) => {
43
+ await loadTestDatas(window, [inputFilename]);
44
+ await expandMainObjectTree(window);
45
+ });
46
+
47
+ test("highlight", async ({ window, screenshotMask }) => {
48
+ await highlightData(window, edgedCurveGeodeObjectType, defaultDataName);
49
+ screenshotMask.locators = [window.getByTestId("tooltipIdValue")];
50
+ });
51
+
52
+ test("viewer context menu", async ({ window }) => {
53
+ const x = 549;
54
+ const y = 210;
55
+ await viewerContextMenu(window, x, y);
56
+ });
57
+
58
+ test("info card", async ({ window }) => {
59
+ await toggleInfoCard(window);
60
+ });
61
+
62
+ test("points visibility", async ({ window }) => {
63
+ await toggleInfoCard(window);
64
+ await setMeshPointsVisibility(window, false);
65
+ });
66
+
67
+ test("edge attribute", async ({ window }) => {
68
+ await setMeshPointsVisibility(window, true);
69
+ await setMeshEdgesEdgeAttribute(window, edgeAttributeName, { colorMap: edgeAttributeColorMap });
70
+ });
71
+
72
+ test("edge attribute change item to 2", async ({ window }) => {
73
+ await setMeshEdgesItem(window, 1);
74
+ });
75
+
76
+ test("edge attribute reopen menu", async ({ window }) => {
77
+ await openMeshEdgesMenu(window);
78
+ });
79
+
80
+ test("vertex attribute", async ({ window }) => {
81
+ await setMeshEdgesVertexAttribute(window, vertexAttributeName, {
82
+ item: 2,
83
+ colorMap: vertexAttributeColorMap,
84
+ });
85
+ });
86
+
87
+ test("vertex attribute unmapped elements color", async ({ window }) => {
88
+ await setMeshEdgesNoDataColor(window);
89
+ });
90
+
91
+ test("vertex attribute change attribute name", async ({ window }) => {
92
+ await setMeshEdgesVertexAttribute(window, vertexAttributeName2);
93
+ });
94
+
95
+ test("vertex attribute switch back to first attribute", async ({ window }) => {
96
+ await setMeshEdgesVertexAttribute(window, vertexAttributeName);
97
+ });
98
+
99
+ test("edges color", async ({ window }) => {
100
+ await setMeshEdgesColorWithSlider(window);
101
+ });
102
+
103
+ test("edges opacity", async ({ window }) => {
104
+ await setMeshEdgesOpacity(window, edgesOpacity);
105
+ });
106
+
107
+ test("edges width", async ({ window }) => {
108
+ await setMeshEdgesWidth(window, edgesWidth);
109
+ });
110
+
111
+ test("edges visibility", async ({ window }) => {
112
+ await setMeshEdgesVisibility(window, false);
113
+ });
114
+
115
+ test("points color", async ({ window }) => {
116
+ await setMeshEdgesVisibility(window, true);
117
+ await setMeshPointsColorWithSlider(window);
118
+ });
119
+
120
+ test("points size", async ({ window }) => {
121
+ await setMeshPointsSize(window, pointsSize);
122
+ });
123
+ }
124
+
125
+ export { registerTests };
@@ -0,0 +1,150 @@
1
+ // Node imports
2
+
3
+ // Third party imports
4
+
5
+ // Local imports
6
+ import { defaultDataName, rgd2dGeodeObjectType } from "#browser_helpers/constants";
7
+ import {
8
+ expandMainObjectTree,
9
+ highlightData,
10
+ } from "#browser_helpers/object_trees/main_object_tree";
11
+ import {
12
+ openMeshCellsMenu,
13
+ setMeshCellsCellAttribute,
14
+ setMeshCellsColorMap,
15
+ setMeshCellsColorWithSlider,
16
+ setMeshCellsItem,
17
+ setMeshCellsNoDataColor,
18
+ setMeshCellsOpacity,
19
+ setMeshCellsVertexAttribute,
20
+ setMeshCellsVisibility,
21
+ setMeshEdgesColorWithSlider,
22
+ setMeshEdgesVisibility,
23
+ setMeshEdgesWidth,
24
+ setMeshPointsColorWithSlider,
25
+ setMeshPointsSize,
26
+ setMeshPointsVisibility,
27
+ } from "#browser_helpers/data/index";
28
+ import { toggleInfoCard, viewerContextMenu } from "#browser_helpers/viewer_interaction";
29
+
30
+ import type { SuiteRuntime } from "#browser_helpers/suite_runtime";
31
+
32
+ // Constants
33
+ const inputFilename = "test.og_rgd2d";
34
+ const cellAttributeName = "test_cell";
35
+ const vertexAttributeName = "test_vertex";
36
+ const vertexAttributeName2 = "test_vertex2";
37
+ const colorMapName = "vikO";
38
+ const cellsOpacity = 50;
39
+ const pointsSize = 15;
40
+ const edgesWidth = 5;
41
+
42
+ // Shared with the apps built on this layer: each one runs it with its own test fixture and data loader
43
+ function registerTests({ test, loadTestDatas }: SuiteRuntime): void {
44
+ test.describe.configure({ mode: "serial" });
45
+
46
+ test("load", async ({ window }) => {
47
+ test.slow();
48
+ await loadTestDatas(window, [inputFilename]);
49
+ await expandMainObjectTree(window);
50
+ });
51
+
52
+ test("highlight", async ({ window, screenshotMask }) => {
53
+ await highlightData(window, rgd2dGeodeObjectType, defaultDataName);
54
+ screenshotMask.locators = [window.getByTestId("tooltipIdValue")];
55
+ });
56
+
57
+ test("viewer context menu", async ({ window }) => {
58
+ const x = 549;
59
+ const y = 360;
60
+ await viewerContextMenu(window, x, y);
61
+ });
62
+
63
+ test("info card", async ({ window }) => {
64
+ await toggleInfoCard(window);
65
+ });
66
+
67
+ test("points visibility", async ({ window }) => {
68
+ await toggleInfoCard(window);
69
+ await setMeshPointsVisibility(window, true);
70
+ });
71
+
72
+ test("cell attribute", async ({ window }) => {
73
+ await setMeshCellsCellAttribute(window, cellAttributeName, { item: 1 });
74
+ });
75
+
76
+ test("cell attribute change colormap", async ({ window }) => {
77
+ await setMeshCellsColorMap(window, colorMapName);
78
+ });
79
+
80
+ test("cell attribute change item to 1", async ({ window }) => {
81
+ await setMeshCellsItem(window, 0);
82
+ });
83
+
84
+ test("cell attribute change item to 2", async ({ window }) => {
85
+ await setMeshCellsItem(window, 1);
86
+ });
87
+
88
+ test("cell attribute reopen menu", async ({ window }) => {
89
+ await openMeshCellsMenu(window);
90
+ });
91
+
92
+ test("vertex attribute", async ({ window }) => {
93
+ await setMeshPointsVisibility(window, false);
94
+ await setMeshCellsVertexAttribute(window, vertexAttributeName, {
95
+ item: 1,
96
+ colorMap: colorMapName,
97
+ });
98
+ });
99
+
100
+ test("vertex attribute unmapped elements color", async ({ window }) => {
101
+ await setMeshCellsNoDataColor(window);
102
+ });
103
+
104
+ test("vertex attribute change attribute name", async ({ window }) => {
105
+ await setMeshCellsVertexAttribute(window, vertexAttributeName2);
106
+ });
107
+
108
+ test("vertex attribute switch back to first attribute", async ({ window }) => {
109
+ await setMeshCellsVertexAttribute(window, vertexAttributeName);
110
+ });
111
+
112
+ test("vertex attribute reopen menu", async ({ window }) => {
113
+ await openMeshCellsMenu(window);
114
+ });
115
+
116
+ test("cells color", async ({ window }) => {
117
+ await setMeshCellsColorWithSlider(window);
118
+ });
119
+
120
+ test("points color", async ({ window }) => {
121
+ await setMeshPointsColorWithSlider(window);
122
+ });
123
+
124
+ test("edges color", async ({ window }) => {
125
+ await setMeshEdgesColorWithSlider(window);
126
+ });
127
+
128
+ test("cells opacity", async ({ window }) => {
129
+ await setMeshCellsOpacity(window, cellsOpacity);
130
+ });
131
+
132
+ test("points size", async ({ window }) => {
133
+ await setMeshPointsSize(window, pointsSize);
134
+ });
135
+
136
+ test("edges width", async ({ window }) => {
137
+ await setMeshEdgesWidth(window, edgesWidth);
138
+ });
139
+
140
+ test("edges visibility", async ({ window }) => {
141
+ await setMeshEdgesVisibility(window, false);
142
+ });
143
+
144
+ test("cells visibility", async ({ window }) => {
145
+ await setMeshEdgesVisibility(window, true);
146
+ await setMeshCellsVisibility(window, false);
147
+ });
148
+ }
149
+
150
+ export { registerTests };
@@ -0,0 +1,149 @@
1
+ // Node imports
2
+
3
+ // Third party imports
4
+
5
+ // Local imports
6
+ import {
7
+ expandMainObjectTree,
8
+ highlightData,
9
+ } from "#browser_helpers/object_trees/main_object_tree";
10
+ import {
11
+ openMeshCellsMenu,
12
+ setMeshCellsCellAttribute,
13
+ setMeshCellsColor,
14
+ setMeshCellsColorMap,
15
+ setMeshCellsItem,
16
+ setMeshCellsNoDataColor,
17
+ setMeshCellsOpacity,
18
+ setMeshCellsVertexAttribute,
19
+ setMeshCellsVisibility,
20
+ setMeshEdgesColor,
21
+ setMeshEdgesVisibility,
22
+ setMeshEdgesWidth,
23
+ setMeshPointsColor,
24
+ setMeshPointsSize,
25
+ setMeshPointsVisibility,
26
+ } from "#browser_helpers/data/index";
27
+ import { toggleInfoCard, viewerContextMenu } from "#browser_helpers/viewer_interaction";
28
+ import { rgd3dGeodeObjectType } from "#browser_helpers/constants";
29
+
30
+ import type { SuiteRuntime } from "#browser_helpers/suite_runtime";
31
+
32
+ // Constants
33
+ const inputFilename = "grid.og_rgd3d";
34
+ const cellAttributeName = "test_cell";
35
+ const vertexAttributeName = "test_vertex";
36
+ const vertexAttributeName2 = "test_vertex2";
37
+ const colorMapName = "vikO";
38
+ const cellsOpacity = 50;
39
+ const pointsSize = 15;
40
+ const edgesWidth = 5;
41
+
42
+ // Shared with the apps built on this layer: each one runs it with its own test fixture and data loader
43
+ function registerTests({ test, loadTestDatas }: SuiteRuntime): void {
44
+ test.describe.configure({ mode: "serial" });
45
+
46
+ test("load", async ({ window }) => {
47
+ await loadTestDatas(window, [inputFilename]);
48
+ await expandMainObjectTree(window);
49
+ });
50
+
51
+ test("highlight", async ({ window, screenshotMask }) => {
52
+ await highlightData(window, rgd3dGeodeObjectType, "grid");
53
+ screenshotMask.locators = [window.getByTestId("tooltipIdValue")];
54
+ });
55
+
56
+ test("viewer context menu", async ({ window }) => {
57
+ const x = 549;
58
+ const y = 360;
59
+ await viewerContextMenu(window, x, y);
60
+ });
61
+
62
+ test("info card", async ({ window }) => {
63
+ await toggleInfoCard(window);
64
+ });
65
+
66
+ test("points visibility", async ({ window }) => {
67
+ await toggleInfoCard(window);
68
+ await setMeshPointsVisibility(window, true);
69
+ });
70
+
71
+ test("cell attribute", async ({ window }) => {
72
+ await setMeshPointsVisibility(window, false);
73
+ await setMeshCellsCellAttribute(window, cellAttributeName);
74
+ });
75
+
76
+ test("cell attribute change colormap", async ({ window }) => {
77
+ await setMeshCellsColorMap(window, colorMapName);
78
+ });
79
+
80
+ test("cell attribute reopen menu", async ({ window }) => {
81
+ await openMeshCellsMenu(window);
82
+ });
83
+
84
+ test("vertex attribute", async ({ window }) => {
85
+ await setMeshCellsVertexAttribute(window, vertexAttributeName, {
86
+ item: 1,
87
+ colorMap: colorMapName,
88
+ });
89
+ });
90
+
91
+ test("vertex attribute unmapped elements color", async ({ window }) => {
92
+ await setMeshCellsNoDataColor(window);
93
+ });
94
+
95
+ test("vertex attribute change item to 1", async ({ window }) => {
96
+ await setMeshCellsItem(window, 0);
97
+ });
98
+
99
+ test("vertex attribute change item to 2", async ({ window }) => {
100
+ await setMeshCellsItem(window, 1);
101
+ });
102
+
103
+ test("vertex attribute change attribute name", async ({ window }) => {
104
+ await setMeshCellsVertexAttribute(window, vertexAttributeName2);
105
+ });
106
+
107
+ test("vertex attribute switch back to first attribute", async ({ window }) => {
108
+ await setMeshCellsVertexAttribute(window, vertexAttributeName);
109
+ });
110
+
111
+ test("vertex attribute reopen menu", async ({ window }) => {
112
+ await openMeshCellsMenu(window);
113
+ });
114
+
115
+ test("cells color", async ({ window }) => {
116
+ await setMeshCellsColor(window);
117
+ });
118
+
119
+ test("points color", async ({ window }) => {
120
+ await setMeshPointsColor(window);
121
+ });
122
+
123
+ test("edges color", async ({ window }) => {
124
+ await setMeshEdgesColor(window);
125
+ });
126
+
127
+ test("cells opacity", async ({ window }) => {
128
+ await setMeshCellsOpacity(window, cellsOpacity);
129
+ });
130
+
131
+ test("points size", async ({ window }) => {
132
+ await setMeshPointsSize(window, pointsSize);
133
+ });
134
+
135
+ test("edges width", async ({ window }) => {
136
+ await setMeshEdgesWidth(window, edgesWidth);
137
+ });
138
+
139
+ test("edges visibility", async ({ window }) => {
140
+ await setMeshEdgesVisibility(window, false);
141
+ });
142
+
143
+ test("cells visibility", async ({ window }) => {
144
+ await setMeshEdgesVisibility(window, true);
145
+ await setMeshCellsVisibility(window, false);
146
+ });
147
+ }
148
+
149
+ export { registerTests };