Merge pull request #10045 from umbraco/v8/feature/update-cypress-and-fix-tests

Update cypress and fix tests
This commit is contained in:
Bjarke Berg
2021-03-24 14:26:06 +01:00
committed by GitHub
4 changed files with 12 additions and 5 deletions

View File

@@ -6,7 +6,10 @@ context('Languages', () => {
});
it('Add language', () => {
const name = "Kyrgyz (Kyrgyzstan)"; // Must be an option in the select box
// For some reason the languages to chose fom seems to be translated differently than normal, as an example:
// My system is set to EN (US), but most languages are translated into Danish for some reason
// Aghem seems untranslated though?
const name = "Aghem"; // Must be an option in the select box
cy.umbracoEnsureLanguageNameNotExists(name);

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"