-
Notifications
You must be signed in to change notification settings - Fork 124
/
Copy pathdrilling.spec.ts
124 lines (104 loc) · 4.88 KB
/
drilling.spec.ts
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
// (C) 2021-2025 GoodData Corporation
import * as Navigation from "../../tools/navigation";
import { Widget } from "../../tools/widget";
import { EditMode } from "../../tools/editMode";
import { CustomURLDialog, WidgetConfiguration } from "../../tools/widgetConfiguration";
import { Messages } from "../../tools/messages";
import { DrillToModal } from "../../tools/drillToModal";
const drillModal = new DrillToModal();
const editMode = new EditMode();
describe("Interaction", () => {
const widget = new Widget(0);
const widgetConfig = new WidgetConfiguration(0);
//Cover ticket: RAIL-4559
it(
"Should able to remove existing interactions",
{ tags: ["checklist_integrated_tiger", "checklist_integrated_tiger_releng"] },
() => {
Navigation.visitCopyOf("dashboard/drill-to-insight");
editMode.edit();
widget.waitChartLoaded().focus();
widgetConfig.openInteractions().getDrillConfigItem("Sum of Velocity").remove();
widgetConfig.getDrillConfigItem("Created - Year").remove();
editMode.save(true).edit();
widget.waitChartLoaded().focus();
widgetConfig.openInteractions().hasInteractionItems(false);
},
);
//Cover ticket: RAIL-4717
it(
"Should correctly display attribute list in custom URL dialog",
{ tags: ["checklist_integrated_tiger", "checklist_integrated_tiger_releng"] },
() => {
Navigation.visit("dashboard/drill-to-insight");
editMode.edit();
widget.waitChartLoaded().focus();
widgetConfig.openInteractions().getDrillConfigItem("Created - Year").remove();
widgetConfig.addInteraction("Sum of Probability", "measure");
widgetConfig
.getDrillConfigItem("Sum of Probability")
.chooseAction("Drill into URL")
.openCustomUrlEditor();
new CustomURLDialog().hasItem("Created");
widgetConfig.closeCustomURLDialog().close();
const widget2 = new Widget(0, 1);
const widgetConfig2 = new WidgetConfiguration(0, 1);
widget2.scrollIntoView().waitChartLoaded().focus();
widgetConfig2.openInteractions().addInteraction("Sum of Amount", "measure");
widgetConfig2
.getDrillConfigItem("Sum of Amount")
.chooseAction("Drill into URL")
.openCustomUrlEditor();
new CustomURLDialog().hasItem("Stage Name");
},
);
//Cover ticket: RAIL-4716
it(
"should display correct insight name on invalid interaction warning",
{ tags: ["checklist_integrated_tiger"] },
() => {
const widget1 = new Widget(0, 1);
const message = new Messages();
Navigation.visit("dashboard/dashboard-many-rows-columns");
editMode.edit();
message
.hasWarningMessage(true)
.clickShowMore()
.hasInsightNameIsBolder(true, "Insight has invalid interaction");
widget1
.waitChartLoaded()
.scrollIntoView()
.focus()
.setTitle("Visualization has invalid interaction rename");
message
.hasWarningMessage(true)
.clickShowMore()
.hasInsightNameIsBolder(true, "Visualization has invalid interaction rename");
widget1.waitChartLoaded().scrollIntoView().focus();
new WidgetConfiguration(0, 1).removeFromDashboard();
message.hasWarningMessage(false);
},
);
});
// Can be removed once migrated to tiger or once decided that we don't want to migrate the test.
// eslint-disable-next-line jest/no-disabled-tests
describe.skip("Drilling on Table with Metrics in Rows", { tags: ["post-merge_integrated_bear"] }, () => {
beforeEach(() => {
Navigation.visit("dashboard/drill-to-insight-metrics-in-rows");
});
it("should drill on insight from table with no rows and metrics in rows", () => {
new Widget(0).getTable().click(0, 1, false);
drillModal.getTitleElement().should("have.text", "Visualization has invalid interaction");
});
it("should drill on insight from table with no columns and metrics in rows", () => {
new Widget(1).waitTableLoaded().scrollIntoView().getTable().click(1, 2);
drillModal.getTitleElement().should("have.text", "Sales table");
});
it("should drill on insight from table with column headers position left and metrics in rows", () => {
new Widget(2).scrollIntoView().getTable().click(0, 3, false);
drillModal.getTitleElement().should("have.text", "With own description");
drillModal.close();
new Widget(2).scrollIntoView().getTable().click(1, 3, false);
drillModal.getTitleElement().should("have.text", "Sales Rep chart");
});
});