1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
| const assert = require("assert");
|
| Feature("Annotation button").tag("@regres");
|
| Scenario("Annotation button should keep border width on hover", async ({ I, LabelStudio }) => {
| LabelStudio.setFeatureFlags({
| fflag_feat_front_dev_3873_labeling_ui_improvements_short: true,
| });
|
| I.amOnPage("/");
| LabelStudio.init({
| config: `<View>
| <Text name="text" value="$text" />
| </View>`,
| data: {
| text: "Some text",
| },
| annotations: [
| {
| id: "test_1",
| result: [],
| },
| {
| id: "test_2",
| result: [],
| },
| ],
| });
| LabelStudio.waitForObjectsReady();
|
| const borderWidth = await I.executeScript(() => {
| const el = document.querySelector(".lsf-annotation-button:nth-child(2)");
| const borderWidth = window.getComputedStyle(el).getPropertyValue("border-width");
|
| return borderWidth;
| });
|
| I.moveCursorTo(".lsf-annotation-button:nth-child(2)");
|
| const borderWidthHovered = await I.executeScript(() => {
| const el = document.querySelector(".lsf-annotation-button:nth-child(2)");
| const borderWidth = window.getComputedStyle(el).getPropertyValue("border-width");
|
| return borderWidth;
| });
|
| assert.strictEqual(borderWidth, borderWidthHovered, "Annotation button's border width should not change on hover");
| });
|
|