Skip to content

Commit 3a00cf2

Browse files
ritvibhattRitvi Bhatt
authored and
Ritvi Bhatt
committedJan 15, 2025·
Update observability dashboards tests (opensearch-project#1669)
* update observability dashboards tests Signed-off-by: Ritvi Bhatt <ribhatt@amazon.com> * fix notebook delete Signed-off-by: Ritvi Bhatt <ribhatt@amazon.com> * skip reporting tests Signed-off-by: Ritvi Bhatt <ribhatt@amazon.com> * add back reporting tests Signed-off-by: Ritvi Bhatt <ribhatt@amazon.com> * skip last reporting tests Signed-off-by: Ritvi Bhatt <ribhatt@amazon.com> * move notebook alias earlier Signed-off-by: Ritvi Bhatt <ribhatt@amazon.com> * skip last reporting tests Signed-off-by: Ritvi Bhatt <ribhatt@amazon.com> * add back reporting tests Signed-off-by: Ritvi Bhatt <ribhatt@amazon.com> * stop tests Signed-off-by: Ritvi Bhatt <ribhatt@amazon.com> * add back reporting tests Signed-off-by: Ritvi Bhatt <ribhatt@amazon.com> * skip reporting tests Signed-off-by: Ritvi Bhatt <ribhatt@amazon.com> * add back reporting tests Signed-off-by: Ritvi Bhatt <ribhatt@amazon.com> --------- Signed-off-by: Ritvi Bhatt <ribhatt@amazon.com> Co-authored-by: Ritvi Bhatt <ribhatt@amazon.com> (cherry picked from commit 57db1eb)

File tree

4 files changed

+7
-15
lines changed

4 files changed

+7
-15
lines changed
 

‎cypress/integration/plugins/observability-dashboards/2_trace_analytics_services.spec.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,7 @@ describe('Testing services table', () => {
2727
.first()
2828
.focus()
2929
.type(`${SERVICE_NAME}{enter}`);
30-
cy.get('[data-test-subj="superDatePickerApplyTimeButton"]', {
31-
timeout: TIMEOUT_DELAY,
32-
}).click();
30+
cy.get('[data-test-subj="superDatePickerApplyTimeButton"]').click();
3331
cy.contains(' (1)').should('exist');
3432
});
3533

‎cypress/integration/plugins/observability-dashboards/3_trace_analytics_traces.spec.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,7 @@ describe('Testing traces table', () => {
3333

3434
it('Searches correctly', () => {
3535
cy.get('input[type="search"]').focus().type(`${TRACE_ID}{enter}`);
36-
cy.get('[data-test-subj="superDatePickerApplyTimeButton"]', {
37-
timeout: TIMEOUT_DELAY,
38-
}).click();
36+
cy.get('[data-test-subj="superDatePickerApplyTimeButton"]').click();
3937
cy.contains(' (1)').should('exist');
4038
cy.get('.euiTableCellContent')
4139
.eq(11)

‎cypress/integration/plugins/observability-dashboards/6_notebooks.spec.js

+3-4
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ const makeTestNotebook = () => {
3434

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

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

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

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

6766
cy.get('input[data-test-subj="delete-notebook-modal-input"]').focus();
6867
cy.get('input[data-test-subj="delete-notebook-modal-input"]').type('delete');
@@ -110,11 +109,11 @@ describe('Testing notebook actions', () => {
110109
describe('Test reporting integration if plugin installed', () => {
111110
beforeEach(() => {
112111
let notebookName = makeTestNotebook();
112+
cy.wrap({ name: notebookName }).as('notebook');
113113
cy.get('body').then(($body) => {
114114
skipOn($body.find('#reportingActionsButton').length <= 0);
115115
});
116116
makePopulatedParagraph();
117-
cy.wrap({ name: notebookName }).as('notebook');
118117
});
119118

120119
afterEach(() => {

‎cypress/utils/plugins/observability-dashboards/constants.js

+2-5
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,8 @@ export const setTimeFilter = (setEndTime = false, refresh = true) => {
8080
timeout: TIMEOUT_DELAY,
8181
}).type('{selectall}' + endTime, { force: true });
8282
}
83-
if (refresh) {
84-
cy.get('[data-test-subj="superDatePickerApplyTimeButton"]', {
85-
timeout: TIMEOUT_DELAY,
86-
}).click();
87-
}
83+
if (refresh)
84+
cy.get('[data-test-subj="superDatePickerApplyTimeButton"]').click();
8885
cy.wait(delayTime);
8986
};
9087

0 commit comments

Comments
 (0)
Please sign in to comment.