Skip to content

Commit

Permalink
[Bug] updated traces and services tests with new refresh button (#1610)
Browse files Browse the repository at this point in the history
* [Bug]updated traces and services tests with new refresh button

Signed-off-by: Shenoy Pratik <[email protected]>
Co-authored-by: sumukhswamy <[email protected]>

* update datetime format check

Signed-off-by: Shenoy Pratik <[email protected]>

---------

Signed-off-by: Shenoy Pratik <[email protected]>
Co-authored-by: sumukhswamy <[email protected]>
  • Loading branch information
ps48 and sumukhswamy authored Oct 29, 2024
1 parent 1c08720 commit afcf1b7
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 7 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,13 +33,16 @@ 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)
.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
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 afcf1b7

Please sign in to comment.