Skip to content

Commit 0bd82d3

Browse files
Zeegaannul800sebastiaan
authored andcommitted
v9: Update cypress to newest version and fix errors (#11486)
* fixed flaky macro test and updated cypress version * fixed flaky macro test and updated cypress version * Update package.json * Updated cypress to 8.6 and fixed failing script test * Updated cypress to 8.6 and fixed failing script test * Update package-lock.json * Fixed Scripts and stylesheet tests with proper waits instead of magic numbers * Updated to newest version of cypress and fixed template test * Remove duplicate click * Revert version to 8.4.1 * changed template Co-authored-by: Nikolaj Geisle <[email protected]> (cherry picked from commit e9ae567) # Conflicts: # src/Umbraco.Tests.AcceptanceTest/package.json # tests/Umbraco.Tests.AcceptanceTest/package-lock.json
1 parent ac83a32 commit 0bd82d3

File tree

5 files changed

+1763
-5
lines changed

5 files changed

+1763
-5
lines changed

src/Umbraco.Tests.AcceptanceTest/cypress/integration/Settings/scripts.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ context('Scripts', () => {
2424

2525
cy.umbracoContextMenuAction("action-create").click();
2626
cy.get('.menu-label').first().click(); // TODO: Fucked we cant use something like cy.umbracoContextMenuAction("action-mediaType").click();
27+
//We have to wait here till everything is loaded, or worker will throw error
28+
cy.intercept('/umbraco/lib/ace-builds/src-min-noconflict/worker-javascript.js').as('aceWorker');
29+
cy.wait('@aceWorker');
2730

2831
//Type name
2932
cy.umbracoEditorHeaderName(name);
@@ -33,6 +36,8 @@ context('Scripts', () => {
3336

3437
//Assert
3538
cy.umbracoSuccessNotification().should('be.visible');
39+
40+
3641
cy.umbracoScriptExists(fileName).should('be.true');
3742

3843

src/Umbraco.Tests.AcceptanceTest/cypress/integration/Settings/stylesheets.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ context('Stylesheets', () => {
1818

1919
cy.umbracoContextMenuAction("action-create").click();
2020
cy.get('.menu-label').first().click(); // TODO: Fucked we cant use something like cy.umbracoContextMenuAction("action-mediaType").click();
21-
21+
//We have to wait here till everything is loaded, or worker will throw error
22+
cy.intercept('/umbraco/lib/ace-builds/src-min-noconflict/worker-css.js').as('aceWorker');
23+
cy.wait('@aceWorker');
2224
//Type name
2325
cy.umbracoEditorHeaderName(name);
2426

src/Umbraco.Tests.AcceptanceTest/cypress/integration/Settings/templates.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ context('Templates', () => {
136136
// Insert macro
137137
cy.umbracoButtonByLabelKey('general_insert').click();
138138
cy.get('.umb-insert-code-box__title').contains('Macro').click();
139-
cy.get('.umb-card-grid-item').contains(name).click();
139+
cy.get(`.umb-card-grid-item[title='${name}']`).click('bottom');
140140

141141
// Assert
142142
cy.get('.ace_content').contains('@Umbraco.RenderMacro("' + name + '")').should('exist');

src/Umbraco.Tests.AcceptanceTest/package.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
{
2+
"name": "acceptancetest",
3+
"private": true,
24
"scripts": {
35
"postinstall": "node postinstall.js",
46
"config": "node config.js",
@@ -7,10 +9,11 @@
79
},
810
"devDependencies": {
911
"cross-env": "^7.0.2",
10-
"cypress": "^6.8.0",
12+
"cypress": "8.4.1",
13+
"del": "^6.0.0",
1114
"ncp": "^2.0.0",
12-
"prompt": "^1.0.0",
13-
"umbraco-cypress-testhelpers": "^1.0.0-beta-57"
15+
"prompt": "^1.2.0",
16+
"umbraco-cypress-testhelpers": "^1.0.0-beta-58"
1417
},
1518
"dependencies": {
1619
"typescript": "^3.9.2"

0 commit comments

Comments
 (0)