vease 3.1.0-rc.3 → 3.1.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,8 +1,8 @@
|
|
|
1
1
|
import { getDataTableRow } from "./data_manager.js";
|
|
2
2
|
import { waitForActionSettled } from "#ogw_e2e/wait_for_action_settled.js";
|
|
3
3
|
import { expect } from "@playwright/test";
|
|
4
|
+
import { closeFeedbackSnackbar, moveMouseOutOfTheWay } from "#ogw_e2e/app_interaction.js";
|
|
4
5
|
import { expandGeodeObjectTypeInTree, getTreeRowByTextAndParent } from "#ogw_e2e/object_trees/common.js";
|
|
5
|
-
import { closeFeedbackSnackbar } from "#ogw_e2e/app_interaction.js";
|
|
6
6
|
import { getMainObjectTree } from "#ogw_e2e/object_trees/main_object_tree.js";
|
|
7
7
|
//#region tests/e2e/utils/crs.ts
|
|
8
8
|
async function expectDataRows(window, itemNames) {
|
|
@@ -20,11 +20,15 @@ async function getDataTreeRow(window, geodeObjectType, dataName) {
|
|
|
20
20
|
await expandGeodeObjectTypeInTree(window, geodeObjectType, tree);
|
|
21
21
|
return getTreeRowByTextAndParent(window, geodeObjectType, dataName, tree);
|
|
22
22
|
}
|
|
23
|
+
const TOOLTIP_TIMEOUT_MS = 2e3;
|
|
23
24
|
async function openCrsFromTree(window, geodeObjectType, dataName) {
|
|
24
|
-
|
|
25
|
-
await waitForActionSettled(window);
|
|
25
|
+
const row = await getDataTreeRow(window, geodeObjectType, dataName);
|
|
26
26
|
const editButton = window.locator(".v-overlay--active").getByTestId("editCrsBtn");
|
|
27
|
-
await
|
|
27
|
+
await expect(async () => {
|
|
28
|
+
await moveMouseOutOfTheWay(window);
|
|
29
|
+
await row.getByTestId("treeItemLabel").first().hover();
|
|
30
|
+
await expect(editButton).toBeVisible({ timeout: TOOLTIP_TIMEOUT_MS });
|
|
31
|
+
}).toPass();
|
|
28
32
|
await editButton.click();
|
|
29
33
|
await waitForActionSettled(window);
|
|
30
34
|
}
|
|
@@ -68,7 +72,7 @@ async function clickAssign(window) {
|
|
|
68
72
|
}
|
|
69
73
|
const FEEDBACK_TIMEOUT_MS = 6e4;
|
|
70
74
|
async function expectFeedback(window, text, action) {
|
|
71
|
-
const shown = window.getByTestId("feedbackSnackbar").filter({ hasText: text }).waitFor({
|
|
75
|
+
const shown = window.getByTestId("feedbackSnackbar").filter({ hasText: text }).first().waitFor({
|
|
72
76
|
state: "visible",
|
|
73
77
|
timeout: FEEDBACK_TIMEOUT_MS
|
|
74
78
|
});
|
package/package.json
CHANGED
package/tests/e2e/utils/crs.ts
CHANGED
|
@@ -4,11 +4,11 @@
|
|
|
4
4
|
import { type Locator, type Page, expect } from "@playwright/test";
|
|
5
5
|
|
|
6
6
|
// Local imports
|
|
7
|
+
import { closeFeedbackSnackbar, moveMouseOutOfTheWay } from "#ogw_e2e/app_interaction.js";
|
|
7
8
|
import {
|
|
8
9
|
expandGeodeObjectTypeInTree,
|
|
9
10
|
getTreeRowByTextAndParent,
|
|
10
11
|
} from "#ogw_e2e/object_trees/common.js";
|
|
11
|
-
import { closeFeedbackSnackbar } from "#ogw_e2e/app_interaction.js";
|
|
12
12
|
import { getDataTableRow } from "./data_manager";
|
|
13
13
|
import { getMainObjectTree } from "#ogw_e2e/object_trees/main_object_tree.js";
|
|
14
14
|
import { waitForActionSettled } from "#ogw_e2e/wait_for_action_settled.js";
|
|
@@ -40,16 +40,21 @@ async function getDataTreeRow(
|
|
|
40
40
|
return getTreeRowByTextAndParent(window, geodeObjectType, dataName, tree);
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
+
const TOOLTIP_TIMEOUT_MS = 2000;
|
|
44
|
+
|
|
43
45
|
async function openCrsFromTree(
|
|
44
46
|
window: Page,
|
|
45
47
|
geodeObjectType: string,
|
|
46
48
|
dataName: string,
|
|
47
49
|
): Promise<void> {
|
|
48
50
|
const row = await getDataTreeRow(window, geodeObjectType, dataName);
|
|
49
|
-
await row.getByTestId("treeItemLabel").first().hover();
|
|
50
|
-
await waitForActionSettled(window);
|
|
51
51
|
const editButton = window.locator(".v-overlay--active").getByTestId("editCrsBtn");
|
|
52
|
-
|
|
52
|
+
// The tooltip opens on mouseenter: a hover landing while the tree re-renders misses it, so it is retried from outside the row
|
|
53
|
+
await expect(async () => {
|
|
54
|
+
await moveMouseOutOfTheWay(window);
|
|
55
|
+
await row.getByTestId("treeItemLabel").first().hover();
|
|
56
|
+
await expect(editButton).toBeVisible({ timeout: TOOLTIP_TIMEOUT_MS });
|
|
57
|
+
}).toPass();
|
|
53
58
|
await editButton.click();
|
|
54
59
|
await waitForActionSettled(window);
|
|
55
60
|
}
|
|
@@ -127,6 +132,8 @@ async function expectFeedback(
|
|
|
127
132
|
const shown = window
|
|
128
133
|
.getByTestId("feedbackSnackbar")
|
|
129
134
|
.filter({ hasText: text })
|
|
135
|
+
// Several builds can fail with the same message (e.g. one per aligned data): any of them will do
|
|
136
|
+
.first()
|
|
130
137
|
.waitFor({ state: "visible", timeout: FEEDBACK_TIMEOUT_MS });
|
|
131
138
|
await Promise.all([shown, action()]);
|
|
132
139
|
await closeFeedbackSnackbar(window);
|
|
@@ -50,7 +50,7 @@ async function navigateToApp(
|
|
|
50
50
|
return {
|
|
51
51
|
window: firstWindow,
|
|
52
52
|
electronApp,
|
|
53
|
-
cleanup: async () => {
|
|
53
|
+
cleanup: async (): Promise<void> => {
|
|
54
54
|
await electronApp.close();
|
|
55
55
|
},
|
|
56
56
|
};
|
|
@@ -78,7 +78,7 @@ async function navigateToApp(
|
|
|
78
78
|
|
|
79
79
|
return {
|
|
80
80
|
window: page,
|
|
81
|
-
cleanup: async () => {
|
|
81
|
+
cleanup: async (): Promise<void> => {
|
|
82
82
|
await page.close();
|
|
83
83
|
await browser.close();
|
|
84
84
|
await kill(nuxtPort);
|