-
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
[APM UI] Rephrase BDD steps for RUM scenarios #72492
Conversation
This will reduce the time it takes to execute the tests
I noticed that the method: 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', { timeout: DEFAULT_TIMEOUT }).should('be.visible');
cy.get('.euiSelect-isLoading').should('not.be.visible');
cy.get('.euiStat__title-isLoading').should('not.be.visible');
cy.get(clientMetrics).eq(2).should('have.text', '55 ');
cy.get(clientMetrics).eq(1).should('have.text', '0.08 sec');
cy.get(clientMetrics).eq(0).should('have.text', '0.01 sec');
}); which relates to the BDD step: Then should have correct client metrics is almost the same as: Then(`it displays relevant 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).should('have.text', '7 ');
cy.get(clientMetrics).eq(1).should('have.text', '0.07 sec');
cy.get(clientMetrics).eq(0).should('have.text', '0.01 sec');
}); which relates to the BDD step: Then it displays relevant client metrics I wonder if both methods and scenarios could be refactored into one, or in a helper method with parameters. |
Another question that I have: cy.get(clientMetrics).eq(2).should('have.text', '7 '); I noticed there is a whitespace after the value. Is this on purpose and needed? |
Hey @shahzad31, any feedback here? I'd like to make progress with these scenarios Thanks! |
i think space was part of text fetch from component, maybe we can avoid this by using trim string method. |
@mdelapenya i am fine with merging both of these methods. |
You mean at the plugin code? or in the tests? I'd prefer the 1st one |
Hey @shahzad31 I'd love a pair of 👀 reviewing the typescript code after refactor: I had to skip presubmit checks when creating the commit because not sure how to fix them. |
Pinging @elastic/uptime (Team:uptime) |
Pinging @elastic/apm-ui (Team:apm) |
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.
This looks fine to me as long as everything is still relevant and passing.
@elasticmachine merge upstream |
💚 Build SucceededBuild metricsdistributable file count
History
To update your PR or re-run it, just comment with: |
Friendly reminder: Looks like this PR hasn’t been backported yet. |
Friendly reminder: Looks like this PR hasn’t been backported yet. |
* chore: group tests doing the same This will reduce the time it takes to execute the tests * chore: rephrase step * chore: extract common code to a function Co-authored-by: Elastic Machine <[email protected]>
* chore: group tests doing the same This will reduce the time it takes to execute the tests * chore: rephrase step * chore: extract common code to a function Co-authored-by: Elastic Machine <[email protected]> Co-authored-by: Elastic Machine <[email protected]>
* chore: group tests doing the same This will reduce the time it takes to execute the tests * chore: rephrase step * chore: extract common code to a function Co-authored-by: Elastic Machine <[email protected]> Co-authored-by: Elastic Machine <[email protected]>
Summary
This PR simplifies three scenarios, merging them into just one, which will reduce the build time because we will be running just one scenario instead of three doing exactly the same: we will run the tests and check for the three components in different steps of the same scenario.
Besides that, we are rephrasing the existing scenarios, willing to open a discussion about refining them.