Skip to content

Commit

Permalink
fixes observability dashboards tests (#1562)
Browse files Browse the repository at this point in the history
* observability test fixes

Signed-off-by: Paul Sebastian <paulstn@amazon.com>

* use milliseconds in time validation

Signed-off-by: Paul Sebastian <paulstn@amazon.com>

* remove html tag from data test subj

Signed-off-by: Paul Sebastian <paulstn@amazon.com>

* remove more html tags

Signed-off-by: Paul Sebastian <paulstn@amazon.com>

* fix notebook deletion

Signed-off-by: Paul Sebastian <paulstn@amazon.com>

---------

Signed-off-by: Paul Sebastian <paulstn@amazon.com>
  • Loading branch information
paulstn committed Sep 11, 2024
1 parent bceec36 commit 45a3adc
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ describe('Testing services table', () => {
.first()
.focus()
.type(`${SERVICE_NAME}{enter}`);
cy.get('.euiButton__text').contains('Refresh').click();
cy.get('[data-test-subj="superDatePickerApplyTimeButton"]').click();
cy.contains(' (1)').should('exist');
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,14 @@ describe('Testing traces table', () => {

it('Searches correctly', () => {
cy.get('input[type="search"]').focus().type(`${TRACE_ID}{enter}`);
cy.get('.euiButton__text').contains('Refresh').click();
cy.get('[data-test-subj="superDatePickerApplyTimeButton"]').click();
cy.contains(' (1)').should('exist');
cy.get('.euiTableCellContent')
.eq(11)
.invoke('text')
.then((text) => {
expect(dayjs(text, 'MM/DD/YYYY HH:mm:ss', true).isValid()).to.be.true;
expect(dayjs(text, 'MM/DD/YYYY HH:mm:ss.SSS', true).isValid()).to.be
.true;
});
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const makeTestNotebook = () => {

cy.contains(`Notebook "${notebookName}" successfully created`);

cy.get('h1[data-test-subj="notebookTitle"]')
cy.get('[data-test-subj="notebookTitle"]')
.contains(notebookName)
.should('exist');

Expand All @@ -61,8 +61,7 @@ const deleteNotebook = (notebookName) => {
.find('input[type="checkbox"]')
.check();

cy.get('button[data-test-subj="notebookTableActionBtn"]').click();
cy.get('button[data-test-subj="deleteNotebookBtn"]').click();
cy.get('[data-test-subj="deleteSelectedNotebooks"]').click();

cy.get('input[data-test-subj="delete-notebook-modal-input"]').focus();
cy.get('input[data-test-subj="delete-notebook-modal-input"]').type('delete');
Expand Down
4 changes: 3 additions & 1 deletion cypress/utils/plugins/observability-dashboards/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,9 @@ export const setTimeFilter = (setEndTime = false, refresh = true) => {
timeout: TIMEOUT_DELAY,
}).type('{selectall}' + endTime, { force: true });
}
if (refresh) cy.get('.euiButton__text').contains('Refresh').click();
if (refresh) {
cy.get('[data-test-subj="superDatePickerApplyTimeButton"]').click();
}
cy.wait(delayTime);
};

Expand Down

0 comments on commit 45a3adc

Please sign in to comment.