v9: Fixing flaky cypress test "Macro in Grid" (#11485)

* 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 <niko737@edu.ucl.dk>
This commit is contained in:
Nikolaj Geisle
2021-10-26 15:01:14 +02:00
committed by GitHub
parent a7ff1e2c93
commit 34be464cf8
3 changed files with 5 additions and 4 deletions

View File

@@ -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>

View File

@@ -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();

View File

@@ -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