Skip to content

Commit

Permalink
fix: Reduce Firewall create and update e2e test flakiness (#9298)
Browse files Browse the repository at this point in the history
* Click back into field to dismiss autocomplete popper

* Fix issue with LinodeSelectV2 label/text field association, update test to find input by label

* Clean up, click back into select field to dismiss autocomplete popper

* Find button within group to avoid selecting drawer title

* Offload interactions involving firewall creation to API

* Wait for firewall create requests

* Add intercepts and wait for Firewall update API requests to resolve

* Added changeset: Fix LinodeSelectV2 label association

* Fix flake involving Linode selection when capturing image
  • Loading branch information
jdamore-linode authored Jun 23, 2023
1 parent e85306c commit 210b476
Show file tree
Hide file tree
Showing 6 changed files with 274 additions and 206 deletions.
5 changes: 5 additions & 0 deletions packages/manager/.changeset/pr-9298-fixed-1687455527847.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@linode/manager": Fixed
---

Fix LinodeSelectV2 label association ([#9298](https://github.com/linode/manager/pull/9298))
32 changes: 20 additions & 12 deletions packages/manager/cypress/e2e/core/firewalls/create-firewall.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,13 @@ describe('create firewall', () => {
cy.findByText('Label is required.');
// Fill out and submit firewall create form.
containsClick('Label').type(firewall.label);
getClick('[data-testid="create-firewall-submit"]');
ui.buttonGroup
.findButtonByTitle('Create Firewall')
.should('be.visible')
.should('be.enabled')
.click();
});
cy.wait('@createFirewall');

// Confirm that firewall is listed on landing page with expected configuration.
cy.findByText(firewall.label)
Expand Down Expand Up @@ -75,24 +80,27 @@ describe('create firewall', () => {
.within(() => {
// Fill out and submit firewall create form.
containsClick('Label').type(firewall.label);
cy.get('[data-testid="textfield-input"]:last')
cy.findByLabelText('Linodes')
.should('be.visible')
.click()
.type(linode.label);
});

ui.autocompletePopper
.findByTitle(linode.label)
.should('be.visible')
.click();
ui.autocompletePopper
.findByTitle(linode.label)
.should('be.visible')
.click();

ui.drawer
.findByTitle('Create Firewall')
.should('be.visible')
.within(() => {
getClick('[data-testid="create-firewall-submit"]');
cy.findByLabelText('Linodes').should('be.visible').click();

ui.buttonGroup
.findButtonByTitle('Create Firewall')
.should('be.visible')
.should('be.enabled')
.click();
});

cy.wait('@createFirewall');

// Confirm that firewall is listed on landing page with expected configuration.
cy.findByText(firewall.label)
.closest('tr')
Expand Down
Loading

0 comments on commit 210b476

Please sign in to comment.