-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[RUM Dashboard] Chart breakdowns #69420
Changes from 85 commits
f9c20a1
1f75371
f1c9bcf
9f615df
2214001
eaf461c
95b510b
b818fbd
ac24241
3cd29fb
bae67c2
5a6c41a
a3c83cc
60ac2eb
a587d82
6496237
fd6d22a
89a93ed
c1a9ef2
e062152
d77652c
1d0afcc
f1259a7
fb0782b
638920d
b0b11e5
9dc10c5
b2b444a
6a9749e
8702dc9
3c8f802
ebf9761
e72de7b
746ef6f
a0176da
3c769a7
9e0b508
c7d1521
1d94b3f
483d8fd
9ffcabb
ee3616e
7e18010
20c779e
bcb8ff8
1b8ef95
a05e6d6
352621a
a0a7a44
7056e40
92098c0
fc33078
9529d76
0733c7c
d3149ea
14e8851
9d143a5
b232189
627e217
bff7fe9
7206ffc
4ba1889
bb2ae2e
a15b3f5
291c30c
9ab0659
aaf36d7
b5746f3
f9fe8e3
640695f
5892c9d
ba2823d
5d267fe
986e9a5
3797388
1690d15
c5b71a6
a11f183
9df90e9
1b5af10
4b90edb
059ac73
2d686b0
e45f12f
f12173b
b1573bd
e5f6628
041d90c
a5ca6e2
12937e1
623a800
9d6ecd9
fe89c69
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 |
---|---|---|
|
@@ -5,3 +5,33 @@ Feature: RUM Dashboard | |
When the user inspects the real user monitoring tab | ||
Then should redirect to rum dashboard | ||
And should have correct client metrics | ||
|
||
Scenario: Rum page filters | ||
Given a user click the filter | ||
When the user select the filter | ||
And user applies the selected filter | ||
Then it filters the client metrics | ||
|
||
Scenario: Page load distribution percentiles | ||
Given a user browses the APM UI application for RUM Data | ||
When the user inspects the real user monitoring tab | ||
Then should redirect to rum dashboard | ||
Comment on lines
+18
to
+20
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. If you take a look, these 3 steps all-together have been tested in the above scenario. What do you think about this scenario, rephrased: Scenario: Page load distribution
Given a valid APM user
When the APM user inspects the RUM dashboard
Then the "page load" chart includes "percentile"
And the "page load" chart includes "tooltip"
And the "page load" chart includes "chart legend" Using quotes in a step generates a generic method in the implementation code, where the quoted string is replaced by a variable: Then(`the "{string}" chart includes {string}`, (chartName, element) => {
// cypress code using "chartName" and "element" variables
// i.e. locate the "chartName" chart and check for the "element"
}) |
||
And should display percentile for page load chart | ||
|
||
Scenario: Page load distribution chart tooltip | ||
Given a user browses the APM UI application for RUM Data | ||
When the user inspects the real user monitoring tab | ||
Then should redirect to rum dashboard | ||
And should display tooltip on hover | ||
|
||
Scenario: Page load distribution chart legends | ||
Given a user browses the APM UI application for RUM Data | ||
When the user inspects the real user monitoring tab | ||
Then should redirect to rum dashboard | ||
And should display chart legend | ||
|
||
Scenario: Breakdown filter | ||
Given a user click page load breakdown filter | ||
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. I think this is another scenario 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. In a BDD sequence, there is a Given/When/Then pattern that should be repeated across different scenarios. |
||
When the user selected the breakdown | ||
Then breakdown series should appear in chart | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import { Given, When, Then } from 'cypress-cucumber-preprocessor/steps'; | ||
|
||
/** The default time in ms to wait for a Cypress command to complete */ | ||
export const DEFAULT_TIMEOUT = 60 * 1000; | ||
|
||
Given(`a user click page load breakdown filter`, () => { | ||
// wait for all loading to finish | ||
cy.get('kbnLoadingIndicator').should('not.be.visible'); | ||
cy.get('.euiStat__title-isLoading').should('not.be.visible'); | ||
const breakDownBtn = cy.get('[data-cy=breakdown-popover_pageLoad]'); | ||
breakDownBtn.click(); | ||
}); | ||
|
||
When(`the user selected the breakdown`, () => { | ||
cy.get('[data-cy=filter-breakdown-item_Browser]').click(); | ||
// click outside popover to close it | ||
cy.get('[data-cy=pageLoadDist]').click(); | ||
}); | ||
|
||
Then(`breakdown series should appear in chart`, () => { | ||
cy.get('.euiLoadingChart').should('not.be.visible'); | ||
cy.get('div.echLegendItem__label[title=Chrome] ') | ||
.invoke('text') | ||
.should('eq', 'Chrome'); | ||
}); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import { Given, When, Then } from 'cypress-cucumber-preprocessor/steps'; | ||
import { loginAndWaitForPage } from '../../../integration/helpers'; | ||
|
||
/** The default time in ms to wait for a Cypress command to complete */ | ||
export const DEFAULT_TIMEOUT = 60 * 1000; | ||
|
||
Given(`a user browses the APM UI application for RUM Data`, () => { | ||
// open service overview page | ||
const RANGE_FROM = 'now-24h'; | ||
const RANGE_TO = 'now'; | ||
loginAndWaitForPage(`/app/apm#/services`, { from: RANGE_FROM, to: RANGE_TO }); | ||
}); | ||
|
||
When(`the user inspects the real user monitoring tab`, () => { | ||
// click rum tab | ||
cy.get(':contains(Real User Monitoring)', { timeout: DEFAULT_TIMEOUT }) | ||
.last() | ||
.click({ force: true }); | ||
}); | ||
|
||
Then(`should redirect to rum dashboard`, () => { | ||
cy.url().should('contain', `/app/apm#/rum-overview`); | ||
}); | ||
|
||
Then(`should have correct client metrics`, () => { | ||
const clientMetrics = '[data-cy=client-metrics] .euiStat__title'; | ||
|
||
// wait for all loading to finish | ||
cy.get('kbnLoadingIndicator').should('not.be.visible'); | ||
cy.get('.euiStat__title-isLoading').should('not.be.visible'); | ||
|
||
cy.get(clientMetrics).eq(2).invoke('text').snapshot(); | ||
|
||
cy.get(clientMetrics).eq(1).invoke('text').snapshot(); | ||
|
||
cy.get(clientMetrics).eq(0).invoke('text').snapshot(); | ||
}); | ||
|
||
Then(`should display percentile for page load chart`, () => { | ||
const pMarkers = '[data-cy=percentile-markers] span'; | ||
|
||
cy.get('.euiLoadingChart').should('be.visible'); | ||
|
||
// wait for all loading to finish | ||
cy.get('kbnLoadingIndicator').should('not.be.visible'); | ||
cy.get('.euiStat__title-isLoading').should('not.be.visible'); | ||
|
||
cy.get(pMarkers).eq(0).invoke('text').snapshot(); | ||
|
||
cy.get(pMarkers).eq(1).invoke('text').snapshot(); | ||
|
||
cy.get(pMarkers).eq(2).invoke('text').snapshot(); | ||
|
||
cy.get(pMarkers).eq(3).invoke('text').snapshot(); | ||
}); | ||
|
||
Then(`should display chart legend`, () => { | ||
const chartLegend = 'div.echLegendItem__label'; | ||
|
||
// wait for all loading to finish | ||
cy.get('kbnLoadingIndicator').should('not.be.visible'); | ||
cy.get('.euiLoadingChart').should('not.be.visible'); | ||
|
||
cy.get(chartLegend).eq(0).invoke('text').snapshot(); | ||
}); | ||
|
||
Then(`should display tooltip on hover`, () => { | ||
cy.get('.euiLoadingChart').should('not.be.visible'); | ||
|
||
const pMarkers = '[data-cy=percentile-markers] span.euiToolTipAnchor'; | ||
|
||
// wait for all loading to finish | ||
cy.get('kbnLoadingIndicator').should('not.be.visible'); | ||
cy.get('.euiLoadingChart').should('not.be.visible'); | ||
|
||
const marker = cy.get(pMarkers).eq(0); | ||
marker.invoke('show'); | ||
marker.trigger('mouseover', { force: true }); | ||
cy.get('span[data-cy=percentileTooltipTitle]').should('be.visible'); | ||
}); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
const IPS = [ | ||
'89.191.86.214', // check24.de | ||
'167.40.79.24', // canada.ca | ||
'151.101.130.217', // elastic.co | ||
'185.143.68.17', | ||
'151.101.130.217', | ||
'185.143.68.17', | ||
'185.143.68.17', | ||
'151.101.130.217', | ||
'185.143.68.17', | ||
]; | ||
|
||
module.exports = IPS; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
/* eslint-disable no-console */ | ||
|
||
/* eslint-disable import/no-extraneous-dependencies */ | ||
|
||
const UserAgents = [ | ||
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.97 Safari/537.36', | ||
'Mozilla/5.0 (Linux; Android 8.0.0; SM-G960F Build/R16NW) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.84 Mobile Safari/537.36', | ||
'Mozilla/5.0 (iPhone; CPU iPhone OS 12_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/69.0.3497.105 Mobile/15E148 Safari/605.1', | ||
'Mozilla/5.0 (iPhone; CPU iPhone OS 12_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0 Mobile/15E148 Safari/604.1', | ||
'Mozilla/5.0 (Linux; Android 7.0; Pixel C Build/NRD90M; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/52.0.2743.98 Safari/537.36', | ||
'Mozilla/5.0 (X11; CrOS x86_64 8172.45.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.64 Safari/537.36', | ||
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_2) AppleWebKit/601.3.9 (KHTML, like Gecko) Version/9.0.2 Safari/601.3.9', | ||
'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:15.0) Gecko/20100101 Firefox/15.0.1', | ||
'Mozilla/5.0 (CrKey armv7l 1.5.16041) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.0 Safari/537.36', | ||
]; | ||
|
||
module.exports = UserAgents; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import React from 'react'; | ||
import { BreakdownGroup } from './BreakdownGroup'; | ||
import { BreakdownItem } from '../../../../../typings/ui_filters'; | ||
import { | ||
CLIENT_GEO_COUNTRY_ISO_CODE, | ||
USER_AGENT_DEVICE, | ||
USER_AGENT_NAME, | ||
USER_AGENT_OS, | ||
} from '../../../../../common/elasticsearch_fieldnames'; | ||
|
||
interface Props { | ||
id: string; | ||
selectedBreakdowns: BreakdownItem[]; | ||
onBreakdownChange: (values: BreakdownItem[]) => void; | ||
} | ||
|
||
export const BreakdownFilter = ({ | ||
id, | ||
selectedBreakdowns, | ||
onBreakdownChange, | ||
}: Props) => { | ||
const categories: BreakdownItem[] = [ | ||
{ | ||
name: 'Browser', | ||
type: 'category', | ||
count: 0, | ||
selected: selectedBreakdowns.some(({ name }) => name === 'Browser'), | ||
fieldName: USER_AGENT_NAME, | ||
}, | ||
{ | ||
name: 'OS', | ||
type: 'category', | ||
count: 0, | ||
selected: selectedBreakdowns.some(({ name }) => name === 'OS'), | ||
fieldName: USER_AGENT_OS, | ||
}, | ||
{ | ||
name: 'Device', | ||
type: 'category', | ||
count: 0, | ||
selected: selectedBreakdowns.some(({ name }) => name === 'Device'), | ||
fieldName: USER_AGENT_DEVICE, | ||
}, | ||
{ | ||
name: 'Location', | ||
type: 'category', | ||
count: 0, | ||
selected: selectedBreakdowns.some(({ name }) => name === 'Location'), | ||
fieldName: CLIENT_GEO_COUNTRY_ISO_CODE, | ||
}, | ||
]; | ||
|
||
return ( | ||
<BreakdownGroup | ||
id={id} | ||
items={categories} | ||
onChange={(selValues: BreakdownItem[]) => { | ||
onBreakdownChange(selValues); | ||
}} | ||
/> | ||
); | ||
}; |
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.
Wdyt about this?
The Given part could not be necessary, but the
When
one is key: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 have updated this one as well.