Skip to content

Commit

Permalink
[Bug]updated traces and services tests with new refresh button
Browse files Browse the repository at this point in the history
Signed-off-by: Shenoy Pratik <[email protected]>
Co-authored-by: sumukhswamy <[email protected]>
  • Loading branch information
ps48 and sumukhswamy committed Oct 29, 2024
1 parent 1c08720 commit 9d48e8a
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
SERVICE_NAME,
setTimeFilter,
delayTime,
TIMEOUT_DELAY
} from '../../../utils/constants';

describe('Testing services table', () => {
Expand All @@ -26,8 +27,10 @@ describe('Testing services table', () => {
.first()
.focus()
.type(`${SERVICE_NAME}{enter}`);
cy.get('.euiButton__text').contains('Refresh').click();
cy.contains(' (1)').should('exist');
cy.get('[data-test-subj="superDatePickerApplyTimeButton"]', {
timeout: TIMEOUT_DELAY,
}).click();
cy.contains(' (1)').should('exist');
});

it('Opens service flyout', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@

/// <reference types="cypress" />

import { setTimeFilter, TRACE_ID } from '../../../utils/constants';
import {
setTimeFilter,
TRACE_ID,
TIMEOUT_DELAY,
} from '../../../utils/constants';
import customParseFormat from 'dayjs/plugin/customParseFormat';
import dayjs from 'dayjs';

Expand All @@ -29,7 +33,9 @@ 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"]', {
timeout: TIMEOUT_DELAY,
}).click();
cy.contains(' (1)').should('exist');
cy.get('.euiTableCellContent')
.eq(11)
Expand Down
7 changes: 5 additions & 2 deletions cypress/utils/plugins/observability-dashboards/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,11 @@ 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"]', {
timeout: TIMEOUT_DELAY,
}).click();
}
cy.wait(delayTime);
};

Expand Down Expand Up @@ -172,7 +176,6 @@ export const querySearch = (query, rangeSelected) => {
cy.get('[data-test-subj="superDatePickerApplyTimeButton"]', {
timeout: TIMEOUT_DELAY,
})
.contains('Refresh')
.click();
};

Expand Down

0 comments on commit 9d48e8a

Please sign in to comment.