Skip to content

Commit dc2653d

Browse files
committed
Fix doubleclick on maps layer tests
Signed-off-by: Andy Qin <qinandy@amazon.com>
1 parent e3b9d78 commit dc2653d

1 file changed

Lines changed: 10 additions & 17 deletions

File tree

cypress/integration/plugins/custom-import-map-dashboards/opensearchMapLayer.spec.js

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { BASE_PATH } from '../../../utils/constants';
88
if (!Cypress.env('SECURITY_ENABLED')) {
99
describe('Default OpenSearch base map layer', () => {
1010
before(() => {
11-
cy.visit(`${BASE_PATH}/app/home#/tutorial_directory/sampleData`, {
11+
cy.visit(`${BASE_PATH}/app/home#/tutorial_directory`, {
1212
retryOnStatusCodeFailure: true,
1313
timeout: 60000,
1414
});
@@ -17,7 +17,10 @@ if (!Cypress.env('SECURITY_ENABLED')) {
1717
})
1818
.contains(/(Add|View) data/)
1919
.click();
20-
cy.wait(60000);
20+
cy.get(
21+
'div[data-test-subj="sampleDataSetCardflights"] > span > span[title="INSTALLED"]',
22+
{ timeout: 60000 }
23+
).should('have.text', 'INSTALLED');
2124
});
2225

2326
it('check if default OpenSearch map layer can be open', () => {
@@ -27,22 +30,12 @@ if (!Cypress.env('SECURITY_ENABLED')) {
2730
'contain',
2831
'Default map'
2932
);
30-
cy.get('canvas.maplibregl-canvas').trigger('mousemove', {
31-
x: 100,
32-
y: 100,
33-
force: true,
34-
});
35-
cy.get('canvas.maplibregl-canvas').trigger('mousemove', {
36-
x: 200,
37-
y: 200,
38-
force: true,
39-
});
40-
for (let i = 0; i < 21; i++) {
41-
cy.wait(1000)
42-
.get('canvas.maplibregl-canvas')
43-
.trigger('dblclick', { force: true });
33+
34+
for (let i = 0; i < 5; i++) {
35+
cy.wait(500)
36+
cy.get('.maplibregl-ctrl-zoom-in').click();
4437
}
45-
cy.get('[data-test-subj="mapStatusBar"]').should('contain', 'zoom: 22');
38+
cy.get('[data-test-subj="mapStatusBar"]').should('contain', 'zoom: 6');
4639
});
4740

4841
after(() => {

0 commit comments

Comments
 (0)