Skip to content
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

Merged
merged 6 commits into from
Sep 1, 2020

Conversation

mdelapenya
Copy link
Contributor

@mdelapenya mdelapenya commented Jul 20, 2020

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.

This will reduce the time it takes to execute the tests
@mdelapenya mdelapenya self-assigned this Jul 20, 2020
@mdelapenya mdelapenya requested a review from shahzad31 July 20, 2020 17:38
@mdelapenya mdelapenya added the Team:Uptime - DEPRECATED Synthetics & RUM sub-team of Application Observability label Jul 20, 2020
@mdelapenya
Copy link
Contributor Author

Writing down my thoughts here, because I cannot add them to the proper lines in the diff.

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.

@mdelapenya
Copy link
Contributor Author

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?

@mdelapenya
Copy link
Contributor Author

Hey @shahzad31, any feedback here? I'd like to make progress with these scenarios

Thanks!

@shahzad31
Copy link
Contributor

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?

i think space was part of text fetch from component, maybe we can avoid this by using trim string method.

@shahzad31
Copy link
Contributor

Writing down my thoughts here, because I cannot add them to the proper lines in the diff.

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.

@mdelapenya i am fine with merging both of these methods.

@mdelapenya
Copy link
Contributor Author

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?

i think space was part of text fetch from component, maybe we can avoid this by using trim string method.

You mean at the plugin code? or in the tests? I'd prefer the 1st one

@mdelapenya
Copy link
Contributor Author

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.

@mdelapenya mdelapenya marked this pull request as ready for review August 3, 2020 15:39
@mdelapenya mdelapenya requested a review from a team as a code owner August 3, 2020 15:39
@elasticmachine
Copy link
Contributor

Pinging @elastic/uptime (Team:uptime)

@botelastic botelastic bot added the Team:APM All issues that need APM UI Team support label Aug 3, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/apm-ui (Team:apm)

Copy link
Contributor

@smith smith left a 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.

@mdelapenya
Copy link
Contributor Author

@elasticmachine merge upstream

@mdelapenya mdelapenya added release_note:skip Skip the PR/issue when compiling release notes v7.10.0 labels Sep 1, 2020
@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Build metrics

distributable file count

id value diff baseline
total 45456 +1 45455

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@mdelapenya mdelapenya merged commit 69461cc into elastic:master Sep 1, 2020
@kibanamachine
Copy link
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create backports run node scripts/backport --pr 72492 or prevent reminders by adding the backport:skip label.

@kibanamachine kibanamachine added the backport missing Added to PRs automatically when the are determined to be missing a backport. label Sep 2, 2020
@kibanamachine
Copy link
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create backports run node scripts/backport --pr 72492 or prevent reminders by adding the backport:skip label.

mdelapenya added a commit to mdelapenya/kibana that referenced this pull request Sep 3, 2020
* 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]>
mdelapenya added a commit that referenced this pull request Sep 3, 2020
* 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]>
mdelapenya added a commit that referenced this pull request Sep 3, 2020
* 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]>
@kibanamachine kibanamachine removed the backport missing Added to PRs automatically when the are determined to be missing a backport. label Sep 3, 2020
@zube zube bot removed the [zube]: Done label Nov 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release_note:skip Skip the PR/issue when compiling release notes Team:APM All issues that need APM UI Team support Team:Uptime - DEPRECATED Synthetics & RUM sub-team of Application Observability v7.10.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants