@@ -27,27 +27,27 @@ test.describe('Configuration tests', () => {
27
27
} ) => {
28
28
const ds = await readProvisionedDataSource < DataSourcePluginOptionsEditorProps < PromOptions > > ( { fileName : 'datasources.yml' } ) ;
29
29
const configPage = await createDataSourceConfigPage ( { type : ds . type } ) ;
30
-
30
+
31
31
// connection settings
32
32
await expect ( configPage
33
- . getByTestIdOrAriaLabel ( selectors . components . DataSource . Prometheus . configPage . connectionSettings ) ) . toBeVisible ( ) ;
33
+ . getByGrafanaSelector ( selectors . components . DataSource . Prometheus . configPage . connectionSettings ) ) . toBeVisible ( ) ;
34
34
35
35
// managed alerts
36
36
await expect (
37
37
page . locator ( `#${ selectors . components . DataSource . Prometheus . configPage . manageAlerts } ` )
38
38
) . toBeVisible ( ) ;
39
-
39
+
40
40
// scrape interval
41
41
await expect ( configPage
42
- . getByTestIdOrAriaLabel ( selectors . components . DataSource . Prometheus . configPage . scrapeInterval ) ) . toBeVisible ( ) ;
43
-
42
+ . getByGrafanaSelector ( selectors . components . DataSource . Prometheus . configPage . scrapeInterval ) ) . toBeVisible ( ) ;
43
+
44
44
// query timeout
45
45
await expect ( configPage
46
- . getByTestIdOrAriaLabel ( selectors . components . DataSource . Prometheus . configPage . queryTimeout ) ) . toBeVisible ( ) ;
46
+ . getByGrafanaSelector ( selectors . components . DataSource . Prometheus . configPage . queryTimeout ) ) . toBeVisible ( ) ;
47
47
48
48
// default editor
49
49
await expect ( configPage
50
- . getByTestIdOrAriaLabel ( selectors . components . DataSource . Prometheus . configPage . defaultEditor ) ) . toBeVisible ( ) ;
50
+ . getByGrafanaSelector ( selectors . components . DataSource . Prometheus . configPage . defaultEditor ) ) . toBeVisible ( ) ;
51
51
52
52
// disable metric lookup
53
53
await expect (
@@ -56,11 +56,11 @@ test.describe('Configuration tests', () => {
56
56
57
57
// prometheus type
58
58
await expect ( configPage
59
- . getByTestIdOrAriaLabel ( selectors . components . DataSource . Prometheus . configPage . prometheusType ) ) . toBeVisible ( ) ;
59
+ . getByGrafanaSelector ( selectors . components . DataSource . Prometheus . configPage . prometheusType ) ) . toBeVisible ( ) ;
60
60
61
61
// cache level
62
62
await expect ( configPage
63
- . getByTestIdOrAriaLabel ( selectors . components . DataSource . Prometheus . configPage . cacheLevel ) ) . toBeVisible ( ) ;
63
+ . getByGrafanaSelector ( selectors . components . DataSource . Prometheus . configPage . cacheLevel ) ) . toBeVisible ( ) ;
64
64
65
65
// incremental querying
66
66
await expect ( page . locator ( `#${ selectors . components . DataSource . Prometheus . configPage . incrementalQuerying } ` ) ) . toBeVisible ( ) ;
@@ -70,11 +70,11 @@ test.describe('Configuration tests', () => {
70
70
71
71
// custom query parameters
72
72
await expect ( configPage
73
- . getByTestIdOrAriaLabel ( selectors . components . DataSource . Prometheus . configPage . customQueryParameters ) ) . toBeVisible ( ) ;
73
+ . getByGrafanaSelector ( selectors . components . DataSource . Prometheus . configPage . customQueryParameters ) ) . toBeVisible ( ) ;
74
74
75
75
// http method
76
76
await expect ( configPage
77
- . getByTestIdOrAriaLabel ( selectors . components . DataSource . Prometheus . configPage . httpMethod ) ) . toBeVisible ( ) ;
77
+ . getByGrafanaSelector ( selectors . components . DataSource . Prometheus . configPage . httpMethod ) ) . toBeVisible ( ) ;
78
78
} ) ;
79
79
80
80
test ( '"Save & test" should be successful when configuration is valid' , async ( {
@@ -83,9 +83,9 @@ test.describe('Configuration tests', () => {
83
83
} ) => {
84
84
const ds = await readProvisionedDataSource < DataSourcePluginOptionsEditorProps < PromOptions > > ( { fileName : 'datasources.yml' } ) ;
85
85
const configPage = await createDataSourceConfigPage ( { type : ds . type } ) ;
86
-
86
+
87
87
await configPage
88
- . getByTestIdOrAriaLabel ( selectors . components . DataSource . Prometheus . configPage . connectionSettings )
88
+ . getByGrafanaSelector ( selectors . components . DataSource . Prometheus . configPage . connectionSettings )
89
89
. fill ( ds . url || '' ) ;
90
90
91
91
await expect ( configPage . saveAndTest ( ) ) . toBeOK ( ) ;
@@ -101,63 +101,48 @@ test.describe('Configuration tests', () => {
101
101
await expect ( configPage ) . toHaveAlert ( 'error' , { hasText : 'empty url' } ) ;
102
102
} ) ;
103
103
104
- test ( 'it should allow a user to add the version when the Prom type is selected' ,
104
+ test ( 'it should allow a user to add the version when the Prom type is selected' ,
105
105
async ( {
106
106
createDataSourceConfigPage,
107
- readProvisionedDataSource,
107
+ // readProvisionedDataSource,
108
108
page,
109
109
} ) => {
110
- const ds = await readProvisionedDataSource < DataSourcePluginOptionsEditorProps < PromOptions > > ( { fileName : 'datasources.yml' } ) ;
111
-
112
110
const configPage = await createDataSourceConfigPage ( {
113
111
type : "grafana-prometheusamazon-datasource" ,
114
112
name : DATA_SOURCE_NAME ,
115
113
} ) ;
116
-
114
+
117
115
await expect ( configPage
118
- . getByTestIdOrAriaLabel (
116
+ . getByGrafanaSelector (
119
117
selectors . components . DataSource . Prometheus . configPage . prometheusType
120
118
) ) . toBeVisible ( ) ;
121
-
122
119
123
120
// open the select dropdown
124
121
await page . getByLabel ( 'Prometheus type' ) . click ( ) ;
125
122
126
123
// select a prometheus type
127
124
await page . getByText ( 'Cortex' ) . click ( ) ;
128
-
125
+
129
126
// expect the version component to be displayed
130
127
await expect ( configPage
131
- . getByTestIdOrAriaLabel (
128
+ . getByGrafanaSelector (
132
129
selectors . components . DataSource . Prometheus . configPage . prometheusVersion
133
130
) ) . toBeVisible ( ) ;
134
131
} ) ;
135
132
136
- test ( 'it should allow a user to select a query overlap window when incremental querying is selected' ,
133
+ test ( 'it should allow a user to select a query overlap window when incremental querying is selected' ,
137
134
async ( {
138
135
createDataSourceConfigPage,
139
136
page,
140
137
} ) => {
141
- // const ds = await readProvisionedDataSource<DataSourcePluginOptionsEditorProps<PromOptions>>({ fileName: 'datasources.yml' });
142
-
143
138
const configPage = await createDataSourceConfigPage ( {
144
139
type : "grafana-prometheusamazon-datasource" ,
145
140
name : DATA_SOURCE_NAME + "check" ,
146
141
} ) ;
147
-
148
- const incrementalQuerying = await page
149
- . locator ( `#${ selectors . components . DataSource . Prometheus . configPage . incrementalQuerying } ` )
150
-
151
- expect ( incrementalQuerying ) . toBeVisible ( ) ;
152
142
153
143
await page . getByLabel ( 'Toggle switch' ) . nth ( 3 ) . setChecked ( true ) ;
154
144
155
- expect (
156
- configPage
157
- . getByTestIdOrAriaLabel (
158
- selectors . components . DataSource . Prometheus . configPage . queryOverlapWindow
159
- )
160
- ) . toBeVisible ( ) ;
145
+ expect ( configPage . getByGrafanaSelector ( selectors . components . DataSource . Prometheus . configPage . queryOverlapWindow ) ) . toBeVisible ( ) ;
161
146
} ) ;
162
147
163
148
// exemplars tested in exemplar.spec
0 commit comments