Skip to content

Commit

Permalink
Fixes for ace editor in cypress tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bergmania committed Aug 20, 2020
1 parent 1512496 commit 67c25ad
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,9 @@ context('Partial View Macro Files', () => {
.withName(name)
.withContent("@inherits Umbraco.Web.Macros.PartialViewMacroPage")
.build();

cy.savePartialViewMacro(partialViewMacro);

// Navigate to settings
cy.umbracoSection('settings');
cy.get('li .umb-tree-root:contains("Settings")').should("be.visible");
Expand All @@ -133,7 +133,7 @@ context('Partial View Macro Files', () => {
.withName(name)
.withContent("@inherits Umbraco.Web.Macros.PartialViewMacroPage")
.build();

cy.savePartialViewMacro(partialViewMacro);

// Navigate to settings
Expand All @@ -142,7 +142,7 @@ context('Partial View Macro Files', () => {
cy.umbracoTreeItem("settings", ["Partial View Macro Files", fullName]).click();

// Type an edit
cy.get('.ace_content').type(" // test");
cy.get('.ace_text-input').type(" // test", {force:true} );
// Save
cy.get('.btn-success').click();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,11 @@ context('Partial Views', () => {
cy.umbracoContextMenuAction("action-delete").click();
cy.umbracoButtonByLabelKey("general_ok").click();

// Assert
// Assert
cy.contains(fileName).should('not.exist');
cy.umbracoPartialViewExists(fileName).then(exists => { expect(exists).to.be.false; });

// Clean
// Clean
cy.umbracoEnsurePartialViewNameNotExists(fileName);
});

Expand All @@ -132,7 +132,7 @@ context('Partial Views', () => {
// Open partial view
cy.umbracoTreeItem("settings", ["Partial Views", fileName]).click();
// Edit
cy.get('.ace_content').type("var num = 5;");
cy.get('.ace_text-input').type("var num = 5;", {force:true} );
cy.get('.btn-success').click();

// Assert
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ context('Templates', () => {
/* Make an edit, if you don't the file will be create twice,
only happens in testing though, probably because the test is too fast
Certifiably mega wonk regardless */
cy.get('.ace_content').type("var num = 5;");
cy.get('.ace_text-input').type("var num = 5;", {force:true} );

//Save
cy.get('.btn-success').click();
Expand Down Expand Up @@ -59,10 +59,11 @@ context('Templates', () => {
// Open partial view
cy.umbracoTreeItem("settings", ["Templates", name]).click();
// Edit
cy.get('.ace_content').type(edit);
cy.get('.ace_text-input').type(edit, {force:true} );

// Navigate away
cy.umbracoSection('content');
// Click stay button
// Click stay button
cy.get('umb-button[label="Stay"] button:enabled').click();

// Assert
Expand Down Expand Up @@ -91,7 +92,8 @@ context('Templates', () => {
// Open partial view
cy.umbracoTreeItem("settings", ["Templates", name]).click();
// Edit
cy.get('.ace_content').type(edit);
cy.get('.ace_text-input').type(edit, {force:true} );

// Navigate away
cy.umbracoSection('content');
// Click discard
Expand Down

0 comments on commit 67c25ad

Please sign in to comment.