Skip to content

Commit

Permalink
[APM] Fix Cypress flaky test in Custom Links (#206108)
Browse files Browse the repository at this point in the history
## Summary

Fixes #206016

This PR aims to fix a flaky test that waits for an empty state screen,
which sometimes fails to appear.

The issue might happen because the data deletion action, which triggers
the empty state, is not completed properly. This action takes place in
the previous test and does not wait for the deletion to finish.

The proposed solution ensures that the test responsible for deleting the
data waits until the empty state appears after deletion, preventing the
next test from running too soon.

### Test locally

`````
node x-pack/solutions/observability/plugins/apm/scripts/test/e2e.js --server
node x-pack/solutions/observability/plugins/apm/scripts/test/e2e.js  --runner --open
`````

Run the
[custom_links.cy.ts](http://localhost:5620/__/#/specs/runner?file=cypress/e2e/settings/custom_links.cy.ts)
test.
  • Loading branch information
iblancof authored Jan 10, 2025
1 parent c88d519 commit 0229008
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,14 +109,12 @@ describe('Custom links', () => {
cy.visitKibana(basePath);
cy.getByTestSubj('editCustomLink').click();
cy.contains('Delete').click();
cy.getByTestSubj('customLinksEmptyPrompt').should('be.visible');
});

it('clears filter values when field is selected', () => {
cy.visitKibana(basePath);

// wait for empty prompt
cy.getByTestSubj('customLinksEmptyPrompt').should('be.visible');

cy.contains('Create custom link').click();
cy.getByTestSubj('filter-0').select('service.name');
cy.get('[data-test-subj="service.name.value"] [data-test-subj="comboBoxSearchInput"]').type(
Expand Down

0 comments on commit 0229008

Please sign in to comment.