-
Notifications
You must be signed in to change notification settings - Fork 54
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
Cypress Testing v12.8.1 - Trace Analytics (Services & Traces) fixes #493
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,7 +14,6 @@ describe('Testing services table empty state', () => { | |
win.sessionStorage.clear(); | ||
}, | ||
}); | ||
cy.wait(delay * 3); | ||
}); | ||
|
||
it('Renders empty state', () => { | ||
|
@@ -72,11 +71,6 @@ describe('Testing services table', () => { | |
|
||
describe('Testing service view empty state', () => { | ||
beforeEach(() => { | ||
// exception is thrown on loading EuiDataGrid in cypress only, ignore for now | ||
cy.on('uncaught:exception', (err, runnable) => { | ||
if (err.message.includes('ResizeObserver loop')) | ||
return false; | ||
}); | ||
cy.visit(`app/observability-traces#/services/${SERVICE_NAME}`, { | ||
onBeforeLoad: (win) => { | ||
win.sessionStorage.clear(); | ||
|
@@ -93,11 +87,6 @@ describe('Testing service view empty state', () => { | |
|
||
describe('Testing service view', () => { | ||
beforeEach(() => { | ||
// exception is thrown on loading EuiDataGrid in cypress only, ignore for now | ||
cy.on('uncaught:exception', (err, runnable) => { | ||
if (err.message.includes('ResizeObserver loop')) | ||
return false; | ||
}); | ||
cy.visit(`app/observability-traces#/services`, { | ||
onBeforeLoad: (win) => { | ||
win.sessionStorage.clear(); | ||
|
@@ -106,7 +95,7 @@ describe('Testing service view', () => { | |
setTimeFilter(); | ||
cy.get('input[type="search"]').first().focus().type(`${SERVICE_NAME}`); | ||
cy.get('[data-test-subj="superDatePickerApplyTimeButton"]').click(); | ||
cy.wait(delay); | ||
cy.get('.euiTableRow').should('have.length.lessThan', 3);//Replaces wait | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice. |
||
cy.get('[data-test-subj="service-link"]').eq(0).click(); | ||
}); | ||
|
||
|
@@ -119,28 +108,22 @@ describe('Testing service view', () => { | |
|
||
it('Has working breadcrumbs', () => { | ||
cy.get('.euiBreadcrumb').contains(SERVICE_NAME).click(); | ||
cy.wait(delay); | ||
cy.get('h2.euiTitle').contains(SERVICE_NAME).should('exist'); | ||
cy.get('.euiBreadcrumb').contains('Services').click(); | ||
cy.wait(delay); | ||
cy.get('.euiTitle').contains('Services').should('exist'); | ||
cy.get('.euiBreadcrumb').contains('Trace analytics').click(); | ||
cy.wait(delay); | ||
cy.get('.euiTitle').contains('Dashboard').should('exist'); | ||
cy.get('.euiBreadcrumb').contains('Observability').click(); | ||
cy.wait(delay); | ||
cy.get('.euiTitle').contains('Event analytics').should('exist'); | ||
cy.get('.euiTitle').contains('Logs').should('exist'); | ||
}); | ||
|
||
it('Renders spans data grid, flyout, filters', () => { | ||
cy.get("[data-test-subj='spanId-link']").contains(SERVICE_SPAN_ID).trigger('mouseover', { force: true }); | ||
cy.get('button[data-datagrid-interactable="true"]').eq(0).click({ force: true }); | ||
cy.wait(delay); | ||
cy.contains('Span detail').should('exist'); | ||
cy.contains('Span attributes').should('exist'); | ||
cy.get('.euiTextColor').contains('Span ID').trigger('mouseover'); | ||
cy.get('.euiButtonIcon[aria-label="span-flyout-filter-icon"').click({ force: true }); | ||
cy.wait(delay); | ||
cy.get('.euiBadge__text').contains('spanId: ').should('exist'); | ||
cy.get('[data-test-subj="euiFlyoutCloseButton"]').click({ force: true }); | ||
cy.contains('Spans (1)').should('exist'); | ||
|
@@ -172,10 +155,6 @@ describe('Testing Service map', () => { | |
|
||
describe('Testing traces Spans table verify table headers functionality', () => { | ||
beforeEach(() => { | ||
cy.on('uncaught:exception', (err, runnable) => { | ||
if (err.message.includes('ResizeObserver loop')) | ||
return false; | ||
}); | ||
cy.visit('app/observability-traces#/services', { | ||
onBeforeLoad: (win) => { | ||
win.sessionStorage.clear(); | ||
|
@@ -211,6 +190,7 @@ describe('Testing traces Spans table verify table headers functionality', () => | |
|
||
it('Hide all button Spans table', () => { | ||
cy.get('.euiLink.euiLink--primary').contains('authentication').should('exist').click(); | ||
cy.get('.euiTableRow').should('have.length.lessThan', 2);//Replace wait | ||
cy.get('[data-test-subj = "dataGridColumnSelectorButton"]').click(); | ||
cy.get('.euiPopoverFooter .euiFlexItem.euiFlexItem--flexGrowZero').eq(1).should('have.text', 'Hide all').click(); | ||
cy.get('.euiDataGrid__focusWrap').click().should('exist'); | ||
|
@@ -268,10 +248,8 @@ describe('Testing traces Spans table and verify columns functionality', () => { | |
cy.get('[aria-label="span-flyout-filter-icon"]').click(); | ||
cy.get('.euiFlyout__closeButton.euiFlyout__closeButton--inside').click(); | ||
cy.get('.euiBadge__content .euiBadge__text').contains('spanId: 277a5934acf55dcf').should('exist'); | ||
cy.wait(delay); | ||
count_table_row(1); | ||
cy.get('[aria-label="remove current filter"]').click(); | ||
cy.wait(delay); | ||
count_table_row(8); | ||
}); | ||
|
||
|
@@ -298,6 +276,7 @@ describe('Testing switch mode to jaeger', () => { | |
setTimeFilter(); | ||
cy.get("[data-test-subj='indexPattern-switch-link']").click(); | ||
cy.get("[data-test-subj='jaeger-mode']").click(); | ||
//cy.get('.euiButtonEmpty__text').should('contain', 'Jaeger'); | ||
}); | ||
|
||
it('Verifies columns and data', () => { | ||
|
@@ -312,10 +291,8 @@ describe('Testing switch mode to jaeger', () => { | |
}); | ||
|
||
it('Verifies traces links to traces page with filter applied', () => { | ||
cy.wait(delay); | ||
cy.get('.euiTableRow').should('have.length.lessThan', 7);//Replaces Wait | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 2 or 3 is immediately understandable. 7 ? Is that just the injected trace data? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The previous state has 7 listings, my thought process is to detect the minimal change to indicate the previous action was applied before running get(). This can be lowered but wanted to use the assertions just to check that the action had been applied while keeping reference to what the previous state had, for going back through the snapshots. |
||
cy.get('.euiLink').contains('7').click(); | ||
cy.wait(delay); | ||
|
||
cy.get('h2.euiTitle').contains('Traces').should('exist'); | ||
cy.contains(' (7)').should('exist'); | ||
cy.get("[data-test-subj='filterBadge']").eq(0).contains('process.serviceName: customer') | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -66,6 +66,7 @@ export const setTimeFilter = (setEndTime = false, refresh = true) => { | |
.type('{selectall}' + endTime, { force: true }); | ||
} | ||
if (refresh) cy.get('.euiButton__text').contains('Refresh').click(); | ||
cy.get('.euiTableRow').should('have.length.greaterThan', 3);//Replaces Wait | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This assertion ensures the page is loaded before moving on to the 'cy.get()' commands in the testing following this function call. The click of refresh applying the filter adds to the rows and waiting for this change to occur ensures cypress won't search to early before it exist. This was put in place to move towards removing all cy.wait() commands and create more reliable and efficient testing. |
||
}; | ||
|
||
// notebooks | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I LOVE that we're removing this. This is a super-wide ignore nad the test will be far more accurate with uncaught:exceptions bubbling.
Thanks for making this happen!