Skip to content

Commit 0493de7

Browse files
committed
go oxc
1 parent 24e8ec5 commit 0493de7

3 files changed

Lines changed: 34 additions & 28 deletions

File tree

tests/e2e/tests/grid2d.test.js

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,14 @@ import {
99
cellAttribute,
1010
changeColor,
1111
changeOpacity,
12+
featureSizeOrWidth,
13+
featureVisibility,
1214
highlightData,
1315
loadData,
1416
navigateToApp,
1517
pointsVisibility,
1618
vertexAttribute,
1719
viewerContextMenu,
18-
featureVisibility,
19-
featureSizeOrWidth,
20-
featureTextures,
2120
} from "@tests/utils/viewer_interaction.js";
2221
import { test } from "@tests/fixtures.js";
2322

@@ -27,6 +26,8 @@ const attributeName = "RGB_data";
2726
let window = undefined;
2827
let cleanup = undefined;
2928
const OPACITY_50 = 50;
29+
const POINTS_SIZE = 15;
30+
const EDGES_WIDTH = 5;
3031
const geodeObjectType = "RegularGrid2D";
3132

3233
test.beforeAll(async ({ mode, browser }) => {
@@ -84,23 +85,25 @@ test("opacity", async () => {
8485
});
8586

8687
test("points size", async () => {
87-
await featureSizeOrWidth(window, "mesh", "Points", 15);
88+
await featureSizeOrWidth(window, "mesh", "Points", POINTS_SIZE);
8889
await expect(window).toHaveScreenshot();
8990
});
9091

9192
test("edges width", async () => {
92-
await featureSizeOrWidth(window, "mesh", "Edges", 5);
93+
await featureSizeOrWidth(window, "mesh", "Edges", EDGES_WIDTH);
9394
await expect(window).toHaveScreenshot();
9495
});
9596

9697
test("edges visibility", async () => {
9798
await featureVisibility(window, "mesh", "Edges", false);
9899
await expect(window).toHaveScreenshot();
99-
await featureVisibility(window, "mesh", "Edges", true); // revert
100+
// Revert
101+
await featureVisibility(window, "mesh", "Edges", true);
100102
});
101103

102104
test("cells visibility", async () => {
103105
await featureVisibility(window, "mesh", "Cells", false);
104106
await expect(window).toHaveScreenshot();
105-
await featureVisibility(window, "mesh", "Cells", true); // revert
107+
// Revert
108+
await featureVisibility(window, "mesh", "Cells", true);
106109
});

tests/e2e/tests/grid3d.test.js

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,14 @@ import {
99
cellAttribute,
1010
changeColor,
1111
changeOpacity,
12+
featureSizeOrWidth,
13+
featureVisibility,
1214
highlightData,
1315
loadData,
1416
navigateToApp,
1517
pointsVisibility,
1618
vertexAttribute,
1719
viewerContextMenu,
18-
featureVisibility,
19-
featureSizeOrWidth,
20-
featureTextures,
2120
} from "@tests/utils/viewer_interaction.js";
2221
import { test } from "@tests/fixtures.js";
2322

@@ -27,6 +26,8 @@ const attributeName = "int_attribute";
2726
let window = undefined;
2827
let cleanup = undefined;
2928
const OPACITY_50 = 50;
29+
const POINTS_SIZE = 15;
30+
const EDGES_WIDTH = 5;
3031
const geodeObjectType = "RegularGrid3D";
3132

3233
test.beforeAll(async ({ mode, browser }) => {
@@ -84,23 +85,25 @@ test("opacity", async () => {
8485
});
8586

8687
test("points size", async () => {
87-
await featureSizeOrWidth(window, "mesh", "Points", 15);
88+
await featureSizeOrWidth(window, "mesh", "Points", POINTS_SIZE);
8889
await expect(window).toHaveScreenshot();
8990
});
9091

9192
test("edges width", async () => {
92-
await featureSizeOrWidth(window, "mesh", "Edges", 5);
93+
await featureSizeOrWidth(window, "mesh", "Edges", EDGES_WIDTH);
9394
await expect(window).toHaveScreenshot();
9495
});
9596

9697
test("edges visibility", async () => {
9798
await featureVisibility(window, "mesh", "Edges", false);
9899
await expect(window).toHaveScreenshot();
99-
await featureVisibility(window, "mesh", "Edges", true); // revert
100+
// Revert
101+
await featureVisibility(window, "mesh", "Edges", true);
100102
});
101103

102104
test("cells visibility", async () => {
103105
await featureVisibility(window, "mesh", "Cells", false);
104106
await expect(window).toHaveScreenshot();
105-
await featureVisibility(window, "mesh", "Cells", true); // revert
107+
// Revert
108+
await featureVisibility(window, "mesh", "Cells", true);
106109
});

tests/e2e/tests/model.test.js

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import {
1010
changeColor,
1111
changeOpacity,
1212
expandComponentsType,
13+
featureSizeOrWidth,
1314
hideObjectInTree,
1415
highlightData,
1516
hoverModelComponentRow,
@@ -19,9 +20,6 @@ import {
1920
polyhedraAttribute,
2021
vertexAttribute,
2122
viewerContextMenu,
22-
featureVisibility,
23-
featureSizeOrWidth,
24-
featureTextures,
2523
} from "@tests/utils/viewer_interaction.js";
2624
import { test } from "@tests/fixtures.js";
2725

@@ -32,6 +30,7 @@ let window = undefined;
3230
let cleanup = undefined;
3331
const OFFSET = 10;
3432
const OPACITY_50 = 50;
33+
const POINTS_SIZE = 15;
3534
const geodeObjectType = "BRep";
3635

3736
test.beforeAll(async ({ mode, browser }) => {
@@ -67,7 +66,7 @@ test("points visibility", async () => {
6766
});
6867

6968
test("points size", async () => {
70-
await featureSizeOrWidth(window, "model", "Points", 15);
69+
await featureSizeOrWidth(window, "model", "Points", POINTS_SIZE);
7170
await expect(window).toHaveScreenshot();
7271
});
7372

@@ -173,18 +172,18 @@ test("object tree hover first surface", async () => {
173172
await expect(window).toHaveScreenshot();
174173
});
175174

176-
async function toggleModelTreeRow(window, rowName) {
177-
const modelComponentsObjectTree = window.getByTestId("modelComponentsObjectTree");
175+
async function toggleModelTreeRow(appWindow, rowName) {
176+
const modelComponentsObjectTree = appWindow.getByTestId("modelComponentsObjectTree");
178177
const row = modelComponentsObjectTree
179178
.locator(".tree-row-wrapper")
180179
.filter({ hasText: rowName })
181180
.first();
182181
await row.locator("button:has([class*='mdi-eye'])").first().click();
183-
await window.waitForTimeout(1500);
182+
await appWindow.waitForTimeout(afterActionWait);
184183
}
185184

186-
async function setModelTreeRowColorRandom(window, rowName) {
187-
const modelComponentsObjectTree = window.getByTestId("modelComponentsObjectTree");
185+
async function setModelTreeRowColorRandom(appWindow, rowName) {
186+
const modelComponentsObjectTree = appWindow.getByTestId("modelComponentsObjectTree");
188187
const row = modelComponentsObjectTree
189188
.locator(".tree-row-wrapper")
190189
.filter({ hasText: rowName })
@@ -193,18 +192,19 @@ async function setModelTreeRowColorRandom(window, rowName) {
193192
const box = await label.boundingBox();
194193
await label.dispatchEvent("contextmenu", {
195194
button: 2,
196-
clientX: box.x + 10,
197-
clientY: box.y + 10,
195+
clientX: box.x + OFFSET,
196+
clientY: box.y + OFFSET,
198197
});
199-
await window.waitForTimeout(1500);
198+
await appWindow.waitForTimeout(afterActionWait);
200199

201-
await changeColor(window, "modelStyleMenu");
200+
await changeColor(appWindow, "modelStyleMenu");
202201
}
203202

204203
test("blocks visibility", async () => {
205204
await toggleModelTreeRow(window, "Blocks");
206205
await expect(window).toHaveScreenshot();
207-
await toggleModelTreeRow(window, "Blocks"); // revert
206+
// Revert
207+
await toggleModelTreeRow(window, "Blocks");
208208
});
209209

210210
test("blocks color", async () => {

0 commit comments

Comments
 (0)