Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions build/nightly-E2E-test-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -581,6 +581,23 @@ stages:
CONNECTIONSTRINGS__UMBRACODBDSN: Server=(local);Database=Umbraco;User Id=sa;Password=$(SA_PASSWORD);Encrypt=True;TrustServerCertificate=True
CONNECTIONSTRINGS__UMBRACODBDSN_PROVIDERNAME: Microsoft.Data.SqlClient
additionalEnvironmentVariables: false
# ContentSettingConfig
WindowsContentSettingsConfig:
vmImage: "windows-latest"
testFolder: "ContentSettingConfig"
port: ''
testCommand: "npx playwright test --project=contentSettingConfig"
CONNECTIONSTRINGS__UMBRACODBDSN: Data Source=(localdb)\MSSQLLocalDB;AttachDbFilename=|DataDirectory|\Umbraco.mdf;Integrated Security=True
CONNECTIONSTRINGS__UMBRACODBDSN_PROVIDERNAME: Microsoft.Data.SqlClient
additionalEnvironmentVariables: false
LinuxContentSettingsConfig:
vmImage: "ubuntu-latest"
testFolder: "ContentSettingConfig"
port: ''
testCommand: "npx playwright test --project=contentSettingConfig"
CONNECTIONSTRINGS__UMBRACODBDSN: Server=(local);Database=Umbraco;User Id=sa;Password=$(SA_PASSWORD);Encrypt=True;TrustServerCertificate=True
CONNECTIONSTRINGS__UMBRACODBDSN_PROVIDERNAME: Microsoft.Data.SqlClient
additionalEnvironmentVariables: false
# SMTP
LinuxSMTP:
vmImage: "ubuntu-latest"
Expand Down
8 changes: 4 additions & 4 deletions tests/Umbraco.Tests.AcceptanceTest/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion tests/Umbraco.Tests.AcceptanceTest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
},
"dependencies": {
"@umbraco/json-models-builders": "^2.0.42",
"@umbraco/playwright-testhelpers": "^17.0.11",
"@umbraco/playwright-testhelpers": "^17.0.13",
"camelize": "^1.0.0",
"dotenv": "^16.3.1",
"node-fetch": "^2.6.7"
Expand Down
11 changes: 11 additions & 0 deletions tests/Umbraco.Tests.AcceptanceTest/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,17 @@ export default defineConfig({
...devices['Desktop Chrome']
}
},
{
name: 'contentSettingConfig',
testMatch: 'ContentSettingConfig/**',
dependencies: ['setup'],
use: {
...devices['Desktop Chrome'],
// Use prepared auth state.
ignoreHTTPSErrors: true,
storageState: STORAGE_STATE
}
},
{
name: 'smtp',
testMatch: 'SMTP/*.spec.ts',
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{
"$schema": "appsettings-schema.json",
"Serilog": {
"MinimumLevel": {
"Default": "Information",
"Override": {
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information",
"System": "Warning"
}
},
"WriteTo": [
{
"Name": "Async",
"Args": {
"Configure": [
{
"Name": "Console"
}
]
}
}
]
},
"Umbraco": {
"CMS": {
"Content": {
"AllowEditInvariantFromNonDefault": false,
"ContentVersionCleanupPolicy": {
"EnableCleanup": true
}
},
"Global": {
"DisableElectionForSingleServer": true,
"InstallMissingDatabase": true,
"Id": "00000000-0000-0000-0000-000000000042",
"VersionCheckPeriod": 0,
"UseHttps": true
},
"Unattended": {
"InstallUnattended": true,
"UnattendedUserName": "Playwright Test",
"UnattendedUserEmail": "playwright@umbraco.com",
"UnattendedUserPassword": "UmbracoAcceptance123!"
},
"HealthChecks": {
"Notification": {
"Enabled": false
}
},
"KeepAlive": {
"DisableKeepAliveTask": true
},
"WebRouting": {
"UmbracoApplicationUrl": "https://localhost:44331/"
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
import {ConstantHelper, test, AliasHelper} from '@umbraco/playwright-testhelpers';
import {expect} from '@playwright/test';

// Content
const englishContentName = 'English Content';
const danishContentName = 'Danish Content';
const contentText = 'This is test content text';
// Document Type
const documentTypeName = 'TestDocumentTypeForContent';
// Data Type
const textStringDataTypeName = 'Textstring';
// Languages
const firstCulture = 'en-US';
const secondCulture = 'da';
// Cultures
const cultures = [
{ isoCode: firstCulture, name: englishContentName },
{ isoCode: secondCulture, name: danishContentName },
];

test.beforeEach(async ({umbracoApi}) => {
await umbracoApi.documentType.ensureNameNotExists(documentTypeName);
await umbracoApi.language.createDanishLanguage();
});

test.afterEach(async ({umbracoApi}) => {
await umbracoApi.document.ensureNameNotExists(englishContentName);
await umbracoApi.documentType.ensureNameNotExists(documentTypeName);
await umbracoApi.language.ensureIsoCodeNotExists(secondCulture);
});

// This is a test for the regression issue #20250
test('cannot edit invariant property editor value in other languages than default one if AllowEditInvariantFromNonDefault is false', async ({umbracoApi, umbracoUi}) => {
// Arrange
const textStringDataType = await umbracoApi.dataType.getByName(textStringDataTypeName);
const documentTypeId = await umbracoApi.documentType.createDocumentTypeWithPropertyEditor(documentTypeName, textStringDataTypeName, textStringDataType.id, 'TestGroup', true, false);
await umbracoApi.document.createDocumentWithMultipleVariantsWithSharedProperty(englishContentName, documentTypeId, AliasHelper.toAlias(textStringDataTypeName), 'Umbraco.Textstring', cultures, '');
await umbracoUi.goToBackOffice();
await umbracoUi.content.goToSection(ConstantHelper.sections.content);

// Act
await umbracoUi.content.goToContentWithName(englishContentName);
await umbracoUi.content.enterTextstring(contentText);
await umbracoUi.content.clickSaveAndPublishButton();
await umbracoUi.content.clickContainerSaveAndPublishButton();
await umbracoUi.content.isSuccessNotificationVisible();
await umbracoUi.content.switchLanguage(secondCulture);

// Assert
await umbracoUi.content.isPropertyEditorUiWithNameReadOnly('text-box');
await umbracoUi.content.doesPropertyContainValue(AliasHelper.toAlias(textStringDataTypeName), contentText);
const contentData = await umbracoApi.document.getByName(englishContentName);
expect(contentData.variants.length).toBe(2);
expect(contentData.values.length).toBe(1);
expect(contentData.values[0].alias).toEqual(AliasHelper.toAlias(textStringDataTypeName));
expect(contentData.values[0].value).toEqual(contentText);
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
import {ConstantHelper, test, AliasHelper} from '@umbraco/playwright-testhelpers';
import {expect} from '@playwright/test';

// Content
const englishContentName = 'English Content';
const danishContentName = 'Danish Content';
const contentText = 'This is test content text';
// Document Type
const documentTypeName = 'TestDocumentTypeForContent';
// Data Type
const textStringDataTypeName = 'Textstring';
// Languages
const firstCulture = 'en-US';
const secondCulture = 'da';
// Cultures
const cultures = [
{ isoCode: firstCulture, name: englishContentName },
{ isoCode: secondCulture, name: danishContentName },
];

test.beforeEach(async ({umbracoApi}) => {
await umbracoApi.documentType.ensureNameNotExists(documentTypeName);
await umbracoApi.language.createDanishLanguage();
});

test.afterEach(async ({umbracoApi}) => {
await umbracoApi.document.ensureNameNotExists(englishContentName);
await umbracoApi.documentType.ensureNameNotExists(documentTypeName);
await umbracoApi.language.ensureIsoCodeNotExists(secondCulture);
});

// TODO: Remove .skip when issue #20633 is resolved
// Issue link: https://github.com/umbraco/Umbraco-CMS/issues/20633
test.skip('allow edit invariant property editor value in other languages than default one', async ({umbracoApi, umbracoUi}) => {
// Arrange
const textStringDataType = await umbracoApi.dataType.getByName(textStringDataTypeName);
const documentTypeId = await umbracoApi.documentType.createDocumentTypeWithPropertyEditor(documentTypeName, textStringDataTypeName, textStringDataType.id, 'TestGroup', true, false);
await umbracoApi.document.createDocumentWithMultipleVariantsWithSharedProperty(englishContentName, documentTypeId, AliasHelper.toAlias(textStringDataTypeName), 'Umbraco.Textstring', cultures, '');
await umbracoUi.goToBackOffice();
await umbracoUi.content.goToSection(ConstantHelper.sections.content);

// Act
await umbracoUi.content.goToContentWithName(englishContentName);
await umbracoUi.content.switchLanguage(secondCulture);
await umbracoUi.content.enterTextstring(contentText);
await umbracoUi.content.clickSaveAndPublishButton();
await umbracoUi.content.clickContainerSaveAndPublishButton();
await umbracoUi.content.isSuccessNotificationVisible();

// Assert
await umbracoUi.content.doesPropertyContainValue(AliasHelper.toAlias(textStringDataTypeName), contentText);
const contentData = await umbracoApi.document.getByName(englishContentName);
expect(contentData.variants.length).toBe(2);
expect(contentData.values.length).toBe(1);
expect(contentData.values[0].alias).toEqual(AliasHelper.toAlias(textStringDataTypeName));
expect(contentData.values[0].value).toEqual(contentText);
});
Loading