Skip to content

Commit 51d6e07

Browse files
committed
skip if transport port not set to 9301
Signed-off-by: Amit Galitzky <amgalitz@amazon.com>
1 parent 319fdf6 commit 51d6e07

File tree

1 file changed

+36
-11
lines changed

1 file changed

+36
-11
lines changed

cypress/integration/plugins/anomaly-detection-dashboards-plugin/create_remote_detector_spec.js

+36-11
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,31 @@ context('Create remote detector workflow', () => {
9292
});
9393

9494
cy.wait(5000);
95+
const remoteSettings = `${Cypress.env(
96+
'remoteDataSourceNoAuthUrl'
97+
)}/_cluster/settings?include_defaults=true`;
98+
cy.request(
99+
{
100+
method: 'GET',
101+
form: false,
102+
url: remoteSettings,
103+
headers: {
104+
'content-type': 'application/json;charset=UTF-8',
105+
'osd-xsrf': true,
106+
},
107+
},
108+
1000
109+
).then((response) => {
110+
Cypress.log({
111+
message: `transport port: ${JSON.stringify(
112+
response.body.defaults.transport.port
113+
)}`,
114+
});
115+
116+
if (response.body.defaults.transport.port != 9301) {
117+
this.skip();
118+
}
119+
});
95120
});
96121

97122
// Index some sample data in local and follower cluster (remote)
@@ -178,11 +203,11 @@ context('Create remote detector workflow', () => {
178203

179204
cy.wait(500);
180205

181-
cy.getElementByTestId('indicesFilter').type('sample-ad-index');
206+
cy.getElementByTestId('indicesFilter').type(TEST_INDEX_NAME);
182207
cy.wait(500);
183208
cy.contains(
184209
'.euiComboBoxOption__content',
185-
`${remoteClusterName}:sample-ad-index`
210+
`${remoteClusterName}:${TEST_INDEX_NAME}`
186211
).click();
187212
cy.wait(1500);
188213

@@ -217,7 +242,7 @@ context('Create remote detector workflow', () => {
217242
TEST_DETECTOR_DESCRIPTION
218243
);
219244
cy.getElementByTestId('indexNameCell').contains(
220-
`${remoteClusterName}:sample-ad-index`
245+
`${remoteClusterName}:${TEST_INDEX_NAME}`
221246
);
222247
cy.getElementByTestId('timestampNameCell').contains(TEST_TIMESTAMP_NAME);
223248
cy.getElementByTestId('featureTable').contains(TEST_FEATURE_NAME);
@@ -257,22 +282,22 @@ context('Create remote detector workflow', () => {
257282

258283
cy.getElementByTestId('indicesFilter').click();
259284

260-
cy.getElementByTestId('indicesFilter').type('sample-ad-index');
285+
cy.getElementByTestId('indicesFilter').type(TEST_INDEX_NAME);
261286
cy.wait(500);
262287
cy.get('.euiComboBoxOption__content')
263-
.contains(`${remoteClusterName}:sample-ad-index`)
288+
.contains(`${remoteClusterName}:${TEST_INDEX_NAME}`)
264289
.click();
265290

266291
cy.getElementByTestId('indicesFilter').click();
267-
cy.getElementByTestId('indicesFilter').type('sample-ad-index');
292+
cy.getElementByTestId('indicesFilter').type(TEST_INDEX_NAME);
268293
cy.wait(500);
269-
cy.get('.euiComboBoxOption__content').contains('sample-ad-index').click();
294+
cy.get('.euiComboBoxOption__content').contains(TEST_INDEX_NAME).click();
270295

271296
cy.getElementByTestId('indicesFilter').click();
272-
cy.getElementByTestId('indicesFilter').type('sample-ad-index-two');
297+
cy.getElementByTestId('indicesFilter').type(TEST_SECOND_INDEX_NAME);
273298
cy.wait(500);
274299
cy.get('.euiComboBoxOption__content')
275-
.contains(`${remoteClusterName}:sample-ad-index-two`)
300+
.contains(`${remoteClusterName}:${TEST_SECOND_INDEX_NAME}`)
276301
.click();
277302

278303
selectTopItemFromFilter('timestampFilter', false);
@@ -336,7 +361,7 @@ context('Create remote detector workflow', () => {
336361
cy.contains(`${remoteClusterName} (Remote)`).should('be.visible');
337362

338363
cy.contains('(Local)').should('be.visible');
339-
cy.contains('sample-ad-index').should('be.visible');
364+
cy.contains(TEST_INDEX_NAME).should('be.visible');
340365

341366
cy.getElementByTestId('euiFlyoutCloseButton').click();
342367
cy.wait(500);
@@ -365,7 +390,7 @@ context('Create remote detector workflow', () => {
365390
);
366391
cy.contains(`${remoteClusterName} (Remote)`).should('be.visible');
367392
cy.contains('(Local)').should('be.visible');
368-
cy.contains('sample-ad-index').should('be.visible');
393+
cy.contains(TEST_INDEX_NAME).should('be.visible');
369394
});
370395
});
371396
});

0 commit comments

Comments
 (0)