vease 2.2.0-rc.1 → 2.2.0

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 (137) hide show
  1. package/.build/tests/e2e/utils/create_objects.js +2 -3
  2. package/.build/tests/e2e/utils/crs.js +4 -4
  3. package/.build/tests/e2e/utils/crs_flows.js +3 -3
  4. package/.build/tests/e2e/utils/data_manager.js +2 -2
  5. package/.build/tests/e2e/utils/extension.js +2 -2
  6. package/.build/tests/e2e/utils/fixtures.js +1 -1
  7. package/.build/tests/e2e/utils/load.js +1 -1
  8. package/.build/tests/e2e/utils/project_interaction.js +2 -2
  9. package/package.json +10 -7
  10. package/tests/e2e/utils/create_objects.ts +2 -2
  11. package/tests/e2e/utils/crs.ts +7 -4
  12. package/tests/e2e/utils/crs_flows.ts +3 -3
  13. package/tests/e2e/utils/data_manager.ts +2 -2
  14. package/tests/e2e/utils/extension.ts +2 -2
  15. package/tests/e2e/utils/fixtures.ts +1 -1
  16. package/tests/e2e/utils/load.ts +1 -1
  17. package/tests/e2e/utils/project_interaction.ts +2 -2
  18. package/.build/tests/e2e/utils/app_interaction.js +0 -24
  19. package/.build/tests/e2e/utils/basemap.js +0 -55
  20. package/.build/tests/e2e/utils/camera_filters.js +0 -105
  21. package/.build/tests/e2e/utils/camera_interaction.js +0 -107
  22. package/.build/tests/e2e/utils/camera_tools.js +0 -43
  23. package/.build/tests/e2e/utils/clipping_planes_interaction.js +0 -80
  24. package/.build/tests/e2e/utils/constants.js +0 -43
  25. package/.build/tests/e2e/utils/data/constants.js +0 -26
  26. package/.build/tests/e2e/utils/data/helpers/attribute.js +0 -85
  27. package/.build/tests/e2e/utils/data/helpers/attribute_colors.js +0 -47
  28. package/.build/tests/e2e/utils/data/helpers/attribute_menu.js +0 -13
  29. package/.build/tests/e2e/utils/data/helpers/color.js +0 -98
  30. package/.build/tests/e2e/utils/data/helpers/color_picker.js +0 -52
  31. package/.build/tests/e2e/utils/data/helpers/textures.js +0 -26
  32. package/.build/tests/e2e/utils/data/index.js +0 -28
  33. package/.build/tests/e2e/utils/data/mesh/cells/attribute.js +0 -43
  34. package/.build/tests/e2e/utils/data/mesh/cells/color.js +0 -26
  35. package/.build/tests/e2e/utils/data/mesh/cells/index.js +0 -4
  36. package/.build/tests/e2e/utils/data/mesh/cells/visibility.js +0 -9
  37. package/.build/tests/e2e/utils/data/mesh/edges/attribute.js +0 -43
  38. package/.build/tests/e2e/utils/data/mesh/edges/color.js +0 -26
  39. package/.build/tests/e2e/utils/data/mesh/edges/index.js +0 -5
  40. package/.build/tests/e2e/utils/data/mesh/edges/visibility.js +0 -9
  41. package/.build/tests/e2e/utils/data/mesh/edges/width.js +0 -9
  42. package/.build/tests/e2e/utils/data/mesh/index.js +0 -24
  43. package/.build/tests/e2e/utils/data/mesh/points/attribute.js +0 -31
  44. package/.build/tests/e2e/utils/data/mesh/points/color.js +0 -26
  45. package/.build/tests/e2e/utils/data/mesh/points/index.js +0 -5
  46. package/.build/tests/e2e/utils/data/mesh/points/size.js +0 -9
  47. package/.build/tests/e2e/utils/data/mesh/points/visibility.js +0 -9
  48. package/.build/tests/e2e/utils/data/mesh/polygon/attribute.js +0 -47
  49. package/.build/tests/e2e/utils/data/mesh/polygon/color.js +0 -26
  50. package/.build/tests/e2e/utils/data/mesh/polygon/index.js +0 -5
  51. package/.build/tests/e2e/utils/data/mesh/polygon/textures.js +0 -14
  52. package/.build/tests/e2e/utils/data/mesh/polygon/visibility.js +0 -9
  53. package/.build/tests/e2e/utils/data/mesh/polyhedra/attribute.js +0 -43
  54. package/.build/tests/e2e/utils/data/mesh/polyhedra/color.js +0 -29
  55. package/.build/tests/e2e/utils/data/mesh/polyhedra/index.js +0 -4
  56. package/.build/tests/e2e/utils/data/mesh/polyhedra/visibility.js +0 -9
  57. package/.build/tests/e2e/utils/data/model/attribute.js +0 -99
  58. package/.build/tests/e2e/utils/data/model/color.js +0 -69
  59. package/.build/tests/e2e/utils/data/model/edges/components.js +0 -50
  60. package/.build/tests/e2e/utils/data/model/edges/index.js +0 -3
  61. package/.build/tests/e2e/utils/data/model/edges/visibility.js +0 -9
  62. package/.build/tests/e2e/utils/data/model/index.js +0 -11
  63. package/.build/tests/e2e/utils/data/model/points/components.js +0 -50
  64. package/.build/tests/e2e/utils/data/model/points/index.js +0 -3
  65. package/.build/tests/e2e/utils/data/model/points/visibility.js +0 -9
  66. package/.build/tests/e2e/utils/data/model/style_menu.js +0 -10
  67. package/.build/tests/e2e/utils/data/model/surfaces/index.js +0 -2
  68. package/.build/tests/e2e/utils/data/model/surfaces/visibility.js +0 -8
  69. package/.build/tests/e2e/utils/model_tabs.js +0 -35
  70. package/.build/tests/e2e/utils/object_trees/common.js +0 -122
  71. package/.build/tests/e2e/utils/object_trees/main_object_tree.js +0 -86
  72. package/.build/tests/e2e/utils/object_trees/model_components_object_tree.js +0 -111
  73. package/.build/tests/e2e/utils/other.js +0 -13
  74. package/.build/tests/e2e/utils/viewer_canvas.js +0 -83
  75. package/.build/tests/e2e/utils/viewer_interaction.js +0 -87
  76. package/.build/tests/e2e/utils/viewer_menu.js +0 -98
  77. package/.build/tests/e2e/utils/wait_for_action_settled.js +0 -63
  78. package/tests/e2e/utils/app_interaction.ts +0 -35
  79. package/tests/e2e/utils/basemap.ts +0 -89
  80. package/tests/e2e/utils/camera_filters.ts +0 -176
  81. package/tests/e2e/utils/camera_interaction.ts +0 -179
  82. package/tests/e2e/utils/camera_tools.ts +0 -62
  83. package/tests/e2e/utils/clipping_planes_interaction.ts +0 -126
  84. package/tests/e2e/utils/constants.ts +0 -100
  85. package/tests/e2e/utils/data/constants.ts +0 -58
  86. package/tests/e2e/utils/data/helpers/attribute.ts +0 -156
  87. package/tests/e2e/utils/data/helpers/attribute_colors.ts +0 -83
  88. package/tests/e2e/utils/data/helpers/attribute_menu.ts +0 -19
  89. package/tests/e2e/utils/data/helpers/color.ts +0 -214
  90. package/tests/e2e/utils/data/helpers/color_picker.ts +0 -82
  91. package/tests/e2e/utils/data/helpers/textures.ts +0 -41
  92. package/tests/e2e/utils/data/index.ts +0 -2
  93. package/tests/e2e/utils/data/mesh/cells/attribute.ts +0 -103
  94. package/tests/e2e/utils/data/mesh/cells/color.ts +0 -52
  95. package/tests/e2e/utils/data/mesh/cells/index.ts +0 -3
  96. package/tests/e2e/utils/data/mesh/cells/visibility.ts +0 -9
  97. package/tests/e2e/utils/data/mesh/edges/attribute.ts +0 -103
  98. package/tests/e2e/utils/data/mesh/edges/color.ts +0 -52
  99. package/tests/e2e/utils/data/mesh/edges/index.ts +0 -4
  100. package/tests/e2e/utils/data/mesh/edges/visibility.ts +0 -9
  101. package/tests/e2e/utils/data/mesh/edges/width.ts +0 -9
  102. package/tests/e2e/utils/data/mesh/index.ts +0 -6
  103. package/tests/e2e/utils/data/mesh/points/attribute.ts +0 -66
  104. package/tests/e2e/utils/data/mesh/points/color.ts +0 -52
  105. package/tests/e2e/utils/data/mesh/points/index.ts +0 -4
  106. package/tests/e2e/utils/data/mesh/points/size.ts +0 -9
  107. package/tests/e2e/utils/data/mesh/points/visibility.ts +0 -9
  108. package/tests/e2e/utils/data/mesh/polygon/attribute.ts +0 -110
  109. package/tests/e2e/utils/data/mesh/polygon/color.ts +0 -52
  110. package/tests/e2e/utils/data/mesh/polygon/index.ts +0 -4
  111. package/tests/e2e/utils/data/mesh/polygon/textures.ts +0 -21
  112. package/tests/e2e/utils/data/mesh/polygon/visibility.ts +0 -9
  113. package/tests/e2e/utils/data/mesh/polyhedra/attribute.ts +0 -103
  114. package/tests/e2e/utils/data/mesh/polyhedra/color.ts +0 -58
  115. package/tests/e2e/utils/data/mesh/polyhedra/index.ts +0 -3
  116. package/tests/e2e/utils/data/mesh/polyhedra/visibility.ts +0 -9
  117. package/tests/e2e/utils/data/model/attribute.ts +0 -180
  118. package/tests/e2e/utils/data/model/color.ts +0 -110
  119. package/tests/e2e/utils/data/model/edges/components.ts +0 -97
  120. package/tests/e2e/utils/data/model/edges/index.ts +0 -2
  121. package/tests/e2e/utils/data/model/edges/visibility.ts +0 -9
  122. package/tests/e2e/utils/data/model/index.ts +0 -5
  123. package/tests/e2e/utils/data/model/points/components.ts +0 -97
  124. package/tests/e2e/utils/data/model/points/index.ts +0 -2
  125. package/tests/e2e/utils/data/model/points/visibility.ts +0 -9
  126. package/tests/e2e/utils/data/model/style_menu.ts +0 -11
  127. package/tests/e2e/utils/data/model/surfaces/index.ts +0 -1
  128. package/tests/e2e/utils/data/model/surfaces/visibility.ts +0 -8
  129. package/tests/e2e/utils/model_tabs.ts +0 -61
  130. package/tests/e2e/utils/object_trees/common.ts +0 -212
  131. package/tests/e2e/utils/object_trees/main_object_tree.ts +0 -167
  132. package/tests/e2e/utils/object_trees/model_components_object_tree.ts +0 -219
  133. package/tests/e2e/utils/other.ts +0 -15
  134. package/tests/e2e/utils/viewer_canvas.ts +0 -136
  135. package/tests/e2e/utils/viewer_interaction.ts +0 -96
  136. package/tests/e2e/utils/viewer_menu.ts +0 -205
  137. package/tests/e2e/utils/wait_for_action_settled.ts +0 -108
@@ -1,180 +0,0 @@
1
- import {
2
- applyAttribute,
3
- setFeatureNoDataColor,
4
- setFeatureTimeStep,
5
- } from "@vease_tests/utils/data/helpers/attribute";
6
- import {
7
- cellAttributeType,
8
- edgeAttributeType,
9
- polygonAttributeType,
10
- polyhedronAttributeType,
11
- vertexAttributeType,
12
- } from "@vease_tests/utils/constants";
13
- import type { Page } from "@playwright/test";
14
- import { showModelStyleOptions } from "@vease_tests/utils/data/model/style_menu";
15
-
16
- interface AttributeOptions {
17
- item?: number;
18
- colorMap?: string;
19
- min?: number | string;
20
- max?: number | string;
21
- }
22
-
23
- async function setModelPointsVertexAttribute(
24
- window: Page,
25
- attributeName: string,
26
- options: AttributeOptions = {},
27
- ): Promise<void> {
28
- await showModelStyleOptions(window);
29
- await applyAttribute(window, "modelStyleMenu", {
30
- attributeType: vertexAttributeType,
31
- attributeName,
32
- ...options,
33
- });
34
- }
35
-
36
- async function setModelPointsVertexAttributeNoDataColor(window: Page): Promise<void> {
37
- await showModelStyleOptions(window);
38
- await setFeatureNoDataColor(window, "modelStyleMenu");
39
- }
40
-
41
- async function setModelEdgesVertexAttribute(
42
- window: Page,
43
- attributeName: string,
44
- options: AttributeOptions = {},
45
- ): Promise<void> {
46
- await showModelStyleOptions(window);
47
- await applyAttribute(window, "modelStyleMenu", {
48
- attributeType: vertexAttributeType,
49
- attributeName,
50
- ...options,
51
- });
52
- }
53
-
54
- async function setModelEdgesVertexAttributeNoDataColor(window: Page): Promise<void> {
55
- await showModelStyleOptions(window);
56
- await setFeatureNoDataColor(window, "modelStyleMenu");
57
- }
58
-
59
- async function setModelPolygonsVertexAttribute(
60
- window: Page,
61
- attributeName: string,
62
- options: AttributeOptions = {},
63
- ): Promise<void> {
64
- await showModelStyleOptions(window);
65
- await applyAttribute(window, "modelStyleMenu", {
66
- attributeType: vertexAttributeType,
67
- attributeName,
68
- ...options,
69
- });
70
- }
71
-
72
- async function setModelPolygonsVertexAttributeNoDataColor(window: Page): Promise<void> {
73
- await showModelStyleOptions(window);
74
- await setFeatureNoDataColor(window, "modelStyleMenu");
75
- }
76
-
77
- async function setModelPolyhedraVertexAttribute(
78
- window: Page,
79
- attributeName: string,
80
- options: AttributeOptions = {},
81
- ): Promise<void> {
82
- await showModelStyleOptions(window);
83
- await applyAttribute(window, "modelStyleMenu", {
84
- attributeType: vertexAttributeType,
85
- attributeName,
86
- ...options,
87
- });
88
- }
89
-
90
- async function setModelPolyhedraVertexAttributeNoDataColor(window: Page): Promise<void> {
91
- await showModelStyleOptions(window);
92
- await setFeatureNoDataColor(window, "modelStyleMenu");
93
- }
94
-
95
- async function setModelCellsVertexAttribute(
96
- window: Page,
97
- attributeName: string,
98
- options: AttributeOptions = {},
99
- ): Promise<void> {
100
- await showModelStyleOptions(window);
101
- await applyAttribute(window, "modelStyleMenu", {
102
- attributeType: vertexAttributeType,
103
- attributeName,
104
- ...options,
105
- });
106
- }
107
-
108
- async function setModelEdgesEdgeAttribute(
109
- window: Page,
110
- attributeName: string,
111
- options: AttributeOptions = {},
112
- ): Promise<void> {
113
- await showModelStyleOptions(window);
114
- await applyAttribute(window, "modelStyleMenu", {
115
- attributeType: edgeAttributeType,
116
- attributeName,
117
- ...options,
118
- });
119
- }
120
-
121
- async function setModelPolygonsPolygonAttribute(
122
- window: Page,
123
- attributeName: string,
124
- options: AttributeOptions = {},
125
- ): Promise<void> {
126
- await showModelStyleOptions(window);
127
- await applyAttribute(window, "modelStyleMenu", {
128
- attributeType: polygonAttributeType,
129
- attributeName,
130
- ...options,
131
- });
132
- }
133
-
134
- async function setModelPolyhedraPolyhedronAttribute(
135
- window: Page,
136
- attributeName: string,
137
- options: AttributeOptions = {},
138
- ): Promise<void> {
139
- await showModelStyleOptions(window);
140
- await applyAttribute(window, "modelStyleMenu", {
141
- attributeType: polyhedronAttributeType,
142
- attributeName,
143
- ...options,
144
- });
145
- }
146
-
147
- async function setModelCellsCellAttribute(
148
- window: Page,
149
- attributeName: string,
150
- options: AttributeOptions = {},
151
- ): Promise<void> {
152
- await showModelStyleOptions(window);
153
- await applyAttribute(window, "modelStyleMenu", {
154
- attributeType: cellAttributeType,
155
- attributeName,
156
- ...options,
157
- });
158
- }
159
-
160
- async function setModelTimeStep(window: Page, timeStep: number): Promise<void> {
161
- await showModelStyleOptions(window);
162
- await setFeatureTimeStep(window, window.getByTestId("modelStyleMenu"), timeStep);
163
- }
164
-
165
- export {
166
- setModelCellsCellAttribute,
167
- setModelCellsVertexAttribute,
168
- setModelEdgesEdgeAttribute,
169
- setModelEdgesVertexAttribute,
170
- setModelEdgesVertexAttributeNoDataColor,
171
- setModelPointsVertexAttribute,
172
- setModelPointsVertexAttributeNoDataColor,
173
- setModelPolygonsPolygonAttribute,
174
- setModelPolygonsVertexAttribute,
175
- setModelPolygonsVertexAttributeNoDataColor,
176
- setModelPolyhedraPolyhedronAttribute,
177
- setModelPolyhedraVertexAttribute,
178
- setModelPolyhedraVertexAttributeNoDataColor,
179
- setModelTimeStep,
180
- };
@@ -1,110 +0,0 @@
1
- import {
2
- copyColor,
3
- pasteColorInput,
4
- setColor,
5
- setColorInput,
6
- setColorWithSlider,
7
- setColoringStyle,
8
- setOpacity,
9
- } from "@vease_tests/utils/data/helpers/color";
10
- import type { Page } from "@playwright/test";
11
- import { showModelStyleOptions } from "@vease_tests/utils/data/model/style_menu";
12
-
13
- async function setModelOpacity(window: Page, percent: number): Promise<void> {
14
- await showModelStyleOptions(window);
15
- await setOpacity(window, "modelStyleMenu", percent);
16
- }
17
-
18
- async function setModelColor(window: Page): Promise<void> {
19
- await showModelStyleOptions(window);
20
- await setColor(window, "modelStyleMenu");
21
- }
22
-
23
- async function setModelColorWithSlider(window: Page): Promise<void> {
24
- await showModelStyleOptions(window);
25
- await setColorWithSlider(window, "modelStyleMenu");
26
- }
27
-
28
- async function setModelColoringStyle(window: Page, style: string): Promise<void> {
29
- await showModelStyleOptions(window);
30
- await setColoringStyle(window, "modelStyleMenu", style);
31
- }
32
-
33
- async function copyModelPointsColor(window: Page): Promise<void> {
34
- await showModelStyleOptions(window);
35
- await copyColor(window, "modelStyleMenu");
36
- }
37
-
38
- async function setModelPointsColorInput(window: Page, colorText: string): Promise<void> {
39
- await showModelStyleOptions(window);
40
- await setColorInput(window, "modelStyleMenu", colorText);
41
- }
42
-
43
- async function pasteModelPointsColorInput(window: Page): Promise<void> {
44
- await showModelStyleOptions(window);
45
- await pasteColorInput(window, "modelStyleMenu");
46
- }
47
-
48
- async function copyModelEdgesColor(window: Page): Promise<void> {
49
- await showModelStyleOptions(window);
50
- await copyColor(window, "modelStyleMenu");
51
- }
52
-
53
- async function setModelEdgesColorInput(window: Page, colorText: string): Promise<void> {
54
- await showModelStyleOptions(window);
55
- await setColorInput(window, "modelStyleMenu", colorText);
56
- }
57
-
58
- async function pasteModelEdgesColorInput(window: Page): Promise<void> {
59
- await showModelStyleOptions(window);
60
- await pasteColorInput(window, "modelStyleMenu");
61
- }
62
-
63
- async function copyModelPolygonsColor(window: Page): Promise<void> {
64
- await showModelStyleOptions(window);
65
- await copyColor(window, "modelStyleMenu");
66
- }
67
-
68
- async function setModelPolygonsColorInput(window: Page, colorText: string): Promise<void> {
69
- await showModelStyleOptions(window);
70
- await setColorInput(window, "modelStyleMenu", colorText);
71
- }
72
-
73
- async function pasteModelPolygonsColorInput(window: Page): Promise<void> {
74
- await showModelStyleOptions(window);
75
- await pasteColorInput(window, "modelStyleMenu");
76
- }
77
-
78
- async function copyModelPolyhedraColor(window: Page): Promise<void> {
79
- await showModelStyleOptions(window);
80
- await copyColor(window, "modelStyleMenu");
81
- }
82
-
83
- async function setModelPolyhedraColorInput(window: Page, colorText: string): Promise<void> {
84
- await showModelStyleOptions(window);
85
- await setColorInput(window, "modelStyleMenu", colorText);
86
- }
87
-
88
- async function pasteModelPolyhedraColorInput(window: Page): Promise<void> {
89
- await showModelStyleOptions(window);
90
- await pasteColorInput(window, "modelStyleMenu");
91
- }
92
-
93
- export {
94
- copyModelEdgesColor,
95
- copyModelPointsColor,
96
- copyModelPolygonsColor,
97
- copyModelPolyhedraColor,
98
- pasteModelEdgesColorInput,
99
- pasteModelPointsColorInput,
100
- pasteModelPolygonsColorInput,
101
- pasteModelPolyhedraColorInput,
102
- setModelColor,
103
- setModelColorWithSlider,
104
- setModelColoringStyle,
105
- setModelEdgesColorInput,
106
- setModelOpacity,
107
- setModelPointsColorInput,
108
- setModelPolygonsColorInput,
109
- setModelPolyhedraColorInput,
110
- };
@@ -1,97 +0,0 @@
1
- import type { Locator, Page } from "@playwright/test";
2
- import { ensureFeatureVisible, ensureMenuOpen } from "@vease_tests/utils/viewer_interaction";
3
- import { applyAttribute } from "@vease_tests/utils/data/helpers/attribute";
4
- import { selectModelTab } from "@vease_tests/utils/model_tabs";
5
- import { setColor } from "@vease_tests/utils/data/helpers/color";
6
- import { vertexAttributeType } from "@vease_tests/utils/constants";
7
- import { waitForActionSettled } from "@vease_tests/utils/wait_for_action_settled";
8
-
9
- const modelEdgesMenuTestId = "modelEdgesMenu";
10
-
11
- // Sections of the model edges card, shown depending on what the context menu targets
12
- type ModelEdgesSection =
13
- | "modelEdgesComponentsOptions"
14
- | "modelEdgesComponentTypeOptions"
15
- | "modelEdgesComponentOptions";
16
-
17
- interface AttributeOptions {
18
- item?: number;
19
- colorMap?: string;
20
- min?: number | string;
21
- max?: number | string;
22
- }
23
-
24
- function getModelEdgesSection(window: Page, section: ModelEdgesSection): Locator {
25
- return window.getByTestId(section).filter({ visible: true }).first();
26
- }
27
-
28
- const SECTION_TABS = {
29
- modelEdgesComponentsOptions: "components",
30
- modelEdgesComponentTypeOptions: "type",
31
- modelEdgesComponentOptions: "component",
32
- } as const;
33
-
34
- async function setModelComponentsEdgesVisibility(
35
- window: Page,
36
- section: ModelEdgesSection,
37
- visibility: boolean,
38
- ): Promise<void> {
39
- await ensureMenuOpen(window, modelEdgesMenuTestId);
40
- await ensureFeatureVisible(window, modelEdgesMenuTestId);
41
- await selectModelTab(window, SECTION_TABS[section]);
42
- const visibilitySwitch = getModelEdgesSection(window, section)
43
- .getByTestId("modelComponentEdgesVisibilitySwitch")
44
- .getByRole("checkbox");
45
- if ((await visibilitySwitch.isChecked()) !== visibility) {
46
- await visibilitySwitch.setChecked(visibility, { force: true });
47
- await waitForActionSettled(window);
48
- }
49
- }
50
-
51
- async function setModelComponentsEdgesWidth(
52
- window: Page,
53
- section: ModelEdgesSection,
54
- value: number,
55
- ): Promise<void> {
56
- await setModelComponentsEdgesVisibility(window, section, true);
57
- await getModelEdgesSection(window, section)
58
- .getByTestId("modelComponentEdgesWidthSlider")
59
- .locator("input")
60
- .first()
61
- .evaluate((node: HTMLInputElement, val: string) => {
62
- node.value = val;
63
- node.dispatchEvent(new Event("input", { bubbles: true }));
64
- node.dispatchEvent(new Event("change", { bubbles: true }));
65
- }, value.toString());
66
- await waitForActionSettled(window);
67
- }
68
-
69
- async function setModelComponentsEdgesColor(
70
- window: Page,
71
- section: ModelEdgesSection,
72
- ): Promise<void> {
73
- await setModelComponentsEdgesVisibility(window, section, true);
74
- await setColor(window, modelEdgesMenuTestId, getModelEdgesSection(window, section));
75
- }
76
-
77
- async function setModelComponentsEdgesVertexAttribute(
78
- window: Page,
79
- section: ModelEdgesSection,
80
- attributeName: string,
81
- options: AttributeOptions = {},
82
- ): Promise<void> {
83
- await setModelComponentsEdgesVisibility(window, section, true);
84
- await applyAttribute(window, getModelEdgesSection(window, section), {
85
- attributeType: vertexAttributeType,
86
- attributeName,
87
- ...options,
88
- });
89
- }
90
-
91
- export {
92
- setModelComponentsEdgesColor,
93
- setModelComponentsEdgesWidth,
94
- setModelComponentsEdgesVertexAttribute,
95
- setModelComponentsEdgesVisibility,
96
- };
97
- export type { ModelEdgesSection };
@@ -1,2 +0,0 @@
1
- export * from "./components";
2
- export * from "./visibility";
@@ -1,9 +0,0 @@
1
- import type { Page } from "@playwright/test";
2
- import { modelViewerObjectType } from "@vease_tests/utils/constants";
3
- import { setEdgesVisibility } from "@vease_tests/utils/viewer_interaction";
4
-
5
- async function setModelEdgesVisibility(window: Page, visibility: boolean): Promise<void> {
6
- await setEdgesVisibility(window, modelViewerObjectType, visibility);
7
- }
8
-
9
- export { setModelEdgesVisibility };
@@ -1,5 +0,0 @@
1
- export * from "./attribute";
2
- export * from "./color";
3
- export * from "./edges";
4
- export * from "./points";
5
- export * from "./surfaces";
@@ -1,97 +0,0 @@
1
- import type { Locator, Page } from "@playwright/test";
2
- import { ensureFeatureVisible, ensureMenuOpen } from "@vease_tests/utils/viewer_interaction";
3
- import { applyAttribute } from "@vease_tests/utils/data/helpers/attribute";
4
- import { selectModelTab } from "@vease_tests/utils/model_tabs";
5
- import { setColor } from "@vease_tests/utils/data/helpers/color";
6
- import { vertexAttributeType } from "@vease_tests/utils/constants";
7
- import { waitForActionSettled } from "@vease_tests/utils/wait_for_action_settled";
8
-
9
- const modelPointsMenuTestId = "modelPointsMenu";
10
-
11
- // Sections of the model points card, shown depending on what the context menu targets
12
- type ModelPointsSection =
13
- | "modelPointsComponentsOptions"
14
- | "modelPointsComponentTypeOptions"
15
- | "modelPointsComponentOptions";
16
-
17
- interface AttributeOptions {
18
- item?: number;
19
- colorMap?: string;
20
- min?: number | string;
21
- max?: number | string;
22
- }
23
-
24
- function getModelPointsSection(window: Page, section: ModelPointsSection): Locator {
25
- return window.getByTestId(section).filter({ visible: true }).first();
26
- }
27
-
28
- const SECTION_TABS = {
29
- modelPointsComponentsOptions: "components",
30
- modelPointsComponentTypeOptions: "type",
31
- modelPointsComponentOptions: "component",
32
- } as const;
33
-
34
- async function setModelComponentsPointsVisibility(
35
- window: Page,
36
- section: ModelPointsSection,
37
- visibility: boolean,
38
- ): Promise<void> {
39
- await ensureMenuOpen(window, modelPointsMenuTestId);
40
- await ensureFeatureVisible(window, modelPointsMenuTestId);
41
- await selectModelTab(window, SECTION_TABS[section]);
42
- const visibilitySwitch = getModelPointsSection(window, section)
43
- .getByTestId("modelComponentPointsVisibilitySwitch")
44
- .getByRole("checkbox");
45
- if ((await visibilitySwitch.isChecked()) !== visibility) {
46
- await visibilitySwitch.setChecked(visibility, { force: true });
47
- await waitForActionSettled(window);
48
- }
49
- }
50
-
51
- async function setModelComponentsPointsSize(
52
- window: Page,
53
- section: ModelPointsSection,
54
- value: number,
55
- ): Promise<void> {
56
- await setModelComponentsPointsVisibility(window, section, true);
57
- await getModelPointsSection(window, section)
58
- .getByTestId("modelComponentPointsSizeSlider")
59
- .locator("input")
60
- .first()
61
- .evaluate((node: HTMLInputElement, val: string) => {
62
- node.value = val;
63
- node.dispatchEvent(new Event("input", { bubbles: true }));
64
- node.dispatchEvent(new Event("change", { bubbles: true }));
65
- }, value.toString());
66
- await waitForActionSettled(window);
67
- }
68
-
69
- async function setModelComponentsPointsColor(
70
- window: Page,
71
- section: ModelPointsSection,
72
- ): Promise<void> {
73
- await setModelComponentsPointsVisibility(window, section, true);
74
- await setColor(window, modelPointsMenuTestId, getModelPointsSection(window, section));
75
- }
76
-
77
- async function setModelComponentsPointsVertexAttribute(
78
- window: Page,
79
- section: ModelPointsSection,
80
- attributeName: string,
81
- options: AttributeOptions = {},
82
- ): Promise<void> {
83
- await setModelComponentsPointsVisibility(window, section, true);
84
- await applyAttribute(window, getModelPointsSection(window, section), {
85
- attributeType: vertexAttributeType,
86
- attributeName,
87
- ...options,
88
- });
89
- }
90
-
91
- export {
92
- setModelComponentsPointsColor,
93
- setModelComponentsPointsSize,
94
- setModelComponentsPointsVertexAttribute,
95
- setModelComponentsPointsVisibility,
96
- };
97
- export type { ModelPointsSection };
@@ -1,2 +0,0 @@
1
- export * from "./components";
2
- export * from "./visibility";
@@ -1,9 +0,0 @@
1
- import type { Page } from "@playwright/test";
2
- import { modelViewerObjectType } from "@vease_tests/utils/constants";
3
- import { setPointsVisibility } from "@vease_tests/utils/viewer_interaction";
4
-
5
- async function setModelPointsVisibility(window: Page, visibility: boolean): Promise<void> {
6
- await setPointsVisibility(window, modelViewerObjectType, visibility);
7
- }
8
-
9
- export { setModelPointsVisibility };
@@ -1,11 +0,0 @@
1
- import type { Page } from "@playwright/test";
2
- import { ensureMenuOpen } from "@vease_tests/utils/viewer_interaction";
3
- import { selectModelOptionsTab } from "@vease_tests/utils/model_tabs";
4
-
5
- // Model style options sit behind the type or components tab
6
- async function showModelStyleOptions(window: Page): Promise<void> {
7
- await ensureMenuOpen(window, "modelStyleMenu");
8
- await selectModelOptionsTab(window);
9
- }
10
-
11
- export { showModelStyleOptions };
@@ -1 +0,0 @@
1
- export * from "./visibility";
@@ -1,8 +0,0 @@
1
- import type { Page } from "@playwright/test";
2
- import { setVisibilityGeneric } from "@vease_tests/utils/viewer_interaction";
3
-
4
- async function setModelSurfacesVisibility(window: Page, visibility: boolean): Promise<void> {
5
- await setVisibilityGeneric(window, "modelStyleMenu", "modelSurfacesVisibilitySwitch", visibility);
6
- }
7
-
8
- export { setModelSurfacesVisibility };
@@ -1,61 +0,0 @@
1
- // Third party imports
2
- import type { Page } from "@playwright/test";
3
-
4
- // Local imports
5
- import { waitForActionSettled } from "./wait_for_action_settled";
6
-
7
- // Model style cards split their options in tabs: Model | Components Options or Model | Surfaces | Surface
8
- type ModelTab = "model" | "components" | "type" | "component";
9
- const MODEL_TAB_SWITCHES = new Set([
10
- "modelStyleVisibilitySwitch",
11
- "modelEdgesVisibilitySwitch",
12
- "modelPointsVisibilitySwitch",
13
- ]);
14
- const COMPONENT_TYPE_TAB_SWITCHES = new Set([
15
- "modelSurfacesVisibilitySwitch",
16
- "modelLinesVisibilitySwitch",
17
- "modelCornersVisibilitySwitch",
18
- "modelBlocksVisibilitySwitch",
19
- ]);
20
-
21
- async function selectModelTab(window: Page, tab: ModelTab): Promise<void> {
22
- const tabButton = window.getByTestId(`modelTab_${tab}`).filter({ visible: true }).first();
23
- if (await tabButton.isVisible()) {
24
- await tabButton.click();
25
- await waitForActionSettled(window);
26
- }
27
- }
28
-
29
- // Component type options when the menu targets a type or a component, else components options
30
- async function selectModelOptionsTab(window: Page): Promise<void> {
31
- const typeTab = window.getByTestId("modelTab_type").filter({ visible: true }).first();
32
- await selectModelTab(window, (await typeTab.isVisible()) ? "type" : "components");
33
- }
34
-
35
- async function getActiveModelTabTestId(window: Page): Promise<string | undefined> {
36
- const activeTab = window
37
- .locator('[data-testid^="modelTab_"].v-btn--active')
38
- .filter({ visible: true })
39
- .first();
40
- if ((await activeTab.count()) === 0) {
41
- return undefined;
42
- }
43
- return (await activeTab.getAttribute("data-testid")) ?? undefined;
44
- }
45
-
46
- async function restoreModelTab(window: Page, tabTestId: string | undefined): Promise<void> {
47
- if (tabTestId === undefined) {
48
- return;
49
- }
50
- await window.getByTestId(tabTestId).filter({ visible: true }).first().click();
51
- await waitForActionSettled(window);
52
- }
53
-
54
- export {
55
- COMPONENT_TYPE_TAB_SWITCHES,
56
- MODEL_TAB_SWITCHES,
57
- getActiveModelTabTestId,
58
- restoreModelTab,
59
- selectModelOptionsTab,
60
- selectModelTab,
61
- };