-
Notifications
You must be signed in to change notification settings - Fork 974
/
Copy pathindex.js
128 lines (113 loc) · 5.29 KB
/
index.js
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
/*
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*
* Any modifications Copyright OpenSearch Contributors. See
* GitHub history for details.
*/
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
export default function ({ getService, loadTestFile }) {
const browser = getService('browser');
const opensearchArchiver = getService('opensearchArchiver');
async function loadCurrentData() {
await browser.setWindowSize(1300, 900);
await opensearchArchiver.unload('logstash_functional');
await opensearchArchiver.loadIfNeeded('dashboard/current/data');
}
async function unloadCurrentData() {
await opensearchArchiver.unload('dashboard/current/data');
}
async function loadLogstash() {
await browser.setWindowSize(1200, 900);
await opensearchArchiver.loadIfNeeded('logstash_functional');
}
async function unloadLogstash() {
await opensearchArchiver.unload('logstash_functional');
}
describe('dashboard app', function () {
// This has to be first since the other tests create some embeddables as side affects and our counting assumes
// a fresh index.
describe('using current data', function () {
this.tags('ciGroup2');
before(loadCurrentData);
after(unloadCurrentData);
loadTestFile(require.resolve('./empty_dashboard'));
loadTestFile(require.resolve('./url_field_formatter'));
loadTestFile(require.resolve('./embeddable_rendering'));
loadTestFile(require.resolve('./create_and_add_embeddables'));
loadTestFile(require.resolve('./edit_embeddable_redirects'));
loadTestFile(require.resolve('./edit_visualizations'));
loadTestFile(require.resolve('./time_zones'));
loadTestFile(require.resolve('./dashboard_options'));
loadTestFile(require.resolve('./data_shared_attributes'));
loadTestFile(require.resolve('./embed_mode'));
loadTestFile(require.resolve('./dashboard_back_button'));
loadTestFile(require.resolve('./dashboard_error_handling'));
loadTestFile(require.resolve('./legacy_urls'));
// Note: This one must be last because it unloads some data for one of its tests!
// No, this isn't ideal, but loading/unloading takes so much time and these are all bunched
// to improve efficiency...
loadTestFile(require.resolve('./dashboard_query_bar'));
});
describe('using current data', function () {
this.tags('ciGroup3');
before(loadCurrentData);
after(unloadCurrentData);
loadTestFile(require.resolve('./full_screen_mode'));
loadTestFile(require.resolve('./dashboard_filter_bar'));
loadTestFile(require.resolve('./dashboard_filtering'));
loadTestFile(require.resolve('./panel_expand_toggle'));
loadTestFile(require.resolve('./dashboard_grid'));
loadTestFile(require.resolve('./view_edit'));
loadTestFile(require.resolve('./dashboard_saved_query'));
// Order of test suites *shouldn't* be important but there's a bug for the view_edit test above
// https://github.com/elastic/kibana/issues/46752
// The dashboard_snapshot test below requires the timestamped URL which breaks the view_edit test.
// If we don't use the timestamp in the URL, the colors in the charts will be different.
loadTestFile(require.resolve('./dashboard_snapshots'));
});
// Each of these tests call initTests themselves, the way it was originally written. The above tests only load
// the data once to save on time. Eventually, all of these tests should just use current data and we can reserve
// legacy data only for specifically testing BWC situations.
describe('using legacy data', function () {
this.tags('ciGroup4');
before(loadLogstash);
after(unloadLogstash);
loadTestFile(require.resolve('./dashboard_time_picker'));
loadTestFile(require.resolve('./bwc_shared_urls'));
loadTestFile(require.resolve('./panel_replacing'));
loadTestFile(require.resolve('./panel_cloning'));
loadTestFile(require.resolve('./panel_context_menu'));
loadTestFile(require.resolve('./dashboard_state'));
});
describe('using legacy data', function () {
this.tags('ciGroup5');
before(loadLogstash);
after(unloadLogstash);
loadTestFile(require.resolve('./dashboard_save'));
loadTestFile(require.resolve('./dashboard_time'));
loadTestFile(require.resolve('./dashboard_listing'));
loadTestFile(require.resolve('./dashboard_clone'));
});
});
}