forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[APM UI] Rephrase BDD steps for RUM scenarios (elastic#72492) (elasti…
…c#76615) * 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]>
- Loading branch information
1 parent
5110084
commit 092f51c
Showing
5 changed files
with
48 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
x-pack/plugins/apm/e2e/cypress/support/step_definitions/rum/client_metrics_helper.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
* 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 { DEFAULT_TIMEOUT } from './rum_dashboard'; | ||
|
||
/** | ||
* Verifies the behavior of the client metrics component | ||
* @param metrics array of three elements | ||
* @param checkTitleStatus if it's needed to check title elements | ||
*/ | ||
export function verifyClientMetrics( | ||
metrics: string[], | ||
checkTitleStatus: boolean | ||
) { | ||
const clientMetricsSelector = '[data-cy=client-metrics] .euiStat__title'; | ||
|
||
// wait for all loading to finish | ||
cy.get('kbnLoadingIndicator').should('not.be.visible'); | ||
|
||
if (checkTitleStatus) { | ||
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(clientMetricsSelector).eq(0).should('have.text', metrics[0]); | ||
|
||
cy.get(clientMetricsSelector).eq(1).should('have.text', metrics[1]); | ||
|
||
cy.get(clientMetricsSelector).eq(2).should('have.text', metrics[2]); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters