Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update observability dashboards tests #1669

Merged
merged 14 commits into from
Jan 15, 2025
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 @@ -25,7 +25,7 @@ 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.contains('03/25/2021 10:21:22').should('exist');
});
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 Expand Up @@ -110,11 +109,11 @@ describe('Testing notebook actions', () => {
describe('Test reporting integration if plugin installed', () => {
beforeEach(() => {
let notebookName = makeTestNotebook();
cy.wrap({ name: notebookName }).as('notebook');
cy.get('body').then(($body) => {
skipOn($body.find('#reportingActionsButton').length <= 0);
});
makePopulatedParagraph();
cy.wrap({ name: notebookName }).as('notebook');
});

afterEach(() => {
Expand Down
7 changes: 3 additions & 4 deletions cypress/utils/plugins/observability-dashboards/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ 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 Expand Up @@ -171,9 +172,7 @@ export const querySearch = (query, rangeSelected) => {
cy.get(rangeSelected).click();
cy.get('[data-test-subj="superDatePickerApplyTimeButton"]', {
timeout: TIMEOUT_DELAY,
})
.contains('Refresh')
.click();
}).click();
};

export const landOnEventHome = () => {
Expand Down
Loading