-
Notifications
You must be signed in to change notification settings - Fork 124
/
Copy pathdashboard.spec.ts
153 lines (127 loc) · 4.79 KB
/
dashboard.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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
// (C) 2021-2025 GoodData Corporation
import * as Navigation from "../../tools/navigation";
import { Dashboard, FilterBar, TopBar } from "../../tools/dashboards";
import { EditMode } from "../../tools/editMode";
import { DashboardHeader } from "../../tools/dashboardHeader";
import { Table } from "../../tools/table";
const topBar = new TopBar();
const dashboardHeader = new DashboardHeader();
// 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("Dashboard", { tags: ["pre-merge_isolated_bear"] }, () => {
describe("TopBar rendering", () => {
beforeEach(() => {
Navigation.visit("dashboard/kpis");
});
it("should render topBar", () => {
const dashboard = new Dashboard();
dashboard.topBarExist();
});
it("should render title", () => {
dashboardHeader.dashboardTitleExist().dashboardTitleHasValue("KPIs");
});
it("should render edit button", () => {
const dashboard = new Dashboard();
dashboard.topBarExist();
topBar.editButtonIsVisible();
});
it("should menu button render", () => {
topBar.menuButtonIsVisible();
});
it("should open menu button and contain items", () => {
topBar
.menuButtonIsVisible()
.clickMenuButton()
.topBarMenuItemExist(".s-export_to_pdf")
.topBarMenuItemExist(".s-schedule_emailing");
});
//Cover ticket: RAIL-4431
it(
"should display placeholder and focus title for new dashboard",
{ tags: ["checklist_integrated_tiger"] },
() => {
Navigation.visit("dashboard/new-dashboard");
dashboardHeader.hasTitlePlaceholder();
dashboardHeader.isTitleFocused();
},
);
});
describe("FilterBar rendering", () => {
beforeEach(() => {
Navigation.visit("dashboard/kpis");
});
it("should render filter bar", () => {
const dashboard = new Dashboard();
dashboard.filterBarExist();
});
it("should render date filter", () => {
const filterBar = new FilterBar();
filterBar
.dateFilterExist()
.dateFilterHasTitle("Date range")
.clickDateFilter()
.dateFilterHasElements([
".s-all-time",
".s-exclude-current-perod-disabled",
".s-date-filter-cancel",
".s-date-filter-apply",
]);
});
it("should change the filter", () => {
const filterBar = new FilterBar();
filterBar
.dateFilterExist()
.dateFilterHasSubtitle("01/01/2011 – 12/31/2011")
.clickDateFilter()
.selectDateFilterOption(".s-relative-preset-relative-last-7-days")
.clickApply()
.dateFilterHasSubtitle("Last 7 days");
});
});
describe("Dashboard body rendering", () => {
beforeEach(() => {
Navigation.visit("dashboard/kpis");
});
it("should render single insight", () => {
const dashboard = new Dashboard();
dashboard.dashboardBodyExist();
});
});
});
describe("Dashboard actions", () => {
const editMode = new EditMode();
//Cover ticket: RAIL-4772
it(
"should able to delete dashboard after save as new",
{ tags: ["checklist_integrated_tiger", "checklist_integrated_tiger_releng"] },
() => {
Navigation.visitCopyOf("dashboard/kpis");
editMode.edit();
new DashboardHeader()
.menuButtonIsVisible(true)
.clickMenuButton()
.deleteDashboard(true)
.dashboardTitleHasValue("Untitled");
},
);
//Cover ticket: RAIL-4642
it(
"should able to scroll vertical/ horizontal on widget",
{ tags: ["checklist_integrated_tiger", "checklist_integrated_tiger_releng"] },
() => {
const table = new Table(".s-dash-item-0_0");
Navigation.visit("dashboard/dashboard-many-rows-columns");
editMode.edit();
table.scrollTo("right").scrollVerticalTo("bottom");
},
);
//Cover ticket: RAIL-4750
it(
"should direct to view mode after save as new",
{ tags: ["checklist_integrated_tiger", "checklist_integrated_tiger_releng"] },
() => {
Navigation.visitCopyOf("dashboard/kpis");
dashboardHeader.editButtonIsVisible(true).shareButtonExists(true);
},
);
});