Fixed acceptance tests to use v9 templates

This commit is contained in:
Bjarke Berg
2021-09-15 14:54:27 +02:00
parent 9b2acd098c
commit 35cfcfcc0c
2 changed files with 12 additions and 14 deletions

View File

@@ -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<ContentModels.UrlPickerTest>' +
'\n@using ContentModels = Umbraco.Web.PublishedModels;' +
cy.editTemplate(urlPickerDocTypeName, '@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage<UrlPickerTest>' +
'\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 = '<a href="/">UrlPickerContent</a>';
cy.umbracoVerifyRenderedViewContent('/', expected, true).should('be.true');
cy.umbracoVerifyRenderedViewContent('/', expected, true).should('be.true');
//clean
cy.umbracoEnsureDocumentTypeNameNotExists(urlPickerDocTypeName);
cy.umbracoEnsureTemplateNameNotExists(urlPickerDocTypeName);
});
});
});

View File

@@ -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<ContentModels.ApprovedColourTest>' +
'\n@using ContentModels = Umbraco.Web.PublishedModels;' +
cy.editTemplate(name, '@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage<ApprovedColourTest>' +
'\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<ContentModels.CheckboxList>' +
// '\n@using ContentModels = Umbraco.Web.PublishedModels;' +
@@ -94,4 +93,4 @@ context('DataTypes', () => {
// '\n}' +
// '\n<p>@Model.UmbracoTest</p>');
// });
});
});