Update cypress and fix tests

This commit is contained in:
Mole
2021-03-23 13:03:01 +01:00
parent 653bf52a1c
commit 14c2bb4aa2
3 changed files with 8 additions and 4 deletions

View File

@@ -23,14 +23,18 @@ context('Templates', () => {
cy.umbracoEnsureTemplateNameNotExists(name);
createTemplate();
// We have to wait for the ace editor to load, because when the editor is loading it will "steal" the focus briefly,
// which causes the save event to fire if we've added something to the header field, causing errors.
cy.wait(500);
//Type name
cy.umbracoEditorHeaderName(name);
// Save
// We must drop focus for the auto save event to occur.
cy.get('.btn-success').focus();
// And then wait for the auto save event to finish by finding the page in the tree view.
// This is a bit of a roundabout way to find items in a treev view since we dont use umbracoTreeItem
// but we must be able to wait for the save evnent to finish, and we can't do that with umbracoTreeItem
// This is a bit of a roundabout way to find items in a tree view since we dont use umbracoTreeItem
// but we must be able to wait for the save event to finish, and we can't do that with umbracoTreeItem
cy.get('[data-element="tree-item-templates"] > :nth-child(2) > .umb-animated > .umb-tree-item__inner > .umb-tree-item__label')
.contains(name).should('be.visible', { timeout: 10000 });
// Now that the auto save event has finished we can save

View File

@@ -49,7 +49,7 @@ function resetTourData() {
{
"alias": "umbIntroIntroduction",
"completed": false,
"disabled": false
"disabled": true
};
cy.getCookie('UMB-XSRF-TOKEN', { log: false }).then((token) => {

View File

@@ -7,7 +7,7 @@
},
"devDependencies": {
"cross-env": "^7.0.2",
"cypress": "^6.0.1",
"cypress": "^6.8.0",
"ncp": "^2.0.0",
"prompt": "^1.0.0",
"umbraco-cypress-testhelpers": "^1.0.0-beta-52"