From 35cfcfcc0c3bae775ec9e52371c07bd3be30d483 Mon Sep 17 00:00:00 2001 From: Bjarke Berg Date: Wed, 15 Sep 2021 14:54:27 +0200 Subject: [PATCH] Fixed acceptance tests to use v9 templates --- .../cypress/integration/Content/urlpicker.ts | 13 ++++++------- .../cypress/integration/DataTypes/dataTypes.ts | 13 ++++++------- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/src/Umbraco.Tests.AcceptanceTest/cypress/integration/Content/urlpicker.ts b/src/Umbraco.Tests.AcceptanceTest/cypress/integration/Content/urlpicker.ts index 1baab4c948..c8db6380ac 100644 --- a/src/Umbraco.Tests.AcceptanceTest/cypress/integration/Content/urlpicker.ts +++ b/src/Umbraco.Tests.AcceptanceTest/cypress/integration/Content/urlpicker.ts @@ -12,9 +12,9 @@ context('Url Picker', () => { }); it('Test Url Picker', () => { - + const urlPickerDocTypeName = 'Url Picker Test'; - const pickerDocTypeAlias = AliasHelper.toAlias(urlPickerDocTypeName); + const pickerDocTypeAlias = AliasHelper.toAlias(urlPickerDocTypeName); cy.umbracoEnsureDocumentTypeNameNotExists(urlPickerDocTypeName); cy.deleteAllContent(); const pickerDocType = new DocumentTypeBuilder() @@ -31,8 +31,7 @@ context('Url Picker', () => { .build(); cy.saveDocumentType(pickerDocType); - cy.editTemplate(urlPickerDocTypeName, '@inherits Umbraco.Web.Mvc.UmbracoViewPage' + - '\n@using ContentModels = Umbraco.Web.PublishedModels;' + + cy.editTemplate(urlPickerDocTypeName, '@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage' + '\n@{' + '\n Layout = null;' + '\n}' + @@ -61,13 +60,13 @@ context('Url Picker', () => { //Assert cy.get('.umb-notifications__notifications > .alert-error').should('not.exist'); //Editing template with some content - + //Testing if the edits match the expected results const expected = 'UrlPickerContent'; - cy.umbracoVerifyRenderedViewContent('/', expected, true).should('be.true'); + cy.umbracoVerifyRenderedViewContent('/', expected, true).should('be.true'); //clean cy.umbracoEnsureDocumentTypeNameNotExists(urlPickerDocTypeName); cy.umbracoEnsureTemplateNameNotExists(urlPickerDocTypeName); }); -}); \ No newline at end of file +}); diff --git a/src/Umbraco.Tests.AcceptanceTest/cypress/integration/DataTypes/dataTypes.ts b/src/Umbraco.Tests.AcceptanceTest/cypress/integration/DataTypes/dataTypes.ts index a8c2d8d151..9e1e6cc185 100644 --- a/src/Umbraco.Tests.AcceptanceTest/cypress/integration/DataTypes/dataTypes.ts +++ b/src/Umbraco.Tests.AcceptanceTest/cypress/integration/DataTypes/dataTypes.ts @@ -32,12 +32,11 @@ context('DataTypes', () => { cy.umbracoTreeItem("content", [name]).click(); //Pick a colour cy.get('.btn-000000').click(); - //Save + //Save cy.umbracoButtonByLabelKey('buttons_saveAndPublish').click(); cy.umbracoSuccessNotification().should('be.visible'); //Editing template with some content - cy.editTemplate(name, '@inherits Umbraco.Web.Mvc.UmbracoViewPage' + - '\n@using ContentModels = Umbraco.Web.PublishedModels;' + + cy.editTemplate(name, '@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage' + '\n@{' + '\n Layout = null;' + '\n}' + @@ -49,7 +48,7 @@ context('DataTypes', () => { //Pick another colour to verify both work cy.get('.btn-FF0000').click(); - //Save + //Save cy.umbracoButtonByLabelKey('buttons_saveAndPublish').click(); cy.umbracoSuccessNotification().should('be.visible'); //Assert @@ -64,7 +63,7 @@ context('DataTypes', () => { // it('Tests Checkbox List', () => { // const name = 'CheckBox List'; - // const alias = AliasHelper.toAlias(name); + // const alias = AliasHelper.toAlias(name); // cy.umbracoEnsureDocumentTypeNameNotExists(name); // cy.umbracoEnsureDataTypeNameNotExists(name); @@ -85,7 +84,7 @@ context('DataTypes', () => { // //Save // cy.umbracoButtonByLabelKey('buttons_saveAndPublish').click(); // cy.umbracoSuccessNotification().should('be.visible'); - + // //Edit template with content // cy.editTemplate(name, '@inherits Umbraco.Web.Mvc.UmbracoViewPage' + // '\n@using ContentModels = Umbraco.Web.PublishedModels;' + @@ -94,4 +93,4 @@ context('DataTypes', () => { // '\n}' + // '\n

@Model.UmbracoTest

'); // }); -}); \ No newline at end of file +});