Skip to content

Commit

Permalink
update scenerios
Browse files Browse the repository at this point in the history
  • Loading branch information
shahzad31 committed Jun 29, 2020
1 parent 9d6ecd9 commit fe89c69
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,13 @@ Feature: RUM Dashboard
Then should redirect to rum dashboard
And should have correct client metrics

Scenario: Rum page filters
Given the user filters by os
When user applies the selected filter
Scenario Outline: Rum page filters
When the user filters by "<filterName>"
Then it filters the client metrics
Examples:
| filterName |
| os |
| location |

Scenario: Page load distribution percentiles
Given a user browses the APM UI application for RUM Data
Expand Down
15 changes: 10 additions & 5 deletions x-pack/plugins/apm/e2e/cypress/integration/snapshots.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,22 @@ module.exports = {
"2": "0.07 sec",
"3": "0.01 sec"
},
"Rum page filters (example #1)": {
"1": "15 ",
"2": "0.07 sec",
"3": "0.01 sec"
},
"Rum page filters (example #2)": {
"1": "35 ",
"2": "0.07 sec",
"3": "0.01 sec"
},
"Page load distribution percentiles": {
"1": "50th",
"2": "75th",
"3": "90th",
"4": "95th"
},
"Rum page filters": {
"1": "15 ",
"2": "0.07 sec",
"3": "0.01 sec"
},
"Page load distribution chart legends": {
"1": "Overall"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,19 @@
* you may not use this file except in compliance with the Elastic License.
*/

import { Given, When, Then } from 'cypress-cucumber-preprocessor/steps';
import { 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(`the user filters by os`, () => {
When(/^the user filters by "([^"]*)"$/, (filterName) => {
// wait for all loading to finish
cy.get('kbnLoadingIndicator').should('not.be.visible');
cy.get('.euiStat__title-isLoading').should('not.be.visible');
cy.get('#local-filter-os').click();

cy.get('button.euiSelectableListItem[title="Mac OS X"]').click();
});
cy.get(`#local-filter-${filterName}`).click();

When(`user applies the selected filter`, () => {
if (filterName === 'os') {
cy.get('button.euiSelectableListItem[title="Mac OS X"]').click();
} else {
cy.get('button.euiSelectableListItem[title="DE"]').click();
}
cy.get('[data-cy=applyFilter]').click();
});

Expand All @@ -34,4 +32,6 @@ Then(`it filters the client metrics`, () => {
cy.get(clientMetrics).eq(1).invoke('text').snapshot();

cy.get(clientMetrics).eq(0).invoke('text').snapshot();

cy.get('[data-cy=clearFilters]').click();
});
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ const LocalUIFilters = ({
iconType="cross"
flush="left"
onClick={clearValues}
data-cy="clearFilters"
>
{i18n.translate('xpack.apm.clearFilters', {
defaultMessage: 'Clear filters',
Expand Down

0 comments on commit fe89c69

Please sign in to comment.