Skip to content

Commit

Permalink
v9: Fixing flaky cypress test "Macro in Grid" (umbraco#11485)
Browse files Browse the repository at this point in the history
* fixed flaky macro test and updated cypress version

* fixed flaky macro test and updated cypress version

* Update package.json

* Fixed failing tabs test

* Amend magic numbers with actual wait

* Update tests/Umbraco.Tests.AcceptanceTest/cypress/integration/Content/content.ts

* Updated UI to click on button instead of icon

* Make macro test click bottom to ensure we're not clicking on icon

Co-authored-by: Nikolaj Geisle <[email protected]>
  • Loading branch information
Zeegaan and Nikolaj Geisle authored Oct 26, 2021
1 parent a7ff1e2 commit 34be464
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@
<p ng-bind="a11yInfo" role="alert"></p>
<ul class="umb-card-grid -three-in-row">
<li ng-repeat="availableItem in macros | orderBy:'name' | filter:model.searchTerm">
<button class="btn-reset umb-card-grid-item" title="{{availableItem.name}}" ng-click="selectMacro(availableItem)">
<button class="btn-reset umb-card-grid-item" title="{{availableItem.name}}" ng-click="selectMacro(availableItem)">
<span>
<umb-icon icon="icon-settings-alt"></umb-icon>
{{availableItem.name}}
</span>
</button>
</button>
</li>
</ul>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -759,7 +759,8 @@ context('Content', () => {
// Click macro
cy.get(':nth-child(4) > .umb-card-grid-item > :nth-child(1)').click();
// Select the macro
cy.get('.umb-card-grid-item').contains(macroName).click();
cy.get(`.umb-card-grid-item[title='${macroName}']`).click('bottom');


// Save and publish
cy.umbracoButtonByLabelKey('buttons_saveAndPublish').click();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ import {
//Check if tab is there, else if it wasnt created, this test would always pass
cy.get('[title="aTab 1"]').should('be.visible');
//Delete a tab
cy.get('.btn-reset > [icon="icon-trash"]').click();
cy.get('.btn-reset > [icon="icon-trash"]').first().click();
cy.get('.umb-button > .btn').last().click();
cy.umbracoButtonByLabelKey('buttons_save').click();
//Assert
Expand Down

0 comments on commit 34be464

Please sign in to comment.