diff --git a/build/azure-pipelines.yml b/build/azure-pipelines.yml index 386b08a41d..ef825ade5a 100644 --- a/build/azure-pipelines.yml +++ b/build/azure-pipelines.yml @@ -21,6 +21,26 @@ parameters: displayName: Upload API docs type: boolean default: false + - name: forceReleaseTestFilter + displayName: Force to use the release test filters + type: boolean + default: false + - name: integrationNonReleaseTestFilter + displayName: TestFilter used for non-release type builds + type: string + default: '--filter TestCategory!=LongRunning&TestCategory!=NonCritical' + - name: integrationReleaseTestFilter + displayName: TestFilter used for release type builds + type: string + default: ' ' + - name: nonWindowsIntegrationNonReleaseTestFilter + displayName: TestFilter used for non-release type builds on non windows agents + type: string + default: '--filter TestCategory!=LongRunning&TestCategory!=NonCritical' + - name: nonWindowsIntegrationReleaseTestFilter + displayName: TestFilter used for release type builds on non windows agents + type: string + default: ' ' variables: nodeVersion: 18.16.0 @@ -268,12 +288,30 @@ stages: version: $(dotnetVersion) includePreviewVersions: $(dotnetIncludePreviewVersions) - task: DotNetCoreCLI@2 - displayName: Run dotnet test + displayName: Run dotnet test Windows + condition: eq(variables['Agent.OS'],'Windows_NT') inputs: command: test projects: '**/*.Tests.Integration.csproj' - arguments: '--configuration $(buildConfiguration) --no-build' testRunTitle: Integration Tests SQLite - $(Agent.OS) + ${{ if or( parameters.forceReleaseTestFilter, startsWith(variables['Build.SourceBranch'], 'refs/heads/release/')) }}: + arguments: '--configuration $(buildConfiguration) --no-build ${{parameters.integrationReleaseTestFilter}}' + ${{ else }}: + arguments: '--configuration $(buildConfiguration) ${{parameters.integrationNonReleaseTestFilter}}' + env: + Tests__Database__DatabaseType: 'Sqlite' + Umbraco__CMS__Global__MainDomLock: 'FileSystemMainDomLock' + - task: DotNetCoreCLI@2 + displayName: Run dotnet test Non Windows + condition: ne(variables['Agent.OS'],'Windows_NT') + inputs: + command: test + projects: '**/*.Tests.Integration.csproj' + testRunTitle: Integration Tests SQLite - $(Agent.OS) + ${{ if or( parameters.forceReleaseTestFilter, startsWith(variables['Build.SourceBranch'], 'refs/heads/release/')) }}: + arguments: '--configuration $(buildConfiguration) --no-build ${{parameters.nonWindowsIntegrationReleaseTestFilter}}' + ${{ else }}: + arguments: '--configuration $(buildConfiguration) ${{parameters.nonWindowsIntegrationNonReleaseTestFilter}}' env: Tests__Database__DatabaseType: 'Sqlite' Umbraco__CMS__Global__MainDomLock: 'FileSystemMainDomLock' @@ -315,12 +353,31 @@ stages: displayName: Start SQL Server (Linux only) condition: and(succeeded(), eq(variables['Agent.OS'], 'Linux')) - task: DotNetCoreCLI@2 - displayName: Run dotnet test + displayName: Run dotnet test Windows + condition: eq(variables['Agent.OS'],'Windows_NT') inputs: command: test projects: '**/*.Tests.Integration.csproj' - arguments: '--configuration $(buildConfiguration) --no-build' testRunTitle: Integration Tests SQL Server - $(Agent.OS) + ${{ if or( parameters.forceReleaseTestFilter, startsWith(variables['Build.SourceBranch'], 'refs/heads/release/')) }}: + arguments: '--configuration $(buildConfiguration) --no-build ${{parameters.integrationReleaseTestFilter}}' + ${{ else }}: + arguments: '--configuration $(buildConfiguration) --no-build ${{parameters.integrationNonReleaseTestFilter}}' + env: + Tests__Database__DatabaseType: $(testDb) + Tests__Database__SQLServerMasterConnectionString: $(connectionString) + Umbraco__CMS__Global__MainDomLock: 'SqlMainDomLock' + - task: DotNetCoreCLI@2 + displayName: Run dotnet test NonWindows + condition: ne(variables['Agent.OS'],'Windows_NT') + inputs: + command: test + projects: '**/*.Tests.Integration.csproj' + testRunTitle: Integration Tests SQL Server - $(Agent.OS) + ${{ if or( parameters.forceReleaseTestFilter, startsWith(variables['Build.SourceBranch'], 'refs/heads/release/')) }}: + arguments: '--configuration $(buildConfiguration) --no-build ${{parameters.nonWindowsIntegrationReleaseTestFilter}}' + ${{ else }}: + arguments: '--configuration $(buildConfiguration) --no-build ${{parameters.nonWindowsIntegrationNonReleaseTestFilter}}' env: Tests__Database__DatabaseType: $(testDb) Tests__Database__SQLServerMasterConnectionString: $(connectionString) diff --git a/build/nightly-build-trigger.yml b/build/nightly-build-trigger.yml new file mode 100644 index 0000000000..f8147da05c --- /dev/null +++ b/build/nightly-build-trigger.yml @@ -0,0 +1,34 @@ +name: Nightly_$(TeamProject)_$(Build.DefinitionName)_$(SourceBranchName)_$(Date:yyyyMMdd)$(Rev:.r) + +trigger: none + +schedules: +- cron: '0 0 * * *' + displayName: Daily midnight build + branches: + include: + - v9/dev + - v10/dev + - v12/dev + - v13/dev + - v14/dev + +steps: +- task: TriggerBuild@4 + inputs: + definitionIsInCurrentTeamProject: true + buildDefinition: '301' + queueBuildForUserThatTriggeredBuild: true + ignoreSslCertificateErrors: false + useSameSourceVersion: false + useCustomSourceVersion: false + useSameBranch: true + waitForQueuedBuildsToFinish: false + storeInEnvironmentVariable: false + templateParameters: 'sqlServerIntegrationTests: true, forceReleaseTestFilter: true' + authenticationMethod: 'OAuth Token' + enableBuildInQueueCondition: false + dependentOnSuccessfulBuildCondition: false + dependentOnFailedBuildCondition: false + checkbuildsoncurrentbranch: false + failTaskIfConditionsAreNotFulfilled: false \ No newline at end of file diff --git a/src/Umbraco.Core/Configuration/Models/NuCacheSettings.cs b/src/Umbraco.Core/Configuration/Models/NuCacheSettings.cs index 490e03096d..309c4560cf 100644 --- a/src/Umbraco.Core/Configuration/Models/NuCacheSettings.cs +++ b/src/Umbraco.Core/Configuration/Models/NuCacheSettings.cs @@ -14,6 +14,7 @@ public class NuCacheSettings internal const string StaticNuCacheSerializerType = "MessagePack"; internal const int StaticSqlPageSize = 1000; internal const int StaticKitBatchSize = 1; + internal const bool StaticUsePagedSqlQuery = true; /// /// Gets or sets a value defining the BTree block size. @@ -39,4 +40,7 @@ public class NuCacheSettings public int KitBatchSize { get; set; } = StaticKitBatchSize; public bool UnPublishedContentCompression { get; set; } = false; + + [DefaultValue(StaticUsePagedSqlQuery)] + public bool UsePagedSqlQuery { get; set; } = true; } diff --git a/src/Umbraco.Core/PropertyEditors/DefaultPropertyValueConverterAttribute.cs b/src/Umbraco.Core/PropertyEditors/DefaultPropertyValueConverterAttribute.cs index b74d9903cf..a414d76542 100644 --- a/src/Umbraco.Core/PropertyEditors/DefaultPropertyValueConverterAttribute.cs +++ b/src/Umbraco.Core/PropertyEditors/DefaultPropertyValueConverterAttribute.cs @@ -16,11 +16,10 @@ public class DefaultPropertyValueConverterAttribute : Attribute /// a DefaultPropertyValueConverter can be more specific than another one. /// /// - /// An example where this is useful is that both the RelatedLiksEditorValueConverter and the JsonValueConverter + /// An example where this is useful is that both the MultiUrlPickerValueConverter and the JsonValueConverter /// will be returned as value converters for the Related Links Property editor, however the JsonValueConverter - /// is a very generic converter and the RelatedLiksEditorValueConverter is more specific than it, so the - /// RelatedLiksEditorValueConverter - /// can specify that it 'shadows' the JsonValueConverter. + /// is a very generic converter and the MultiUrlPickerValueConverter is more specific than it, so the + /// MultiUrlPickerValueConverter can specify that it 'shadows' the JsonValueConverter. /// public Type[] DefaultConvertersToShadow { get; } } diff --git a/src/Umbraco.PublishedCache.NuCache/Persistence/NuCacheContentRepository.cs b/src/Umbraco.PublishedCache.NuCache/Persistence/NuCacheContentRepository.cs index 75208b2b16..af8c46821f 100644 --- a/src/Umbraco.PublishedCache.NuCache/Persistence/NuCacheContentRepository.cs +++ b/src/Umbraco.PublishedCache.NuCache/Persistence/NuCacheContentRepository.cs @@ -221,19 +221,12 @@ AND cmsContentNu.nodeId IS NULL .Append(SqlObjectTypeNotTrashed(SqlContext, Constants.ObjectTypes.Document)) .Append(SqlOrderByLevelIdSortOrder(SqlContext)); - // Use a more efficient COUNT query - Sql? sqlCountQuery = SqlContentSourcesCount() - .Append(SqlObjectTypeNotTrashed(SqlContext, Constants.ObjectTypes.Document)); - - Sql? sqlCount = - SqlContext.Sql("SELECT COUNT(*) FROM (").Append(sqlCountQuery).Append(") npoco_tbl"); - IContentCacheDataSerializer serializer = _contentCacheDataSerializerFactory.Create(ContentCacheDataSerializerEntityType.Document); - // We need to page here. We don't want to iterate over every single row in one connection cuz this can cause an SQL Timeout. - // We also want to read with a db reader and not load everything into memory, QueryPaged lets us do that. - foreach (ContentSourceDto row in Database.QueryPaged(_nucacheSettings.Value.SqlPageSize, sql, sqlCount)) + IEnumerable dtos = GetContentNodeDtos(sql); + + foreach (ContentSourceDto row in dtos) { yield return CreateContentNodeKit(row, serializer); } @@ -246,19 +239,12 @@ AND cmsContentNu.nodeId IS NULL .Append(SqlWhereNodeIdX(SqlContext, id)) .Append(SqlOrderByLevelIdSortOrder(SqlContext)); - // Use a more efficient COUNT query - Sql? sqlCountQuery = SqlContentSourcesCount(SqlContentSourcesSelectUmbracoNodeJoin) - .Append(SqlObjectTypeNotTrashed(SqlContext, Constants.ObjectTypes.Document)) - .Append(SqlWhereNodeIdX(SqlContext, id)); - Sql? sqlCount = - SqlContext.Sql("SELECT COUNT(*) FROM (").Append(sqlCountQuery).Append(") npoco_tbl"); - IContentCacheDataSerializer serializer = _contentCacheDataSerializerFactory.Create(ContentCacheDataSerializerEntityType.Document); - // We need to page here. We don't want to iterate over every single row in one connection cuz this can cause an SQL Timeout. - // We also want to read with a db reader and not load everything into memory, QueryPaged lets us do that. - foreach (ContentSourceDto row in Database.QueryPaged(_nucacheSettings.Value.SqlPageSize, sql, sqlCount)) + IEnumerable dtos = GetContentNodeDtos(sql); + + foreach (ContentSourceDto row in dtos) { yield return CreateContentNodeKit(row, serializer); } @@ -276,19 +262,12 @@ AND cmsContentNu.nodeId IS NULL .WhereIn(x => x.ContentTypeId, ids) .Append(SqlOrderByLevelIdSortOrder(SqlContext)); - // Use a more efficient COUNT query - Sql sqlCountQuery = SqlContentSourcesCount() - .Append(SqlObjectTypeNotTrashed(SqlContext, Constants.ObjectTypes.Document)) - .WhereIn(x => x.ContentTypeId, ids); - Sql? sqlCount = - SqlContext.Sql("SELECT COUNT(*) FROM (").Append(sqlCountQuery).Append(") npoco_tbl"); - IContentCacheDataSerializer serializer = _contentCacheDataSerializerFactory.Create(ContentCacheDataSerializerEntityType.Document); - // We need to page here. We don't want to iterate over every single row in one connection cuz this can cause an SQL Timeout. - // We also want to read with a db reader and not load everything into memory, QueryPaged lets us do that. - foreach (ContentSourceDto row in Database.QueryPaged(_nucacheSettings.Value.SqlPageSize, sql, sqlCount)) + IEnumerable dtos = GetContentNodeDtos(sql); + + foreach (ContentSourceDto row in dtos) { yield return CreateContentNodeKit(row, serializer); } @@ -319,18 +298,12 @@ AND cmsContentNu.nodeId IS NULL .Append(SqlObjectTypeNotTrashed(SqlContext, Constants.ObjectTypes.Media)) .Append(SqlOrderByLevelIdSortOrder(SqlContext)); - // Use a more efficient COUNT query - Sql? sqlCountQuery = SqlMediaSourcesCount() - .Append(SqlObjectTypeNotTrashed(SqlContext, Constants.ObjectTypes.Media)); - Sql? sqlCount = - SqlContext.Sql("SELECT COUNT(*) FROM (").Append(sqlCountQuery).Append(") npoco_tbl"); - IContentCacheDataSerializer serializer = _contentCacheDataSerializerFactory.Create(ContentCacheDataSerializerEntityType.Media); - // We need to page here. We don't want to iterate over every single row in one connection cuz this can cause an SQL Timeout. - // We also want to read with a db reader and not load everything into memory, QueryPaged lets us do that. - foreach (ContentSourceDto row in Database.QueryPaged(_nucacheSettings.Value.SqlPageSize, sql, sqlCount)) + IEnumerable dtos = GetContentNodeDtos(sql); + + foreach (ContentSourceDto row in dtos) { yield return CreateMediaNodeKit(row, serializer); } @@ -343,19 +316,12 @@ AND cmsContentNu.nodeId IS NULL .Append(SqlWhereNodeIdX(SqlContext, id)) .Append(SqlOrderByLevelIdSortOrder(SqlContext)); - // Use a more efficient COUNT query - Sql? sqlCountQuery = SqlMediaSourcesCount(SqlContentSourcesSelectUmbracoNodeJoin) - .Append(SqlObjectTypeNotTrashed(SqlContext, Constants.ObjectTypes.Media)) - .Append(SqlWhereNodeIdX(SqlContext, id)); - Sql? sqlCount = - SqlContext.Sql("SELECT COUNT(*) FROM (").Append(sqlCountQuery).Append(") npoco_tbl"); - IContentCacheDataSerializer serializer = _contentCacheDataSerializerFactory.Create(ContentCacheDataSerializerEntityType.Media); - // We need to page here. We don't want to iterate over every single row in one connection cuz this can cause an SQL Timeout. - // We also want to read with a db reader and not load everything into memory, QueryPaged lets us do that. - foreach (ContentSourceDto row in Database.QueryPaged(_nucacheSettings.Value.SqlPageSize, sql, sqlCount)) + IEnumerable dtos = GetContentNodeDtos(sql); + + foreach (ContentSourceDto row in dtos) { yield return CreateMediaNodeKit(row, serializer); } @@ -373,19 +339,12 @@ AND cmsContentNu.nodeId IS NULL .WhereIn(x => x.ContentTypeId, ids) .Append(SqlOrderByLevelIdSortOrder(SqlContext)); - // Use a more efficient COUNT query - Sql sqlCountQuery = SqlMediaSourcesCount() - .Append(SqlObjectTypeNotTrashed(SqlContext, Constants.ObjectTypes.Media)) - .WhereIn(x => x.ContentTypeId, ids); - Sql? sqlCount = - SqlContext.Sql("SELECT COUNT(*) FROM (").Append(sqlCountQuery).Append(") npoco_tbl"); - IContentCacheDataSerializer serializer = _contentCacheDataSerializerFactory.Create(ContentCacheDataSerializerEntityType.Media); - // We need to page here. We don't want to iterate over every single row in one connection cuz this can cause an SQL Timeout. - // We also want to read with a db reader and not load everything into memory, QueryPaged lets us do that. - foreach (ContentSourceDto row in Database.QueryPaged(_nucacheSettings.Value.SqlPageSize, sql, sqlCount)) + IEnumerable dtos = GetContentNodeDtos(sql); + + foreach (ContentSourceDto row in dtos) { yield return CreateMediaNodeKit(row, serializer); } @@ -1030,4 +989,29 @@ WHERE cmsContentNu.nodeId IN ( return s; } + + private IEnumerable GetContentNodeDtos(Sql sql) + { + // We need to page here. We don't want to iterate over every single row in one connection cuz this can cause an SQL Timeout. + // We also want to read with a db reader and not load everything into memory, QueryPaged lets us do that. + // QueryPaged is very slow on large sites however, so use fetch if UsePagedSqlQuery is disabled. + IEnumerable dtos; + if (_nucacheSettings.Value.UsePagedSqlQuery) + { + // Use a more efficient COUNT query + Sql? sqlCountQuery = SqlContentSourcesCount() + .Append(SqlObjectTypeNotTrashed(SqlContext, Constants.ObjectTypes.Document)); + + Sql? sqlCount = + SqlContext.Sql("SELECT COUNT(*) FROM (").Append(sqlCountQuery).Append(") npoco_tbl"); + + dtos = Database.QueryPaged(_nucacheSettings.Value.SqlPageSize, sql, sqlCount); + } + else + { + dtos = Database.Fetch(sql); + } + + return dtos; + } } diff --git a/src/Umbraco.Web.BackOffice/Controllers/AuthenticationController.cs b/src/Umbraco.Web.BackOffice/Controllers/AuthenticationController.cs index d3a47157c0..cce95fd609 100644 --- a/src/Umbraco.Web.BackOffice/Controllers/AuthenticationController.cs +++ b/src/Umbraco.Web.BackOffice/Controllers/AuthenticationController.cs @@ -1,5 +1,6 @@ using System.Globalization; using System.Security.Claims; +using System.Security.Cryptography; using Microsoft.AspNetCore.Authentication; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Http; @@ -429,6 +430,8 @@ public class AuthenticationController : UmbracoApiControllerBase } } + await Task.Delay(RandomNumberGenerator.GetInt32(400, 2500)); + return Ok(); } diff --git a/src/Umbraco.Web.BackOffice/Security/ConfigureBackOfficeIdentityOptions.cs b/src/Umbraco.Web.BackOffice/Security/ConfigureBackOfficeIdentityOptions.cs index e3f897018a..211528afab 100644 --- a/src/Umbraco.Web.BackOffice/Security/ConfigureBackOfficeIdentityOptions.cs +++ b/src/Umbraco.Web.BackOffice/Security/ConfigureBackOfficeIdentityOptions.cs @@ -38,6 +38,8 @@ public sealed class ConfigureBackOfficeIdentityOptions : IConfigureOptions $scope.preview($scope.content, defaultPreviewUrl, 'umbpreview'), + labelKey: "buttons_saveAndPreview" + }; + + const activeVariant = content.variants?.find((variant) => variant.compositeId === compositeId); + + $scope.previewSubButtons = activeVariant?.additionalPreviewUrls?.map((additionalPreviewUrl) => { + return { + alias: 'preview_' + additionalPreviewUrl.name, + label: additionalPreviewUrl.name, + // We use target _blank here. If we open the window in the same tab with a 'umb_preview_name' target, we get a cors js error. + handler: () => $scope.preview(content, additionalPreviewUrl.url, '_blank') + } + }); + $scope.page.showPreviewButton = true; } @@ -952,13 +987,13 @@ } }; - $scope.preview = function (content) { + $scope.preview = function (content, url, urlTarget) { - const openPreviewWindow = () => { + const openPreviewWindow = (url, target) => { // Chromes popup blocker will kick in if a window is opened // without the initial scoped request. This trick will fix that. - const previewWindow = $window.open(`preview/?id=${content.id}${$scope.culture ? `&culture=${$scope.culture}` : ''}`, 'umbpreview'); + const previewWindow = $window.open(url, target); previewWindow.addEventListener('load', () => { previewWindow.location.href = previewWindow.document.URL; @@ -969,7 +1004,7 @@ //The user cannot save if they don't have access to do that, in which case we just want to preview //and that's it otherwise they'll get an unauthorized access message if (!_.contains(content.allowedActions, "A")) { - openPreviewWindow(); + openPreviewWindow(url, urlTarget); } else { var selectedVariant = $scope.content.variants[0]; @@ -988,7 +1023,7 @@ //ensure the save flag is set for the active variant selectedVariant.save = true; performSave({ saveMethod: $scope.saveMethod(), action: "save" }).then(function (data) { - openPreviewWindow() + openPreviewWindow(url, urlTarget); }, function (err) { //validation issues .... }); diff --git a/src/Umbraco.Web.UI.Client/src/less/components/umb-property-editor.less b/src/Umbraco.Web.UI.Client/src/less/components/umb-property-editor.less index d2d6a970b9..c34ada479e 100644 --- a/src/Umbraco.Web.UI.Client/src/less/components/umb-property-editor.less +++ b/src/Umbraco.Web.UI.Client/src/less/components/umb-property-editor.less @@ -1,6 +1,10 @@ .umb-property-editor { position: relative; - contain: layout; + contain: style; + + &.is-preview { + contain: layout; + } } .umb-property-editor--preview { diff --git a/src/Umbraco.Web.UI.Client/src/views/components/buttons/umb-button-group.html b/src/Umbraco.Web.UI.Client/src/views/components/buttons/umb-button-group.html index 0462482112..f47b00913d 100644 --- a/src/Umbraco.Web.UI.Client/src/views/components/buttons/umb-button-group.html +++ b/src/Umbraco.Web.UI.Client/src/views/components/buttons/umb-button-group.html @@ -48,7 +48,8 @@ hotkey="{{subButton.hotKey}}" hotkey-when-hidden="{{subButton.hotKeyWhenHidden}}" ng-disabled="disabled"> - {{subButton.labelKey}} + {{subButton.labelKey}} + {{subButton.label}} ... diff --git a/src/Umbraco.Web.UI.Client/src/views/components/content/edit.html b/src/Umbraco.Web.UI.Client/src/views/components/content/edit.html index f031b4da9d..97ecb95f31 100644 --- a/src/Umbraco.Web.UI.Client/src/views/components/content/edit.html +++ b/src/Umbraco.Web.UI.Client/src/views/components/content/edit.html @@ -43,15 +43,16 @@ disabled="page.uploadsInProgress"> - - + +
@@ -13,7 +13,7 @@
- +
diff --git a/tests/Umbraco.Tests.AcceptanceTest/package-lock.json b/tests/Umbraco.Tests.AcceptanceTest/package-lock.json index 3eca295aac..2d0e5245f1 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/package-lock.json +++ b/tests/Umbraco.Tests.AcceptanceTest/package-lock.json @@ -8,7 +8,7 @@ "hasInstallScript": true, "dependencies": { "@umbraco/json-models-builders": "^1.0.6", - "@umbraco/playwright-testhelpers": "^1.0.24", + "@umbraco/playwright-testhelpers": "^1.0.25", "camelize": "^1.0.0", "dotenv": "^16.0.2", "faker": "^4.1.0", @@ -17,7 +17,7 @@ "xhr2": "^0.2.1" }, "devDependencies": { - "@playwright/test": "^1.32", + "@playwright/test": "^1.37", "del": "^6.0.0", "ncp": "^2.0.0", "prompt": "^1.2.0", @@ -86,19 +86,19 @@ } }, "node_modules/@playwright/test": { - "version": "1.32.3", - "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.32.3.tgz", - "integrity": "sha512-BvWNvK0RfBriindxhLVabi8BRe3X0J9EVjKlcmhxjg4giWBD/xleLcg2dz7Tx0agu28rczjNIPQWznwzDwVsZQ==", + "version": "1.37.1", + "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.37.1.tgz", + "integrity": "sha512-bq9zTli3vWJo8S3LwB91U0qDNQDpEXnw7knhxLM0nwDvexQAwx9tO8iKDZSqqneVq+URd/WIoz+BALMqUTgdSg==", "dev": true, "dependencies": { "@types/node": "*", - "playwright-core": "1.32.3" + "playwright-core": "1.37.1" }, "bin": { "playwright": "cli.js" }, "engines": { - "node": ">=14" + "node": ">=16" }, "optionalDependencies": { "fsevents": "2.3.2" @@ -141,9 +141,9 @@ } }, "node_modules/@umbraco/playwright-testhelpers": { - "version": "1.0.24", - "resolved": "https://registry.npmjs.org/@umbraco/playwright-testhelpers/-/playwright-testhelpers-1.0.24.tgz", - "integrity": "sha512-xYOgcnyvcEywgC9DT4Q3OhQDTfdtF1zXLQIXdjNtwr6a4j3SUab1RI/tGxlF01fX+8Ttw3edlV4l+HIrY0hM1Q==", + "version": "1.0.25", + "resolved": "https://registry.npmjs.org/@umbraco/playwright-testhelpers/-/playwright-testhelpers-1.0.25.tgz", + "integrity": "sha512-6H452J6LhP0EHjF4jR7V7i0U8WPTiAbSyhN1J459BbbYEJ4QX1A2ZlCdA6VSBAsK1xYdMXD+yxsVJq7AAwiy9A==", "dependencies": { "@umbraco/json-models-builders": "^1.0.6", "camelize": "^1.0.0", @@ -742,15 +742,15 @@ } }, "node_modules/playwright-core": { - "version": "1.32.3", - "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.32.3.tgz", - "integrity": "sha512-SB+cdrnu74ZIn5Ogh/8278ngEh9NEEV0vR4sJFmK04h2iZpybfbqBY0bX6+BLYWVdV12JLLI+JEFtSnYgR+mWg==", + "version": "1.37.1", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.37.1.tgz", + "integrity": "sha512-17EuQxlSIYCmEMwzMqusJ2ztDgJePjrbttaefgdsiqeLWidjYz9BxXaTaZWxH1J95SHGk6tjE+dwgWILJoUZfA==", "dev": true, "bin": { - "playwright": "cli.js" + "playwright-core": "cli.js" }, "engines": { - "node": ">=14" + "node": ">=16" } }, "node_modules/prompt": { diff --git a/tests/Umbraco.Tests.AcceptanceTest/package.json b/tests/Umbraco.Tests.AcceptanceTest/package.json index e6e4c264ff..cc3c7a6c40 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/package.json +++ b/tests/Umbraco.Tests.AcceptanceTest/package.json @@ -10,7 +10,7 @@ "createTest": "node createTest.js" }, "devDependencies": { - "@playwright/test": "^1.32", + "@playwright/test": "^1.37", "typescript": "^4.8.3", "tslib": "^2.4.0", "del": "^6.0.0", @@ -20,7 +20,7 @@ }, "dependencies": { "@umbraco/json-models-builders": "^1.0.6", - "@umbraco/playwright-testhelpers": "^1.0.24", + "@umbraco/playwright-testhelpers": "^1.0.25", "camelize": "^1.0.0", "faker": "^4.1.0", "form-data": "^4.0.0", diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/BlockGridEditor/Content/blockGridEditorContent.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/BlockGridEditor/Content/blockGridEditorContent.spec.ts index 9c610da191..8c5caeaa49 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/BlockGridEditor/Content/blockGridEditorContent.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/BlockGridEditor/Content/blockGridEditorContent.spec.ts @@ -346,7 +346,7 @@ test.describe('BlockGridEditorContent', () => { // Selects the created image for the block await page.locator('[data-content-element-type-key="' + element['key'] + '"]').click(); - await page.locator('[data-element="property-image"]').locator('[key="' + ConstantHelper.buttons.add + '"]').click(); + await page.getByRole('button', { name: 'Add', exact: true }).click(); await page.locator('[data-element="media-grid"] >> [title="' + imageName + '"]').click(); await umbracoUi.clickElement(umbracoUi.getButtonByLabelKey(ConstantHelper.buttons.select)); await page.locator('[label="Submit"]').click(); @@ -390,7 +390,7 @@ test.describe('BlockGridEditorContent', () => { await umbracoUi.clickElement(umbracoUi.getButtonByLabelKey(ConstantHelper.buttons.saveAndPublish)); // Assert - await umbracoUi.getSuccessNotification(); + await umbracoUi.isSuccessNotificationVisible(); // Checks if there are two blocks in the area await expect(page.locator('[data-element="property-' + blockGridAlias + '"]').locator('umb-block-grid-entry')).toHaveCount(2); @@ -458,10 +458,11 @@ test.describe('BlockGridEditorContent', () => { await page.locator('[title="Delete"]').nth(2).click(); await umbracoUi.clickElement(umbracoUi.getButtonByLabelKey('actions_delete')); - await umbracoUi.clickElement(umbracoUi.getButtonByLabelKey(ConstantHelper.buttons.saveAndPublish)); + await page.waitForTimeout(2000); + await page.getByRole('button', { name: 'Save and publish' }).click(); // Assert - await umbracoUi.getSuccessNotification(); + await umbracoUi.isSuccessNotificationVisible(); // Checks if there are two blocks in the area await expect(page.locator('[data-element="property-' + blockGridAlias + '"]').locator('umb-block-grid-entry')).toHaveCount(2); }); diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/BlockGridEditor/Datatype/BlockGridEditorDataTypeBlocks.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/BlockGridEditor/Datatype/BlockGridEditorDataTypeBlocks.spec.ts index 2acd818661..ff4a193f5c 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/BlockGridEditor/Datatype/BlockGridEditorDataTypeBlocks.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/BlockGridEditor/Datatype/BlockGridEditorDataTypeBlocks.spec.ts @@ -43,7 +43,7 @@ test.describe('BlockGridEditorDataTypeBlock', () => { return blockGridType; } - + test('can create empty block grid editor', async ({page, umbracoApi, umbracoUi}) => { await umbracoUi.goToSection(ConstantHelper.sections.settings); @@ -261,7 +261,7 @@ test.describe('BlockGridEditorDataTypeBlock', () => { test('can create a block grid datatype with multiple groups and multiple element in each group', async ({page, umbracoApi, umbracoUi},testInfo) => { await testInfo.slow(); - + const GroupOne = 'GroupOne'; const elementNameFourth = 'FourthElement'; const elementFourthAlias = AliasHelper.toAlias(elementNameFourth); @@ -362,7 +362,7 @@ test.describe('BlockGridEditorDataTypeBlock', () => { await expect(await umbracoApi.dataTypes.exists(blockGridName)).toBe(true); await umbracoUi.doesDataTypeExist(blockGridName); - // Clean + // Clean await umbracoApi.documentTypes.ensureNameNotExists(elementName); await umbracoApi.documentTypes.ensureNameNotExists(elementNameTwo); await umbracoApi.documentTypes.ensureNameNotExists(elementNameThree); @@ -552,6 +552,9 @@ test.describe('BlockGridEditorDataTypeBlock', () => { await umbracoUi.clickDataElementByElementName(ConstantHelper.actions.delete); await umbracoUi.clickElement(umbracoUi.getButtonByLabelKey(ConstantHelper.buttons.delete)); + // We need a wait to make sure the block grid editor is deleted + await page.waitForTimeout(1000); + // Assert // Checks if the block grid editor still exists await umbracoUi.goToSection(ConstantHelper.sections.settings); @@ -586,7 +589,7 @@ test.describe('BlockGridEditorDataTypeBlock', () => { const dragFrom = await page.locator('.umb-block-card-group').nth(0).locator('[data-content-element-type-key="' + element['key'] + '"]'); const dragTo = await page.locator('[key="blockEditor_addBlockType"]').nth(1); await umbracoUi.dragAndDrop(dragFrom, dragTo, 0, 0, 15); - + await umbracoUi.clickElement(umbracoUi.getButtonByLabelKey(ConstantHelper.buttons.save)); // Assert @@ -626,7 +629,7 @@ test.describe('BlockGridEditorDataTypeBlock', () => { const dragFrom = await page.locator('.umb-block-card-group >> [icon="icon-navigation"]').nth(0); const dragTo = await page.locator('[key="blockEditor_addBlockType"]').nth(2); await umbracoUi.dragAndDrop(dragFrom, dragTo, 0, 0, 15); - + await umbracoUi.clickElement(umbracoUi.getButtonByLabelKey(ConstantHelper.buttons.save)); // Assert @@ -642,7 +645,7 @@ test.describe('BlockGridEditorDataTypeBlock', () => { test('can move a group with elements in a block grid editor', async ({page, umbracoApi, umbracoUi}, testInfo) => { await testInfo.slow(); - + const GroupMove = 'GroupMove'; const GroupNotMoving = 'GroupNotMoving'; @@ -685,9 +688,9 @@ test.describe('BlockGridEditorDataTypeBlock', () => { const dragFrom = await page.locator('.umb-block-card-group >> [icon="icon-navigation"]').nth(0); const dragTo = await page.locator('[key="blockEditor_addBlockType"]').nth(2); await umbracoUi.dragAndDrop(dragFrom, dragTo, 20, 0, 15); - + await umbracoUi.clickElement(umbracoUi.getButtonByLabelKey(ConstantHelper.buttons.save)); - + // Assert await umbracoUi.isSuccessNotificationVisible(); // Checks if the elements were moved with their group @@ -716,4 +719,4 @@ test.describe('BlockGridEditorDataTypeBlock', () => { await umbracoApi.documentTypes.ensureNameNotExists(elementNameTwo); await umbracoApi.documentTypes.ensureNameNotExists(elementNameThree); }); -}); \ No newline at end of file +}); diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/BlockListEditor/blockListEditorContent.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/BlockListEditor/blockListEditorContent.spec.ts index 0c99d46ab5..ca67427968 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/BlockListEditor/blockListEditorContent.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/BlockListEditor/blockListEditorContent.spec.ts @@ -312,7 +312,7 @@ test.describe('BlockListEditorContent', () => { await umbracoUi.clickElement(umbracoUi.getButtonByLabelKey(ConstantHelper.buttons.saveAndPublish)); // Assert - await umbracoUi.getSuccessNotification(); + await umbracoUi.isSuccessNotificationVisible(); }); test('can set a maximum of required blocks in content with a block list editor', async ({page, umbracoApi, umbracoUi}) => { @@ -374,8 +374,11 @@ test.describe('BlockListEditorContent', () => { // Can't use our constant helper because the action for delete does not contain an s. The correct way is 'action-delete' await umbracoUi.clickElement(umbracoUi.getButtonByLabelKey('actions_delete')); + // Now that we deleted the block, we should be able to save our content + await umbracoUi.clickElement(umbracoUi.getButtonByLabelKey(ConstantHelper.buttons.saveAndPublish)); + // Assert - await umbracoUi.getSuccessNotification(); + await umbracoUi.isSuccessNotificationVisible(); }); test('can use inline editing mode in content with a block list editor', async ({page, umbracoApi, umbracoUi}) => { diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/content.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/content.spec.ts index 60d6c97f20..33402f0f8c 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/content.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/content.spec.ts @@ -275,7 +275,7 @@ test.describe('Content tests', () => { await umbracoUi.clickElement(umbracoUi.getTreeItem(ConstantHelper.sections.content, [initialNodeName])); const header = await page.locator('#headerName') - // Sadly playwright doesn't have a clear method for inputs :( + // Sadly playwright doesn't have a clear method for inputs :( // so we have to triple click to select all, and then hit backspace... await header.click({ clickCount: 3 }) await page.keyboard.press('Backspace'); @@ -381,12 +381,9 @@ test.describe('Content tests', () => { // Clean up (content is automatically deleted when document types are gone) await umbracoApi.documentTypes.ensureNameNotExists(rootDocTypeName); - }); + }); test('Preview draft', async ({ page, umbracoApi, umbracoUi }) => { - - - await umbracoApi.content.deleteAllContent(); await umbracoApi.documentTypes.ensureNameNotExists(rootDocTypeName); @@ -415,13 +412,13 @@ test.describe('Content tests', () => { await umbracoUi.clickElement(umbracoUi.getTreeItem(ConstantHelper.sections.content, [homeNodeName])); // Assert - await expect(page.locator('[alias="preview"]')).toBeVisible(); - await page.locator('[alias="preview"]').click(); + await expect(page.locator('[data-element="button-preview"]')).toBeVisible(); + await page.locator('[data-element="button-preview"]').click(); await umbracoUi.isSuccessNotificationVisible(); // Clean up (content is automatically deleted when document types are gone) await umbracoApi.documentTypes.ensureNameNotExists(rootDocTypeName); - }); + }); test('Publish draft', async ({ page, umbracoApi, umbracoUi }) => { @@ -548,7 +545,7 @@ test.describe('Content tests', () => { await umbracoUi.clickElement(umbracoUi.getButtonByLabelKey(ConstantHelper.buttons.saveAndPublish)); // Added additional time because it could fail on pipeline because it's not saving fast enough await umbracoUi.isSuccessNotificationVisible({timeout:20000}); - + // Assert const expectedContent = '

Acceptance test

' await expect(await umbracoApi.content.verifyRenderedContent('/contentpickercontent', expectedContent, true)).toBeTruthy(); diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/routing.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/routing.spec.ts index 2a40de0c6f..43f1d52308 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/routing.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/routing.spec.ts @@ -164,10 +164,10 @@ test.describe('Routing', () => { await page.locator('.btn-success').last().click() // Assert - await expect(await umbracoUi.getSuccessNotification()).toHaveCount(2); + await expect(await umbracoUi.getSuccessNotification()).toHaveCount(2, {timeout: 20000}); await expect(await page.locator('.alert-warning')).toBeVisible(); }); - + test('Root node published in language A, Child node published in language A + B, Grandchild published in A + B', async ({page, umbracoApi, umbracoUi}) => { const rootDocType = new DocumentTypeBuilder() .withName(rootDocTypeName) @@ -249,6 +249,6 @@ test.describe('Routing', () => { await page.locator('.checkbox').last().click(); await page.locator('.btn-success').last().click() // Assert - await expect(await umbracoUi.getSuccessNotification()).toHaveCount(2); + await expect(await umbracoUi.getSuccessNotification()).toHaveCount(2, {timeout: 20000}); }) }); diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataTypes/dataTypes.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataTypes/dataTypes.spec.ts index be7802dca4..34db4bd44f 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataTypes/dataTypes.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataTypes/dataTypes.spec.ts @@ -104,7 +104,7 @@ test.describe('DataTypes', () => { // Add char and assert helptext appears - no publish to save time & has been asserted above & below await page.locator('input[name="textbox"]').type('9'); await expect(page.locator('localize[key="textbox_characters_left"]', {hasText: "characters left"}).first()).toBeVisible(); - await expect(await umbracoUi.getErrorNotification()).not.toBeVisible(); + await expect(await umbracoUi.getErrorNotification()).not.toBeVisible({timeout: 20000}); // Add char and assert errortext appears and can't save await page.locator('input[name="textbox"]').type('10'); // 1 char over max @@ -154,14 +154,14 @@ test.describe('DataTypes', () => { await page.locator('.umb-tree-root').click({button: "right"}); await page.locator('[data-element="action-create"]').click(); await page.locator('[data-element="action-create-' + pickerDocTypeAlias + '"] > .umb-action-link').click(); - + // Fill out content await umbracoUi.setEditorHeaderName('UrlPickerContent'); await umbracoUi.clickElement(umbracoUi.getButtonByLabelKey(ConstantHelper.buttons.saveAndPublish)); await umbracoUi.isSuccessNotificationVisible(); await page.locator('span:has-text("×")').click(); await page.locator('.umb-node-preview-add').click(); - + await page.locator('[data-element="editor-container"]').locator('[data-element="tree-item-UrlPickerContent"]').click(); await expect(page.locator('[alias="urlLinkPicker"]').locator('input[id="urlLinkPicker"]')).toHaveValue('/'); await page.locator('.umb-editor-footer-content__right-side').locator('[label-key="' + ConstantHelper.buttons.submit + '"]').click(); @@ -172,7 +172,7 @@ test.describe('DataTypes', () => { await umbracoUi.isSuccessNotificationVisible(); // Assert - await expect(await umbracoUi.getErrorNotification()).not.toBeVisible(); + await expect(await umbracoUi.getErrorNotification()).not.toBeVisible({timeout: 20000}); // Testing if the edits match the expected results const expected = 'UrlPickerContent'; @@ -184,4 +184,4 @@ test.describe('DataTypes', () => { await umbracoApi.content.deleteAllContent(); await umbracoApi.templates.ensureNameNotExists(urlPickerDocTypeName); }); -}); \ No newline at end of file +}); diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataTypes/textBoxVariation.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataTypes/textBoxVariation.spec.ts index b746eb99d3..2a4fbd01b1 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataTypes/textBoxVariation.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataTypes/textBoxVariation.spec.ts @@ -8,7 +8,7 @@ test.describe('Vary by culture for TextBox', () => { await umbracoApi.report.report(testInfo); await umbracoApi.login(); }); - + test('create documentType with vary by culture with UI with a textbox property which also has vary by culture', async ({page, umbracoApi, umbracoUi}) => { const documentTypeName = 'Test Document'; const textBoxPropertyName = 'TestBox'; @@ -37,7 +37,7 @@ test.describe('Vary by culture for TextBox', () => { await umbracoUi.clickElement(umbracoUi.getButtonByLabelKey(ConstantHelper.buttons.save)); // Assert - await expect(page.locator('.umb-notifications__notifications > .alert-success')).toBeVisible(); + await umbracoUi.isSuccessNotificationVisible(); // Clean await umbracoApi.documentTypes.ensureNameNotExists(documentTypeName); @@ -280,7 +280,7 @@ test.describe('Vary by culture for TextBox', () => { await expect(await umbracoApi.content.verifyRenderedContent(daEndpoint, daValue, true)).toBeTruthy(); await expect(await umbracoApi.content.verifyRenderedContent(enEndpoint, enValue, true)).toBeTruthy(); - // Clean + // Clean await umbracoApi.content.deleteAllContent(); await umbracoApi.documentTypes.ensureNameNotExists(documentName); await umbracoApi.languages.ensureCultureNotExists(languageDa); diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Media/mediaSection.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Media/mediaSection.spec.ts index 7d7d1875f5..71f45d6a72 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Media/mediaSection.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Media/mediaSection.spec.ts @@ -51,7 +51,7 @@ test.describe('Media', () => { } }); await page.locator('[label-key="actions_move"]').click(); - await page.locator('[data-element="editor-container"] >> "' + folderToMoveTooName + '"').click(); + await page.locator('[data-element="editor-container"]').locator('[data-element="tree-item-MoveHere"]').click(); await page.locator('[label-key="general_submit"]').click(); // Assert diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/ModelsBuilder/modelsbuilder.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/ModelsBuilder/modelsbuilder.spec.ts index 449dfa97bc..cb4b4490c2 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/ModelsBuilder/modelsbuilder.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/ModelsBuilder/modelsbuilder.spec.ts @@ -7,6 +7,9 @@ import { test.describe('Modelsbuilder tests', () => { test.beforeEach(async ({ page, umbracoApi }, testInfo) => { + // Added a longer timeout for our tests + test.slow(); + await umbracoApi.report.report(testInfo); await umbracoApi.login(); }); @@ -49,7 +52,7 @@ test.describe('Modelsbuilder tests', () => { // Fortunately for us the input field of a text box has the alias of the property as an id :) await page.locator("#title").type("Hello world!"); await umbracoUi.clickElement(umbracoUi.getButtonByLabelKey(ConstantHelper.buttons.saveAndPublish)); - await umbracoUi.isSuccessNotificationVisible({timeout:10000}); + await umbracoUi.isSuccessNotificationVisible({timeout:20000}); // Ensure that we can render it on the frontend = we can compile the models and views await umbracoApi.content.verifyRenderedContent("/", "

Hello world!

", true); @@ -117,7 +120,7 @@ test.describe('Modelsbuilder tests', () => { await umbracoUi.clickElement(umbracoUi.getButtonByLabelKey(ConstantHelper.buttons.submit)); await umbracoUi.clickElement(umbracoUi.getButtonByLabelKey(ConstantHelper.buttons.save)); // Has a long timeout because it can sometimes take longer than 5 sec to save on the pipeline - await umbracoUi.isSuccessNotificationVisible({timeout:10000}); + await umbracoUi.isSuccessNotificationVisible({timeout:20000}); // Now that the content is updated and the models are rebuilt, ensure that we can still render the frontend. await umbracoApi.content.verifyRenderedContent("/", "

" + propertyValue + "

", true) @@ -184,7 +187,7 @@ test.describe('Modelsbuilder tests', () => { await editor.type("

Edited"); await umbracoUi.clickElement(umbracoUi.getButtonByLabelKey(ConstantHelper.buttons.save)); - await umbracoUi.isSuccessNotificationVisible({timeout:10000}); + await umbracoUi.isSuccessNotificationVisible({timeout:20000}); await umbracoApi.content.verifyRenderedContent("/", "

" + propertyValue + "

Edited

", true); @@ -194,8 +197,6 @@ test.describe('Modelsbuilder tests', () => { }); test('Can update view and document type', async ({page, umbracoApi, umbracoUi},testInfo) => { - await testInfo.slow(); - const docTypeName = "TestDocument"; const docTypeAlias = AliasHelper.toAlias(docTypeName); const propertyAlias = "title"; @@ -265,7 +266,7 @@ test.describe('Modelsbuilder tests', () => { // We only have to type out the opening tag, the editor adds the closing tag automatically. await editor.type("

@Model.Bod"); await umbracoUi.clickElement(umbracoUi.getButtonByLabelKey(ConstantHelper.buttons.save)); - await umbracoUi.isSuccessNotificationVisible({timeout: 20000}); + await umbracoUi.isSuccessNotificationVisible(); await page.locator('span:has-text("×")').click(); // Navigate to the content section and update the content diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Settings/partialViewMacroFiles.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Settings/partialViewMacroFiles.spec.ts index d4d9d42997..8191fdd4ce 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Settings/partialViewMacroFiles.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Settings/partialViewMacroFiles.spec.ts @@ -5,7 +5,10 @@ import {PartialViewMacroBuilder} from "@umbraco/json-models-builders"; test.describe('Partial View Macro Files', () => { test.beforeEach(async ({ page, umbracoApi }, testInfo) => { - await umbracoApi.report.report(testInfo); + // Added a longer timeout for all our tests + test.slow(); + + await umbracoApi.report.report(testInfo); await umbracoApi.login(); }); @@ -31,18 +34,19 @@ test.describe('Partial View Macro Files', () => { await page.locator('.menu-label localize[key="create_newPartialViewMacro"]').click(); - //Type name + // Type name await umbracoUi.setEditorHeaderName(name); - //Save + // Save await umbracoUi.clickElement(umbracoUi.getButtonByLabelKey(ConstantHelper.buttons.save)); - //Assert - await umbracoUi.isSuccessNotificationVisible({timeout:10000}); + // Assert + // It can take quite a long time for a Partial View Macro to be created + await umbracoUi.isSuccessNotificationVisible(); //Clean up await cleanup(umbracoApi, name); - }); + }); test('Create new partial view macro without macro', async ({page, umbracoApi, umbracoUi}) => { const name = "TestPartialMacrolessMacro"; @@ -55,16 +59,17 @@ test.describe('Partial View Macro Files', () => { // Type name await umbracoUi.setEditorHeaderName(name); - + // Save await umbracoUi.clickElement(umbracoUi.getButtonByLabelKey(ConstantHelper.buttons.save)); // Assert - await umbracoUi.isSuccessNotificationVisible({timeout:10000}); + // It can take quite a long time for a Partial View Macro to be created + await umbracoUi.isSuccessNotificationVisible(); // Clean await cleanup(umbracoApi, name); - }); + }); test('Create new partial view macro from snippet', async ({page, umbracoApi, umbracoUi}) => { const name = "TestPartialFromSnippet"; @@ -85,11 +90,12 @@ test.describe('Partial View Macro Files', () => { await umbracoUi.clickElement(umbracoUi.getButtonByLabelKey(ConstantHelper.buttons.save)); // Assert - await umbracoUi.isSuccessNotificationVisible({timeout:10000}); + // It can take quite a long time for a Partial View Macro to be created + await umbracoUi.isSuccessNotificationVisible(); // Clean await cleanup(umbracoApi, name); - }); + }); test('Delete partial view macro', async ({page, umbracoApi, umbracoUi}) => { const name = "TestDeletePartialViewMacro"; @@ -114,11 +120,11 @@ test.describe('Partial View Macro Files', () => { await umbracoUi.clickElement(umbracoUi.getButtonByLabelKey(ConstantHelper.buttons.ok)); // Assert - await expect(await page.locator("body",{ hasText: fullName})).not.toBeVisible(); + await expect(page.locator("body",{ hasText: fullName})).not.toBeVisible(); // Clean await cleanup(umbracoApi, name); - }); + }); test('Edit partial view macro', async ({page, umbracoApi, umbracoUi}) => { const name = "TestPartialViewMacroEditable"; @@ -140,12 +146,13 @@ test.describe('Partial View Macro Files', () => { // Type an edit await page.locator('.ace_text-input').type(" // test" ); - + // Save await umbracoUi.clickElement(umbracoUi.getButtonByLabelKey(ConstantHelper.buttons.save)); // Assert - await umbracoUi.isSuccessNotificationVisible({timeout:10000}); + // It can take quite a long time for a Partial View Macro to be edited + await umbracoUi.isSuccessNotificationVisible(); await cleanup(umbracoApi, name); }); diff --git a/tests/Umbraco.Tests.Common/Attributes/LongRunning.cs b/tests/Umbraco.Tests.Common/Attributes/LongRunning.cs new file mode 100644 index 0000000000..1eb40f2072 --- /dev/null +++ b/tests/Umbraco.Tests.Common/Attributes/LongRunning.cs @@ -0,0 +1,12 @@ +using NUnit.Framework; + +namespace Umbraco.Cms.Tests.Common.Attributes; + +[AttributeUsage(AttributeTargets.Method | AttributeTargets.Class, AllowMultiple = false)] +public class LongRunning : CategoryAttribute +{ + public LongRunning() + : base(TestConstants.Categories.LongRunning) + { + } +} diff --git a/tests/Umbraco.Tests.Common/Attributes/NonCritical.cs b/tests/Umbraco.Tests.Common/Attributes/NonCritical.cs new file mode 100644 index 0000000000..5bf2dc2562 --- /dev/null +++ b/tests/Umbraco.Tests.Common/Attributes/NonCritical.cs @@ -0,0 +1,12 @@ +using NUnit.Framework; + +namespace Umbraco.Cms.Tests.Common.Attributes; + +[AttributeUsage(AttributeTargets.Method | AttributeTargets.Class, AllowMultiple = false)] +public class NonCritical : CategoryAttribute +{ + public NonCritical() + : base(TestConstants.Categories.NonCritical) + { + } +} diff --git a/tests/Umbraco.Tests.Common/TestConstants.cs b/tests/Umbraco.Tests.Common/TestConstants.cs new file mode 100644 index 0000000000..221eb17ac6 --- /dev/null +++ b/tests/Umbraco.Tests.Common/TestConstants.cs @@ -0,0 +1,13 @@ +namespace Umbraco.Cms.Tests.Common; + +public static class TestConstants +{ + ///

+ /// Used for TestCategories, they are designed to be used in an exclusion filter pattern + /// + public static class Categories + { + public const string LongRunning = "LongRunning"; + public const string NonCritical = "NonCritical"; + } +} diff --git a/tests/Umbraco.Tests.Integration/CompatibilitySuppressions.xml b/tests/Umbraco.Tests.Integration/CompatibilitySuppressions.xml index d864a9d227..0abc4e0e3a 100644 --- a/tests/Umbraco.Tests.Integration/CompatibilitySuppressions.xml +++ b/tests/Umbraco.Tests.Integration/CompatibilitySuppressions.xml @@ -5,4 +5,4 @@ PKV006 net7.0 - \ No newline at end of file + diff --git a/tests/Umbraco.Tests.Integration/ComponentRuntimeTests.cs b/tests/Umbraco.Tests.Integration/ComponentRuntimeTests.cs index e1a1ac8ae8..030104b10b 100644 --- a/tests/Umbraco.Tests.Integration/ComponentRuntimeTests.cs +++ b/tests/Umbraco.Tests.Integration/ComponentRuntimeTests.cs @@ -8,6 +8,7 @@ using Umbraco.Cms.Core.Composing; using Umbraco.Cms.Core.DependencyInjection; using Umbraco.Cms.Core.Runtime; using Umbraco.Cms.Core.Services; +using Umbraco.Cms.Tests.Common.Attributes; using Umbraco.Cms.Tests.Common.Testing; using Umbraco.Cms.Tests.Integration.Testing; @@ -24,6 +25,7 @@ public class ComponentRuntimeTests : UmbracoIntegrationTest /// This will boot up umbraco with components enabled to show they initialize and shutdown /// [Test] + [LongRunning] public async Task Start_And_Stop_Umbraco_With_Components_Enabled() { var runtime = Services.GetRequiredService(); diff --git a/tests/Umbraco.Tests.Integration/TestServerTest/Controllers/EnsureNotAmbiguousActionNameControllerTests.cs b/tests/Umbraco.Tests.Integration/TestServerTest/Controllers/EnsureNotAmbiguousActionNameControllerTests.cs index a13affb340..518a4f58b4 100644 --- a/tests/Umbraco.Tests.Integration/TestServerTest/Controllers/EnsureNotAmbiguousActionNameControllerTests.cs +++ b/tests/Umbraco.Tests.Integration/TestServerTest/Controllers/EnsureNotAmbiguousActionNameControllerTests.cs @@ -4,6 +4,7 @@ using NUnit.Framework; using Umbraco.Cms.Core; using Umbraco.Cms.Core.Models.ContentEditing; +using Umbraco.Cms.Tests.Common.Attributes; using Umbraco.Cms.Web.BackOffice.Controllers; namespace Umbraco.Cms.Tests.Integration.TestServerTest.Controllers; @@ -12,6 +13,7 @@ namespace Umbraco.Cms.Tests.Integration.TestServerTest.Controllers; public class EnsureNotAmbiguousActionNameControllerTests : UmbracoTestServerTestBase { [Test] + [LongRunning] public void EnsureNotAmbiguousActionName() { var intId = 0; diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Core/Events/EventAggregatorTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Core/Events/EventAggregatorTests.cs index c5f4d62a61..80809fb77c 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Core/Events/EventAggregatorTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Core/Events/EventAggregatorTests.cs @@ -5,6 +5,7 @@ using Microsoft.Extensions.DependencyInjection; using NUnit.Framework; using Umbraco.Cms.Core.Events; using Umbraco.Cms.Core.Notifications; +using Umbraco.Cms.Tests.Common.Attributes; using Umbraco.Cms.Tests.Integration.TestServerTest; namespace Umbraco.Cms.Tests.Integration.Umbraco.Core.Events; @@ -19,6 +20,7 @@ public class EventAggregatorTests : UmbracoTestServerTestBase } [Test] + [LongRunning] public async Task Publish_HandlerWithScopedDependency_DoesNotThrow() { var result = await Client.GetAsync("/test-handler-with-scoped-services"); diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Core/IO/FileSystemsTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Core/IO/FileSystemsTests.cs index 18b50b1b8e..86a3f4a745 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Core/IO/FileSystemsTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Core/IO/FileSystemsTests.cs @@ -7,6 +7,7 @@ using NUnit.Framework; using Umbraco.Cms.Core.Hosting; using Umbraco.Cms.Core.IO; using Umbraco.Cms.Core.IO.MediaPathSchemes; +using Umbraco.Cms.Tests.Common.Attributes; using Umbraco.Cms.Tests.Common.Testing; using Umbraco.Cms.Tests.Integration.Testing; @@ -32,6 +33,7 @@ public class FileSystemsTests : UmbracoIntegrationTest } [Test] + [LongRunning] public void Can_Delete_MediaFiles() { var mediaFileManager = GetRequiredService(); diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Core/IO/ShadowFileSystemTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Core/IO/ShadowFileSystemTests.cs index 6b9f3ae042..a60a90cee2 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Core/IO/ShadowFileSystemTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Core/IO/ShadowFileSystemTests.cs @@ -9,6 +9,7 @@ using Umbraco.Cms.Core; using Umbraco.Cms.Core.Configuration.Models; using Umbraco.Cms.Core.Hosting; using Umbraco.Cms.Core.IO; +using Umbraco.Cms.Tests.Common.Attributes; using Umbraco.Cms.Tests.Common.Testing; using Umbraco.Cms.Tests.Integration.Implementations; using Umbraco.Cms.Tests.Integration.Testing; @@ -572,6 +573,7 @@ public class ShadowFileSystemTests : UmbracoIntegrationTest } [Test] + [LongRunning] public void ShadowScopeCompleteWithDirectoryConflict() { var path = HostingEnvironment.MapPathContentRoot("FileSysTests"); diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Core/Mapping/ContentTypeModelMappingTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Core/Mapping/ContentTypeModelMappingTests.cs index c7cb3d091d..7a0bbae416 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Core/Mapping/ContentTypeModelMappingTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Core/Mapping/ContentTypeModelMappingTests.cs @@ -12,6 +12,7 @@ using Umbraco.Cms.Core.PropertyEditors; using Umbraco.Cms.Core.Serialization; using Umbraco.Cms.Core.Services; using Umbraco.Cms.Core.Strings; +using Umbraco.Cms.Tests.Common.Attributes; using Umbraco.Cms.Tests.Common.Builders; using Umbraco.Cms.Tests.Common.Testing; using Umbraco.Cms.Tests.Integration.Testing; @@ -139,6 +140,7 @@ public class ContentTypeModelMappingTests : UmbracoIntegrationTest } [Test] + [LongRunning] public void ContentTypeSave_To_IContentType() { // Arrange diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Core/Packaging/CreatedPackagesRepositoryTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Core/Packaging/CreatedPackagesRepositoryTests.cs index c60083f4c8..67032dc825 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Core/Packaging/CreatedPackagesRepositoryTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Core/Packaging/CreatedPackagesRepositoryTests.cs @@ -15,6 +15,7 @@ using Umbraco.Cms.Core.IO; using Umbraco.Cms.Core.Models; using Umbraco.Cms.Core.Packaging; using Umbraco.Cms.Core.Services; +using Umbraco.Cms.Tests.Common.Attributes; using Umbraco.Cms.Tests.Common.Builders; using Umbraco.Cms.Tests.Common.Testing; using Umbraco.Cms.Tests.Integration.Testing; @@ -216,6 +217,7 @@ public class CreatedPackagesRepositoryTests : UmbracoIntegrationTest } [Test] + [LongRunning] public void Export_Zip() { var mt = MediaTypeBuilder.CreateImageMediaType("testImage"); diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Core/PublishedContentQueryAccessorTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Core/PublishedContentQueryAccessorTests.cs index 108c3dab19..aca58313df 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Core/PublishedContentQueryAccessorTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Core/PublishedContentQueryAccessorTests.cs @@ -3,6 +3,7 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; using NUnit.Framework; using Umbraco.Cms.Core; +using Umbraco.Cms.Tests.Common.Attributes; using Umbraco.Cms.Tests.Integration.TestServerTest; namespace Umbraco.Cms.Tests.Integration.Umbraco.Core; @@ -11,6 +12,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Core; public class PublishedContentQueryAccessorTests : UmbracoTestServerTestBase { [Test] + [LongRunning] public async Task PublishedContentQueryAccessor_WithRequestScope_WillProvideQuery() { var result = await Client.GetAsync("/demo-published-content-query-accessor"); diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentServiceTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/ContentServiceTests.cs similarity index 99% rename from tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentServiceTests.cs rename to tests/Umbraco.Tests.Integration/Umbraco.Core/Services/ContentServiceTests.cs index 0f399f771d..aba329404a 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentServiceTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/ContentServiceTests.cs @@ -3,13 +3,10 @@ using System.Collections.Generic; using System.Diagnostics; -using System.Linq; -using System.Threading; using Moq; using NUnit.Framework; using Umbraco.Cms.Core; using Umbraco.Cms.Core.Cache; -using Umbraco.Cms.Core.DependencyInjection; using Umbraco.Cms.Core.Events; using Umbraco.Cms.Core.Models; using Umbraco.Cms.Core.Notifications; @@ -19,14 +16,14 @@ using Umbraco.Cms.Core.Serialization; using Umbraco.Cms.Core.Services; using Umbraco.Cms.Infrastructure.Persistence; using Umbraco.Cms.Infrastructure.Persistence.Repositories.Implement; +using Umbraco.Cms.Tests.Common.Attributes; using Umbraco.Cms.Tests.Common.Builders; using Umbraco.Cms.Tests.Common.Builders.Extensions; using Umbraco.Cms.Tests.Common.Extensions; using Umbraco.Cms.Tests.Common.Testing; using Umbraco.Cms.Tests.Integration.Testing; -using Umbraco.Extensions; -namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services; +namespace Umbraco.Cms.Tests.Integration.Umbraco.Core.Services; /// /// Tests covering all methods in the ContentService class. @@ -159,6 +156,7 @@ public class ContentServiceTests : UmbracoIntegrationTestWithContent } [Test] + [LongRunning] public void Get_All_Blueprints() { var template = TemplateBuilder.CreateTextPageTemplate(); @@ -189,6 +187,7 @@ public class ContentServiceTests : UmbracoIntegrationTestWithContent } [Test] + [LongRunning] public void Perform_Scheduled_Publishing() { var langUk = new LanguageBuilder() @@ -333,6 +332,7 @@ public class ContentServiceTests : UmbracoIntegrationTestWithContent } [Test] + [LongRunning] public void Get_Top_Version_Ids() { // Arrange @@ -353,6 +353,7 @@ public class ContentServiceTests : UmbracoIntegrationTestWithContent } [Test] + [LongRunning] public void Get_By_Ids_Sorted() { // Arrange @@ -569,6 +570,7 @@ public class ContentServiceTests : UmbracoIntegrationTestWithContent } [Test] + [LongRunning] public void Can_Get_All_Versions_Of_Content() { var parent = ContentService.GetById(Textpage.Id); @@ -654,6 +656,7 @@ public class ContentServiceTests : UmbracoIntegrationTestWithContent } [Test] + [LongRunning] public void Can_Get_Content_For_Expiration() { // Arrange @@ -752,6 +755,7 @@ public class ContentServiceTests : UmbracoIntegrationTestWithContent } [Test] + [LongRunning] public void Can_Publish_Culture_After_Last_Culture_Unpublished() { var content = CreateEnglishAndFrenchDocument(out var langUk, out var langFr, @@ -1386,6 +1390,7 @@ public class ContentServiceTests : UmbracoIntegrationTestWithContent } [Test] + [LongRunning] public void Failed_Publish_Should_Not_Update_Edited_State_When_Edited_True() { // Arrange @@ -1438,6 +1443,7 @@ public class ContentServiceTests : UmbracoIntegrationTestWithContent // V9 - Tests.Integration [Test] + [LongRunning] public void Failed_Publish_Should_Not_Update_Edited_State_When_Edited_False() { // Arrange @@ -1588,6 +1594,7 @@ public class ContentServiceTests : UmbracoIntegrationTestWithContent } [Test] + [LongRunning] public void Can_Get_Published_Descendant_Versions() { // Arrange @@ -1773,6 +1780,7 @@ public class ContentServiceTests : UmbracoIntegrationTestWithContent } [Test] + [LongRunning] public void Can_Move_Content_Structure_To_RecycleBin_And_Empty_RecycleBin() { var contentType = ContentTypeService.Get("umbTextpage"); @@ -1829,6 +1837,7 @@ public class ContentServiceTests : UmbracoIntegrationTestWithContent } [Test] + [LongRunning] public void Ensures_Permissions_Are_Retained_For_Copied_Descendants_With_Explicit_Permissions() { // Arrange @@ -1869,6 +1878,7 @@ public class ContentServiceTests : UmbracoIntegrationTestWithContent } [Test] + [LongRunning] public void Ensures_Permissions_Are_Inherited_For_Copied_Descendants() { // Arrange @@ -1944,6 +1954,7 @@ public class ContentServiceTests : UmbracoIntegrationTestWithContent } [Test] + [LongRunning] public void Can_Empty_RecycleBin_With_Content_That_Has_All_Related_Data() { // Arrange @@ -2316,6 +2327,7 @@ public class ContentServiceTests : UmbracoIntegrationTestWithContent } [Test] + [LongRunning] public void Can_Rollback_Version_On_Multilingual() { var langFr = new LanguageBuilder() @@ -2623,6 +2635,7 @@ public class ContentServiceTests : UmbracoIntegrationTestWithContent } [Test] + [LongRunning] public void Can_Delete_Previous_Versions_Not_Latest() { // Arrange @@ -2638,6 +2651,7 @@ public class ContentServiceTests : UmbracoIntegrationTestWithContent } [Test] + [LongRunning] public void Can_Get_Paged_Children() { // Start by cleaning the "db" @@ -2664,6 +2678,7 @@ public class ContentServiceTests : UmbracoIntegrationTestWithContent } [Test] + [LongRunning] public void Can_Get_Paged_Children_Dont_Get_Descendants() { // Start by cleaning the "db" @@ -2837,6 +2852,7 @@ public class ContentServiceTests : UmbracoIntegrationTestWithContent } [Test] + [LongRunning] public void Ensure_Invariant_Name() { var languageService = LocalizationService; @@ -2920,6 +2936,7 @@ public class ContentServiceTests : UmbracoIntegrationTestWithContent } [Test] + [LongRunning] public void Can_Get_Paged_Children_WithFilterAndOrder() { var languageService = LocalizationService; @@ -3053,6 +3070,7 @@ public class ContentServiceTests : UmbracoIntegrationTestWithContent } [Test] + [LongRunning] public void Can_SaveRead_Variations() { var languageService = LocalizationService; diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Core/Variants/ContentVariantAllowedActionTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Core/Variants/ContentVariantAllowedActionTests.cs index 1c4142e287..a09b717f3b 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Core/Variants/ContentVariantAllowedActionTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Core/Variants/ContentVariantAllowedActionTests.cs @@ -6,6 +6,7 @@ using Umbraco.Cms.Core.Models; using Umbraco.Cms.Core.Models.ContentEditing; using Umbraco.Cms.Core.Models.Membership; using Umbraco.Cms.Core.Services; +using Umbraco.Cms.Tests.Common.Attributes; using Umbraco.Cms.Tests.Common.Builders; using Umbraco.Cms.Tests.Common.Builders.Extensions; using Umbraco.Cms.Tests.Integration.TestServerTest; @@ -32,6 +33,7 @@ public class ContentVariantAllowedActionTests : UmbracoTestServerTestBase } [Test] + [LongRunning] public void CanCheckIfUserHasAccessToLanguage() { // setup user groups diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Examine.Lucene/UmbracoExamine/IndexTest.cs b/tests/Umbraco.Tests.Integration/Umbraco.Examine.Lucene/UmbracoExamine/IndexTest.cs index cb502be992..23548c9ba3 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Examine.Lucene/UmbracoExamine/IndexTest.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Examine.Lucene/UmbracoExamine/IndexTest.cs @@ -7,6 +7,7 @@ using Newtonsoft.Json; using NUnit.Framework; using Umbraco.Cms.Core.Models; using Umbraco.Cms.Infrastructure.Examine; +using Umbraco.Cms.Tests.Common.Attributes; using Umbraco.Cms.Tests.Common.Builders; using Umbraco.Cms.Tests.Common.Testing; using Umbraco.Extensions; @@ -22,6 +23,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Examine.Lucene.UmbracoExamine; public class IndexTest : ExamineBaseTest { [Test] + [LongRunning] public void GivenValidationParentNode_WhenContentIndexedUnderDifferentParent_DocumentIsNotIndexed() { using (GetSynchronousContentIndex(false, out var index, out _, out _, 999)) @@ -51,6 +53,7 @@ public class IndexTest : ExamineBaseTest } [Test] + [LongRunning] public void GivenIndexingDocument_WhenRichTextPropertyData_CanStoreImmenseFields() { using (GetSynchronousContentIndex(false, out var index, out _, out var contentValueSetBuilder)) @@ -88,6 +91,7 @@ public class IndexTest : ExamineBaseTest } [Test] + [LongRunning] public void GivenIndexingDocument_WhenGridPropertyData_ThenDataIndexedInSegregatedFields() { using (GetSynchronousContentIndex(false, out var index, out _, out var contentValueSetBuilder)) @@ -173,6 +177,7 @@ public class IndexTest : ExamineBaseTest } [Test] + [LongRunning] public void GivenEmptyIndex_WhenUsingWithContentAndMediaPopulators_ThenIndexPopulated() { var mediaRebuilder = IndexInitializer.GetMediaIndexRebuilder(IndexInitializer.GetMockMediaService()); @@ -193,6 +198,7 @@ public class IndexTest : ExamineBaseTest /// Check that the node signalled as protected in the content service is not present in the index. /// [Test] + [LongRunning] public void GivenPublishedContentIndex_WhenProtectedContentIndexed_ThenItIsIgnored() { using (GetSynchronousContentIndex(true, out var index, out var contentRebuilder, out _)) @@ -212,6 +218,7 @@ public class IndexTest : ExamineBaseTest } [Test] + [LongRunning] public void GivenMediaUnderNonIndexableParent_WhenMediaMovedUnderIndexableParent_ThenItIsIncludedInTheIndex() { // create a validator with @@ -248,6 +255,7 @@ public class IndexTest : ExamineBaseTest } [Test] + [LongRunning] public void GivenMediaUnderIndexableParent_WhenMediaMovedUnderNonIndexableParent_ThenItIsRemovedFromTheIndex() { // create a validator with @@ -291,6 +299,7 @@ public class IndexTest : ExamineBaseTest /// We then call the Examine method to re-index Content and do some comparisons to ensure that it worked correctly. /// [Test] + [LongRunning] public void GivenEmptyIndex_WhenIndexedWithContentPopulator_ThenTheIndexIsPopulated() { using (GetSynchronousContentIndex(false, out var index, out var contentRebuilder, out _)) @@ -328,6 +337,7 @@ public class IndexTest : ExamineBaseTest /// This will delete an item from the index and ensure that all children of the node are deleted too! /// [Test] + [LongRunning] public void GivenPopulatedIndex_WhenDocumentDeleted_ThenItsHierarchyIsAlsoDeleted() { using (GetSynchronousContentIndex(false, out var index, out var contentRebuilder, out _)) diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Examine.Lucene/UmbracoExamine/PublishedContentQueryTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Examine.Lucene/UmbracoExamine/PublishedContentQueryTests.cs index 80aa1fe662..84e4be9d60 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Examine.Lucene/UmbracoExamine/PublishedContentQueryTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Examine.Lucene/UmbracoExamine/PublishedContentQueryTests.cs @@ -9,6 +9,7 @@ using Umbraco.Cms.Core.Models.PublishedContent; using Umbraco.Cms.Core.PublishedCache; using Umbraco.Cms.Infrastructure; using Umbraco.Cms.Infrastructure.Examine; +using Umbraco.Cms.Tests.Common.Attributes; using Umbraco.Cms.Tests.Common.Testing; using Directory = Lucene.Net.Store.Directory; @@ -96,6 +97,7 @@ public class PublishedContentQueryTests : ExamineBaseTest [TestCase("en-us", ExpectedResult = "1, 2", Description = "Search Culture: en-us. Must return both en-us and invariant results")] [TestCase("*", ExpectedResult = "1, 2, 3", Description = "Search Culture: *. Must return all cultures and all invariant results")] [TestCase(null, ExpectedResult = "1", Description = "Search Culture: null. Must return only invariant results")] + [LongRunning] public string Search(string culture) { using (var luceneDir = new RandomIdRAMDirectory()) diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Examine.Lucene/UmbracoExamine/SearchTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Examine.Lucene/UmbracoExamine/SearchTests.cs index 41ba42dc86..2e360ca4cf 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Examine.Lucene/UmbracoExamine/SearchTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Examine.Lucene/UmbracoExamine/SearchTests.cs @@ -8,6 +8,7 @@ using Umbraco.Cms.Core.Models; using Umbraco.Cms.Core.Persistence.Querying; using Umbraco.Cms.Core.Services; using Umbraco.Cms.Infrastructure.Examine; +using Umbraco.Cms.Tests.Common.Attributes; using Umbraco.Cms.Tests.Common.Testing; using Umbraco.Extensions; @@ -18,6 +19,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Examine.Lucene.UmbracoExamine; public class SearchTests : ExamineBaseTest { [Test] + [LongRunning] public void Test_Sort_Order_Sorting() { long totalRecs; diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Packaging/PackageDataInstallationTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Packaging/PackageDataInstallationTests.cs index 7eb0d07da9..cf70eec59c 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Packaging/PackageDataInstallationTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Packaging/PackageDataInstallationTests.cs @@ -13,6 +13,7 @@ using Umbraco.Cms.Core.PropertyEditors; using Umbraco.Cms.Core.Services; using Umbraco.Cms.Infrastructure.Packaging; using Umbraco.Cms.Infrastructure.Persistence.Dtos; +using Umbraco.Cms.Tests.Common.Attributes; using Umbraco.Cms.Tests.Common.Testing; using Umbraco.Cms.Tests.Integration.Testing; using Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services.Importing; @@ -80,6 +81,7 @@ public class PackageDataInstallationTests : UmbracoIntegrationTestWithContent private IMediaTypeService MediaTypeService => GetRequiredService(); [Test] + [LongRunning] public void Can_Import_uBlogsy_ContentTypes_And_Verify_Structure() { // Arrange @@ -127,6 +129,7 @@ public class PackageDataInstallationTests : UmbracoIntegrationTestWithContent } [Test] + [LongRunning] public void Can_Import_Inherited_ContentTypes_And_Verify_PropertyTypes_UniqueIds() { // Arrange @@ -153,6 +156,7 @@ public class PackageDataInstallationTests : UmbracoIntegrationTestWithContent } [Test] + [LongRunning] public void Can_Import_Inherited_ContentTypes_And_Verify_PropertyGroups_And_PropertyTypes() { // Arrange @@ -192,6 +196,7 @@ public class PackageDataInstallationTests : UmbracoIntegrationTestWithContent } [Test] + [LongRunning] public void Can_Import_Template_Package_Xml() { // Arrange @@ -261,6 +266,7 @@ public class PackageDataInstallationTests : UmbracoIntegrationTestWithContent } [Test] + [LongRunning] public void Can_Import_StandardMvc_ContentTypes_Package_Xml() { // Arrange @@ -299,6 +305,7 @@ public class PackageDataInstallationTests : UmbracoIntegrationTestWithContent } [Test] + [LongRunning] public void Can_Import_StandardMvc_ContentTypes_And_Templates_Xml() { // Arrange @@ -325,6 +332,7 @@ public class PackageDataInstallationTests : UmbracoIntegrationTestWithContent } [Test] + [LongRunning] public void Can_Import_Fanoe_Starterkit_ContentTypes_And_Templates_Xml() { // Arrange @@ -380,6 +388,7 @@ public class PackageDataInstallationTests : UmbracoIntegrationTestWithContent } [Test] + [LongRunning] public void Can_Import_Media_Package_Xml() { // Arrange @@ -506,6 +515,7 @@ public class PackageDataInstallationTests : UmbracoIntegrationTestWithContent } [Test] + [LongRunning] public void Can_ReImport_Single_DocType() { // Arrange @@ -725,6 +735,7 @@ public class PackageDataInstallationTests : UmbracoIntegrationTestWithContent } [Test] + [LongRunning] public void Can_Import_Package_With_Compositions() { // Arrange diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/LocksTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/LocksTests.cs index 51b1a3a179..88b48dfaae 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/LocksTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/LocksTests.cs @@ -11,6 +11,7 @@ using Umbraco.Cms.Core; using Umbraco.Cms.Core.DistributedLocking.Exceptions; using Umbraco.Cms.Infrastructure.Persistence.Dtos; using Umbraco.Cms.Persistence.Sqlite.Interceptors; +using Umbraco.Cms.Tests.Common.Attributes; using Umbraco.Cms.Tests.Common.Testing; using Umbraco.Cms.Tests.Integration.Testing; using Umbraco.Extensions; @@ -154,6 +155,7 @@ public class LocksTests : UmbracoIntegrationTest } [Test] + [LongRunning] public void ConcurrentWritersTest() { const int threadCount = 8; @@ -428,6 +430,7 @@ public class LocksTests : UmbracoIntegrationTest } [Test] + [LongRunning] public void Throws_When_Lock_Timeout_Is_Exceeded_Write() { var counter = 0; diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/ContentTypeRepositoryTest.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/ContentTypeRepositoryTest.cs index d769bfc4c1..d9ecd73c91 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/ContentTypeRepositoryTest.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/ContentTypeRepositoryTest.cs @@ -19,6 +19,7 @@ using Umbraco.Cms.Core.Persistence.Repositories; using Umbraco.Cms.Core.Services; using Umbraco.Cms.Infrastructure.Persistence.Repositories.Implement; using Umbraco.Cms.Infrastructure.Scoping; +using Umbraco.Cms.Tests.Common.Attributes; using Umbraco.Cms.Tests.Common.Builders; using Umbraco.Cms.Tests.Common.Extensions; using Umbraco.Cms.Tests.Common.Testing; @@ -847,6 +848,7 @@ public class ContentTypeRepositoryTest : UmbracoIntegrationTest } [Test] + [LongRunning] public void Can_Verify_Addition_Of_PropertyType_After_ContentType_Is_Used() { // Arrange diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/DocumentRepositoryTest.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/DocumentRepositoryTest.cs index 7ee763e863..ef579ea392 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/DocumentRepositoryTest.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/DocumentRepositoryTest.cs @@ -21,6 +21,7 @@ using Umbraco.Cms.Infrastructure.Persistence; using Umbraco.Cms.Infrastructure.Persistence.Repositories.Implement; using Umbraco.Cms.Infrastructure.Scoping; using Umbraco.Cms.Persistence.SqlServer.Services; +using Umbraco.Cms.Tests.Common.Attributes; using Umbraco.Cms.Tests.Common.Builders; using Umbraco.Cms.Tests.Common.Testing; using Umbraco.Cms.Tests.Integration.Testing; @@ -742,6 +743,7 @@ public class DocumentRepositoryTest : UmbracoIntegrationTest } [Test] + [LongRunning] public void GetAllContentManyVersions() { IContent[] result; diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/EntityRepositoryTest.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/EntityRepositoryTest.cs index 6ab977b783..86b0363050 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/EntityRepositoryTest.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/EntityRepositoryTest.cs @@ -11,6 +11,7 @@ using Umbraco.Cms.Core.Models.Entities; using Umbraco.Cms.Core.Services; using Umbraco.Cms.Infrastructure.Persistence.Repositories.Implement; using Umbraco.Cms.Infrastructure.Scoping; +using Umbraco.Cms.Tests.Common.Attributes; using Umbraco.Cms.Tests.Common.Builders; using Umbraco.Cms.Tests.Common.Testing; using Umbraco.Cms.Tests.Integration.Testing; @@ -22,6 +23,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Persistence.Repos public class EntityRepositoryTest : UmbracoIntegrationTest { [Test] + [LongRunning] public void Get_Paged_Mixed_Entities_By_Ids() { // Create content diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/MediaRepositoryTest.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/MediaRepositoryTest.cs index 595e881f28..932be80a01 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/MediaRepositoryTest.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/MediaRepositoryTest.cs @@ -318,36 +318,6 @@ public class MediaRepositoryTest : UmbracoIntegrationTest } } - [Ignore("Unsupported feature.")] - [Test] - public void QueryMedia_ContentTypeAliasFilter() - { - // we could support this, but it would require an extra join on the query, - // and we don't absolutely need it now, so leaving it out for now - - // Arrange - var folderMediaType = MediaTypeService.Get(1031); - var provider = ScopeProvider; - using (var scope = provider.CreateScope()) - { - var repository = CreateRepository(provider, out var mediaTypeRepository); - - // Act - for (var i = 0; i < 10; i++) - { - var folder = MediaBuilder.CreateMediaFolder(folderMediaType, -1); - repository.Save(folder); - } - - string[] types = { "Folder" }; - var query = provider.CreateQuery().Where(x => types.Contains(x.ContentType.Alias)); - var result = repository.Get(query); - - // Assert - Assert.That(result.Count(), Is.GreaterThanOrEqualTo(11)); - } - } - [Test] public void GetPagedResultsByQuery_FirstPage() { diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/PublicAccessRepositoryTest.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/PublicAccessRepositoryTest.cs index 477738ef4f..14ee84b37f 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/PublicAccessRepositoryTest.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/PublicAccessRepositoryTest.cs @@ -10,6 +10,7 @@ using Umbraco.Cms.Core.Persistence.Repositories; using Umbraco.Cms.Infrastructure.Persistence; using Umbraco.Cms.Infrastructure.Persistence.Repositories.Implement; using Umbraco.Cms.Infrastructure.Scoping; +using Umbraco.Cms.Tests.Common.Attributes; using Umbraco.Cms.Tests.Common.Builders; using Umbraco.Cms.Tests.Common.Testing; using Umbraco.Cms.Tests.Integration.Testing; @@ -79,6 +80,7 @@ public class PublicAccessRepositoryTest : UmbracoIntegrationTest } [Test] + [LongRunning] public void Can_Add2() { var content = CreateTestData(3).ToArray(); diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Runtime/FileSystemMainDomLockTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Runtime/FileSystemMainDomLockTests.cs index eea40a0b49..febc8f1e68 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Runtime/FileSystemMainDomLockTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Runtime/FileSystemMainDomLockTests.cs @@ -9,6 +9,7 @@ using Umbraco.Cms.Core.Configuration.Models; using Umbraco.Cms.Core.Hosting; using Umbraco.Cms.Core.Runtime; using Umbraco.Cms.Infrastructure.Runtime; +using Umbraco.Cms.Tests.Common.Attributes; using Umbraco.Cms.Tests.Integration.Testing; namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Runtime; @@ -76,6 +77,7 @@ internal class FileSystemMainDomLockTests : UmbracoIntegrationTest } [Test] + [LongRunning] public async Task AcquireLockAsync_WhenTimeoutExceeded_ReturnsFalse() { await using var lockFile = File.Open(LockFilePath, FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.None); @@ -88,6 +90,7 @@ internal class FileSystemMainDomLockTests : UmbracoIntegrationTest } [Test] + [LongRunning] public async Task ListenAsync_WhenLockReleaseSignalFileFound_DropsLockFileHandle() { using var sut = FileSystemMainDomLock; diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Scoping/ScopeTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Scoping/ScopeTests.cs index a2ba3bb4c4..00425a9cfe 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Scoping/ScopeTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Scoping/ScopeTests.cs @@ -12,6 +12,7 @@ using Umbraco.Cms.Core.Scoping; using Umbraco.Cms.Infrastructure.Persistence; using Umbraco.Cms.Infrastructure.Scoping; using Umbraco.Cms.Tests.Common; +using Umbraco.Cms.Tests.Common.Attributes; using Umbraco.Cms.Tests.Common.Testing; using Umbraco.Cms.Tests.Integration.Testing; using Umbraco.Extensions; @@ -40,6 +41,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Scoping } [Test] + [LongRunning] public void GivenUncompletedScopeOnChildThread_WhenTheParentCompletes_TheTransactionIsRolledBack() { ScopeProvider scopeProvider = ScopeProvider; @@ -77,6 +79,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Scoping } [Test] + [LongRunning] public void GivenChildThread_WhenParentDisposedBeforeChild_ParentScopeThrows() { ScopeProvider scopeProvider = ScopeProvider; diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Scoping/ScopedNuCacheTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Scoping/ScopedNuCacheTests.cs index 9186f44cf1..777b4cafb8 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Scoping/ScopedNuCacheTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Scoping/ScopedNuCacheTests.cs @@ -11,6 +11,7 @@ using Umbraco.Cms.Core.Sync; using Umbraco.Cms.Core.Web; using Umbraco.Cms.Infrastructure.DependencyInjection; using Umbraco.Cms.Tests.Common; +using Umbraco.Cms.Tests.Common.Attributes; using Umbraco.Cms.Tests.Common.Testing; using Umbraco.Cms.Tests.Integration.Testing; using Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Scoping; @@ -58,6 +59,7 @@ public class ScopedNuCacheTests : UmbracoIntegrationTest [TestCase(true)] [TestCase(false)] + [LongRunning] public void TestScope(bool complete) { var umbracoContext = UmbracoContextFactory.EnsureUmbracoContext().UmbracoContext; diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentEventsTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentEventsTests.cs index 73b8c63464..fda265c705 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentEventsTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentEventsTests.cs @@ -14,6 +14,7 @@ using Umbraco.Cms.Core.Persistence.Repositories; using Umbraco.Cms.Core.Sync; using Umbraco.Cms.Core.Web; using Umbraco.Cms.Infrastructure.Sync; +using Umbraco.Cms.Tests.Common.Attributes; using Umbraco.Cms.Tests.Common.Builders; using Umbraco.Cms.Tests.Common.Testing; using Umbraco.Cms.Tests.Integration.Testing; @@ -263,6 +264,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services #region Validate Setup [Test] + [LongRunning] public void CreatedBranchIsOk() { IContent content1 = CreateBranch(); @@ -376,6 +378,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services #region Save, Publish & Unpublish single content [Test] + [LongRunning] public void SaveUnpublishedContent() { // rule: when a content is saved, @@ -398,6 +401,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services } [Test] + [LongRunning] public void SavePublishedContent_ContentProperty1() { // rule: when a content is saved, @@ -433,6 +437,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services } [Test] + [LongRunning] public void SavePublishedContent_ContentProperty2() { // rule: when a content is saved, @@ -468,6 +473,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services } [Test] + [LongRunning] public void SavePublishedContent_UserProperty() { // rule: when a content is saved, @@ -503,6 +509,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services } [Test] + [LongRunning] public void SaveAndPublishUnpublishedContent() { // rule: when a content is saved&published, @@ -525,6 +532,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services } [Test] + [LongRunning] public void SaveAndPublishPublishedContent() { // rule: when a content is saved&published, @@ -548,6 +556,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services } [Test] + [LongRunning] public void PublishUnpublishedContent() { // rule: when a content is published, @@ -573,6 +582,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services } [Test] + [LongRunning] public void UnpublishContent() { // rule: when a content is unpublished, @@ -595,6 +605,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services } [Test] + [LongRunning] public void UnpublishContentWithChanges() { // rule: when a content is unpublished, @@ -625,6 +636,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services #region Publish & Unpublish branch [Test] + [LongRunning] public void UnpublishContentBranch() { // rule: when a content branch is unpublished, @@ -651,6 +663,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services } [Test] + [LongRunning] public void PublishContentBranch() { // rule: when a content branch is published, @@ -684,6 +697,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services } [Test] + [LongRunning] public void PublishContentBranchWithPublishedChildren() { // rule? @@ -721,6 +735,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services } [Test] + [LongRunning] public void PublishContentBranchWithAllChildren() { // rule? @@ -770,6 +785,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services #region Sort [Test] + [LongRunning] public void SortAll() { // rule: ? @@ -806,6 +822,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services } [Test] + [LongRunning] public void SortSome() { // rule: ? @@ -845,6 +862,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services // incl. trashing a branch, untrashing a single masked content // including emptying the recycle bin [Test] + [LongRunning] public void TrashUnpublishedContent() { IContent content = CreateContent(); @@ -863,6 +881,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services } [Test] + [LongRunning] public void UntrashUnpublishedContent() { IContent content = CreateContent(); @@ -883,6 +902,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services } [Test] + [LongRunning] public void TrashPublishedContent() { // does 1) unpublish and 2) trash @@ -905,6 +925,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services } [Test] + [LongRunning] public void UntrashPublishedContent() { // same as unpublished as it's been unpublished @@ -931,6 +952,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services } [Test] + [LongRunning] public void TrashPublishedContentWithChanges() { IContent content = CreateContent(); @@ -954,6 +976,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services } [Test] + [LongRunning] public void TrashContentBranch() { IContent content1 = CreateBranch(); @@ -992,6 +1015,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services } [Test] + [LongRunning] public void EmptyRecycleBinContent() { ContentService.EmptyRecycleBin(); @@ -1014,6 +1038,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services } [Test] + [LongRunning] public void EmptyRecycleBinContents() { ContentService.EmptyRecycleBin(Constants.Security.SuperUserId); @@ -1041,6 +1066,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services } [Test] + [LongRunning] public void EmptyRecycleBinBranch() { ContentService.EmptyRecycleBin(Constants.Security.SuperUserId); @@ -1087,6 +1113,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services #region Delete [Test] + [LongRunning] public void DeleteUnpublishedContent() { IContent content = CreateContent(); @@ -1105,6 +1132,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services } [Test] + [LongRunning] public void DeletePublishedContent() { IContent content = CreateContent(); @@ -1124,6 +1152,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services } [Test] + [LongRunning] public void DeletePublishedContentWithChanges() { IContent content = CreateContent(); @@ -1145,6 +1174,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services } [Test] + [LongRunning] public void DeleteMaskedPublishedContent() { IContent content1 = CreateContent(); @@ -1168,6 +1198,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services } [Test] + [LongRunning] public void DeleteBranch() { IContent content1 = CreateBranch(); @@ -1211,6 +1242,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services #region Move [Test] + [LongRunning] public void MoveUnpublishedContentUnderUnpublished() { IContent content1 = CreateContent(); @@ -1252,6 +1284,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services } [Test] + [LongRunning] public void MovePublishedContentWithChangesUnderUnpublished() { IContent content1 = CreateContent(); @@ -1275,6 +1308,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services } [Test] + [LongRunning] public void MoveUnpublishedContentUnderPublished() { IContent content1 = CreateContent(); @@ -1296,6 +1330,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services } [Test] + [LongRunning] public void MoveUnpublishedContentUnderMasked() { IContent content1 = CreateContent(); @@ -1369,6 +1404,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services } [Test] + [LongRunning] public void MovePublishedContentWithChangesUnderPublished() { IContent content1 = CreateContent(); @@ -1421,6 +1457,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services } [Test] + [LongRunning] public void MoveMaskedPublishedContentUnderPublished() { IContent content1 = CreateContent(); @@ -1447,6 +1484,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services } [Test] + [LongRunning] public void MoveMaskedPublishedContentUnderMasked() { IContent content1 = CreateContent(); @@ -1505,6 +1543,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services } [Test] + [LongRunning] public void MoveMaskedPublishedContentWithChangesUnderMasked() { IContent content1 = CreateContent(); @@ -1537,6 +1576,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services } [Test] + [LongRunning] public void MoveMaskedPublishedContentUnderUnpublished() { IContent content1 = CreateContent(); @@ -1589,6 +1629,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services } [Test] + [LongRunning] public void MoveContentBranchUnderUnpublished() { IContent content1 = CreateBranch(); @@ -1629,6 +1670,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services } [Test] + [LongRunning] public void MoveContentBranchUnderPublished() { IContent content1 = CreateBranch(); @@ -1670,6 +1712,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services } [Test] + [LongRunning] public void MoveContentBranchUnderMasked() { IContent content1 = CreateBranch(); @@ -1715,6 +1758,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services } [Test] + [LongRunning] public void MoveContentBranchBackFromPublished() { IContent content1 = CreateBranch(); @@ -1758,6 +1802,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services } [Test] + [LongRunning] public void MoveContentBranchBackFromUnpublished() { IContent content1 = CreateBranch(); @@ -1800,6 +1845,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services } [Test] + [LongRunning] public void MoveContentBranchBackFromMasked() { IContent content1 = CreateBranch(); @@ -1851,6 +1897,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services #region Copy [Test] + [LongRunning] public void CopyUnpublishedContent() { IContent content = CreateContent(); @@ -1869,6 +1916,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services } [Test] + [LongRunning] public void CopyPublishedContent() { IContent content = CreateContent(); @@ -1888,6 +1936,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services } [Test] + [LongRunning] public void CopyMaskedContent() { IContent content = CreateContent(); @@ -1910,6 +1959,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services } [Test] + [LongRunning] public void CopyBranch() { IContent content = CreateBranch(); @@ -1953,6 +2003,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services #region Rollback [Test] + [LongRunning] public void Rollback() { IContent content = CreateContent(); @@ -1991,6 +2042,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services #region Misc [Test] + [LongRunning] public void ContentRemembers() { IContent content = ContentService.GetRootContent().FirstOrDefault(); diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentServiceNotificationTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentServiceNotificationTests.cs index e087f73104..f7fbe57185 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentServiceNotificationTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentServiceNotificationTests.cs @@ -10,6 +10,7 @@ using Umbraco.Cms.Core.Models; using Umbraco.Cms.Core.Notifications; using Umbraco.Cms.Core.Services; using Umbraco.Cms.Infrastructure.Persistence.Repositories.Implement; +using Umbraco.Cms.Tests.Common.Attributes; using Umbraco.Cms.Tests.Common.Builders; using Umbraco.Cms.Tests.Common.Testing; using Umbraco.Cms.Tests.Integration.Testing; @@ -337,6 +338,7 @@ public class ContentServiceNotificationTests : UmbracoIntegrationTest } [Test] + [LongRunning] public void Unpublishing_Culture() { LocalizationService.Save(new Language("fr-FR", "French (France)")); diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentServicePerformanceTest.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentServicePerformanceTest.cs index 54cb06ef04..b774ebe876 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentServicePerformanceTest.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentServicePerformanceTest.cs @@ -13,6 +13,7 @@ using Umbraco.Cms.Core.Models; using Umbraco.Cms.Core.Persistence.Repositories; using Umbraco.Cms.Core.Services; using Umbraco.Cms.Infrastructure.Persistence.Repositories.Implement; +using Umbraco.Cms.Tests.Common.Attributes; using Umbraco.Cms.Tests.Common.Builders; using Umbraco.Cms.Tests.Common.TestHelpers.Stubs; using Umbraco.Cms.Tests.Common.Testing; @@ -47,6 +48,7 @@ public class ContentServicePerformanceTest : UmbracoIntegrationTest } [Test] + [LongRunning] public void Retrieving_All_Content_In_Site() { // NOTE: Doing this the old 1 by 1 way and based on the results of the ContentServicePerformanceTest.Retrieving_All_Content_In_Site @@ -112,6 +114,7 @@ public class ContentServicePerformanceTest : UmbracoIntegrationTest } [Test] + [LongRunning] public void Creating_100_Items() { // Arrange @@ -131,6 +134,7 @@ public class ContentServicePerformanceTest : UmbracoIntegrationTest } [Test] + [LongRunning] public void Creating_1000_Items() { // Arrange @@ -150,6 +154,7 @@ public class ContentServicePerformanceTest : UmbracoIntegrationTest } [Test] + [LongRunning] public void Getting_100_Uncached_Items() { // Arrange @@ -177,6 +182,7 @@ public class ContentServicePerformanceTest : UmbracoIntegrationTest } [Test] + [LongRunning] public void Getting_1000_Uncached_Items() { // Arrange @@ -203,6 +209,7 @@ public class ContentServicePerformanceTest : UmbracoIntegrationTest } [Test] + [LongRunning] public void Getting_100_Cached_Items() { // Arrange @@ -232,6 +239,7 @@ public class ContentServicePerformanceTest : UmbracoIntegrationTest } [Test] + [LongRunning] public void Getting_1000_Cached_Items() { // Arrange diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentServicePublishBranchTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentServicePublishBranchTests.cs index 08b36a6647..02efa11a07 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentServicePublishBranchTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentServicePublishBranchTests.cs @@ -7,6 +7,7 @@ using NUnit.Framework; using Umbraco.Cms.Core; using Umbraco.Cms.Core.Models; using Umbraco.Cms.Core.Services; +using Umbraco.Cms.Tests.Common.Attributes; using Umbraco.Cms.Tests.Common.Testing; using Umbraco.Cms.Tests.Integration.Testing; @@ -27,6 +28,7 @@ public class ContentServicePublishBranchTests : UmbracoIntegrationTest [TestCase(1)] // use overload w/ culture: "*" [TestCase(2)] // use overload w/ cultures: new [] { "*" } + [LongRunning] public void Can_Publish_Invariant_Branch(int method) { CreateTypes(out var iContentType, out _); diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentTypeServiceTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentTypeServiceTests.cs index 056f65947e..0c435f537d 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentTypeServiceTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentTypeServiceTests.cs @@ -11,6 +11,7 @@ using Umbraco.Cms.Core.Exceptions; using Umbraco.Cms.Core.Models; using Umbraco.Cms.Core.Notifications; using Umbraco.Cms.Core.Services; +using Umbraco.Cms.Tests.Common.Attributes; using Umbraco.Cms.Tests.Common.Builders; using Umbraco.Cms.Tests.Common.Testing; using Umbraco.Cms.Tests.Integration.Testing; @@ -74,6 +75,7 @@ public class ContentTypeServiceTests : UmbracoIntegrationTest } [Test] + [LongRunning] public void Deleting_Content_Type_With_Hierarchy_Of_Content_Items_Moves_Orphaned_Content_To_Recycle_Bin() { var template = TemplateBuilder.CreateTextPageTemplate(); @@ -125,6 +127,7 @@ public class ContentTypeServiceTests : UmbracoIntegrationTest } [Test] + [LongRunning] public void Deleting_Content_Types_With_Hierarchy_Of_Content_Items_Doesnt_Raise_Trashed_Event_For_Deleted_Items_1() { ContentNotificationHandler.MovedContentToRecycleBin = MovedContentToRecycleBin; @@ -175,6 +178,7 @@ public class ContentTypeServiceTests : UmbracoIntegrationTest } [Test] + [LongRunning] public void Deleting_Content_Types_With_Hierarchy_Of_Content_Items_Doesnt_Raise_Trashed_Event_For_Deleted_Items_2() { ContentNotificationHandler.MovedContentToRecycleBin = MovedContentToRecycleBin; diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentTypeServiceVariantsTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentTypeServiceVariantsTests.cs index de214a9d13..4e8e8c548e 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentTypeServiceVariantsTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentTypeServiceVariantsTests.cs @@ -11,6 +11,7 @@ using Umbraco.Cms.Core.Services; using Umbraco.Cms.Core.Sync; using Umbraco.Cms.Infrastructure.Persistence; using Umbraco.Cms.Infrastructure.Persistence.Dtos; +using Umbraco.Cms.Tests.Common.Attributes; using Umbraco.Cms.Tests.Common.Builders; using Umbraco.Cms.Tests.Common.Testing; using Umbraco.Cms.Tests.Integration.Testing; @@ -81,6 +82,7 @@ public class ContentTypeServiceVariantsTests : UmbracoIntegrationTest [TestCase(ContentVariation.CultureAndSegment, ContentVariation.Culture, true)] [TestCase(ContentVariation.CultureAndSegment, ContentVariation.Segment, true)] [TestCase(ContentVariation.CultureAndSegment, ContentVariation.CultureAndSegment, false)] + [LongRunning] public void Change_Content_Type_Variation_Clears_Redirects(ContentVariation startingContentTypeVariation, ContentVariation changedContentTypeVariation, bool shouldUrlRedirectsBeCleared) { diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/EntityServiceTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/EntityServiceTests.cs index f1b47e81c4..f136abceab 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/EntityServiceTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/EntityServiceTests.cs @@ -9,6 +9,7 @@ using Umbraco.Cms.Core.Models; using Umbraco.Cms.Core.Models.Entities; using Umbraco.Cms.Core.Services; using Umbraco.Cms.Infrastructure.Persistence; +using Umbraco.Cms.Tests.Common.Attributes; using Umbraco.Cms.Tests.Common.Builders; using Umbraco.Cms.Tests.Common.Testing; using Umbraco.Cms.Tests.Integration.Testing; @@ -190,6 +191,7 @@ public class EntityServiceTests : UmbracoIntegrationTest } [Test] + [LongRunning] public void EntityService_Can_Get_Paged_Content_Descendants_Including_Recycled() { var contentType = ContentTypeService.Get("umbTextpage"); @@ -231,6 +233,7 @@ public class EntityServiceTests : UmbracoIntegrationTest } [Test] + [LongRunning] public void EntityService_Can_Get_Paged_Content_Descendants_Without_Recycled() { var contentType = ContentTypeService.Get("umbTextpage"); @@ -273,6 +276,7 @@ public class EntityServiceTests : UmbracoIntegrationTest } [Test] + [LongRunning] public void EntityService_Can_Get_Paged_Trashed_Content_Children() { var contentType = ContentTypeService.Get("umbTextpage"); @@ -378,6 +382,7 @@ public class EntityServiceTests : UmbracoIntegrationTest } [Test] + [LongRunning] public void EntityService_Can_Get_Paged_Media_Descendants() { var folderType = MediaTypeService.Get(1031); @@ -410,6 +415,7 @@ public class EntityServiceTests : UmbracoIntegrationTest } [Test] + [LongRunning] public void EntityService_Can_Get_Paged_Media_Descendants_Including_Recycled() { var folderType = MediaTypeService.Get(1031); @@ -452,6 +458,7 @@ public class EntityServiceTests : UmbracoIntegrationTest } [Test] + [LongRunning] public void EntityService_Can_Get_Paged_Media_Descendants_Without_Recycled() { var folderType = MediaTypeService.Get(1031); @@ -495,6 +502,7 @@ public class EntityServiceTests : UmbracoIntegrationTest } [Test] + [LongRunning] public void EntityService_Can_Get_Paged_Trashed_Media_Children() { var folderType = MediaTypeService.Get(1031); @@ -539,6 +547,7 @@ public class EntityServiceTests : UmbracoIntegrationTest } [Test] + [LongRunning] public void EntityService_Can_Get_Paged_Media_Descendants_With_Search() { var folderType = MediaTypeService.Get(1031); diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/MediaTypeServiceTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/MediaTypeServiceTests.cs index caceb8e2cb..6c779a3c6e 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/MediaTypeServiceTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/MediaTypeServiceTests.cs @@ -9,6 +9,7 @@ using Umbraco.Cms.Core.Events; using Umbraco.Cms.Core.Models; using Umbraco.Cms.Core.Notifications; using Umbraco.Cms.Core.Services; +using Umbraco.Cms.Tests.Common.Attributes; using Umbraco.Cms.Tests.Common.Builders; using Umbraco.Cms.Tests.Common.Testing; using Umbraco.Cms.Tests.Integration.Testing; @@ -93,6 +94,7 @@ public class MediaTypeServiceTests : UmbracoIntegrationTest } [Test] + [LongRunning] public void Deleting_Media_Types_With_Hierarchy_Of_Media_Items_Doesnt_Raise_Trashed_Event_For_Deleted_Items() { ContentNotificationHandler.MovedMediaToRecycleBin = MovedMediaToRecycleBin; diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/RedirectUrlServiceTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/RedirectUrlServiceTests.cs index 7ebf4ab1d2..1d31815bef 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/RedirectUrlServiceTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/RedirectUrlServiceTests.cs @@ -11,6 +11,7 @@ using Umbraco.Cms.Core.Models; using Umbraco.Cms.Core.Services; using Umbraco.Cms.Infrastructure.Persistence.Repositories.Implement; using Umbraco.Cms.Infrastructure.Scoping; +using Umbraco.Cms.Tests.Common.Attributes; using Umbraco.Cms.Tests.Common.Testing; using Umbraco.Cms.Tests.Integration.Testing; @@ -58,6 +59,7 @@ public class RedirectUrlServiceTests : UmbracoIntegrationTestWithContent } [Test] + [LongRunning] public void Can_Get_Most_Recent_RedirectUrl() { var redirect = RedirectUrlService.GetMostRecentRedirectUrl(Url); @@ -65,6 +67,7 @@ public class RedirectUrlServiceTests : UmbracoIntegrationTestWithContent } [Test] + [LongRunning] public void Can_Get_Most_Recent_RedirectUrl_With_Culture() { var redirect = RedirectUrlService.GetMostRecentRedirectUrl(Url, CultureEnglish); @@ -72,6 +75,7 @@ public class RedirectUrlServiceTests : UmbracoIntegrationTestWithContent } [Test] + [LongRunning] public void Can_Get_Most_Recent_RedirectUrl_With_Culture_When_No_CultureVariant_Exists() { var redirect = RedirectUrlService.GetMostRecentRedirectUrl(UrlAlt, UnusedCulture); diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ThreadSafetyServiceTest.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ThreadSafetyServiceTest.cs index d74ba7583d..72c046ef36 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ThreadSafetyServiceTest.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ThreadSafetyServiceTest.cs @@ -9,6 +9,7 @@ using NUnit.Framework; using Umbraco.Cms.Core.Models; using Umbraco.Cms.Core.Services; using Umbraco.Cms.Infrastructure.Persistence; +using Umbraco.Cms.Tests.Common.Attributes; using Umbraco.Cms.Tests.Common.Builders; using Umbraco.Cms.Tests.Common.Testing; using Umbraco.Cms.Tests.Integration.Testing; @@ -101,6 +102,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services } [Test] + [LongRunning] public void Ensure_All_Threads_Execute_Successfully_Content_Service() { if (Environment.GetEnvironmentVariable("UMBRACO_TMP") != null) @@ -195,6 +197,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services } [Test] + [LongRunning] public void Ensure_All_Threads_Execute_Successfully_Media_Service() { if (Environment.GetEnvironmentVariable("UMBRACO_TMP") != null) diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/TrackRelationsTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/TrackRelationsTests.cs index a7e1fbd803..cbcc0e4a3d 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/TrackRelationsTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/TrackRelationsTests.cs @@ -4,6 +4,7 @@ using Umbraco.Cms.Core; using Umbraco.Cms.Core.DependencyInjection; using Umbraco.Cms.Core.Models; using Umbraco.Cms.Core.Services; +using Umbraco.Cms.Tests.Common.Attributes; using Umbraco.Cms.Tests.Common.Builders; using Umbraco.Cms.Tests.Common.Testing; using Umbraco.Cms.Tests.Integration.Testing; @@ -31,6 +32,7 @@ public class TrackRelationsTests : UmbracoIntegrationTestWithContent } [Test] + [LongRunning] public void Automatically_Track_Relations() { var mt = MediaTypeBuilder.CreateSimpleMediaType("testMediaType", "Test Media Type"); diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Tests.Integration.csproj b/tests/Umbraco.Tests.Integration/Umbraco.Tests.Integration.csproj index 0a3ca65c85..7c484a98ce 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Tests.Integration.csproj +++ b/tests/Umbraco.Tests.Integration/Umbraco.Tests.Integration.csproj @@ -7,6 +7,7 @@ Umbraco.Cms.Tests.Integration true true + true diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Web.BackOffice/Controllers/BackOfficeAssetsControllerTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Web.BackOffice/Controllers/BackOfficeAssetsControllerTests.cs index fa14b4ed83..550bb0356a 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Web.BackOffice/Controllers/BackOfficeAssetsControllerTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Web.BackOffice/Controllers/BackOfficeAssetsControllerTests.cs @@ -4,6 +4,7 @@ using System.Net; using System.Threading.Tasks; using NUnit.Framework; +using Umbraco.Cms.Tests.Common.Attributes; using Umbraco.Cms.Tests.Integration.TestServerTest; using Umbraco.Cms.Web.BackOffice.Controllers; @@ -13,6 +14,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Web.BackOffice.Controllers; public class BackOfficeAssetsControllerTests : UmbracoTestServerTestBase { [Test] + [LongRunning] public async Task EnsureSuccessStatusCode() { // Arrange diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Web.BackOffice/Controllers/ContentControllerTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Web.BackOffice/Controllers/ContentControllerTests.cs index d1a3caa2ea..1dea0091d2 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Web.BackOffice/Controllers/ContentControllerTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Web.BackOffice/Controllers/ContentControllerTests.cs @@ -11,6 +11,7 @@ using Umbraco.Cms.Core; using Umbraco.Cms.Core.Models; using Umbraco.Cms.Core.Models.ContentEditing; using Umbraco.Cms.Core.Services; +using Umbraco.Cms.Tests.Common.Attributes; using Umbraco.Cms.Tests.Common.Builders; using Umbraco.Cms.Tests.Common.Builders.Extensions; using Umbraco.Cms.Tests.Integration.TestServerTest; @@ -30,6 +31,7 @@ public class ContentControllerTests : UmbracoTestServerTestBase /// Returns 404 if the content wasn't found based on the ID specified /// [Test] + [LongRunning] public async Task PostSave_Validate_Existing_Content() { var localizationService = GetRequiredService(); @@ -86,6 +88,7 @@ public class ContentControllerTests : UmbracoTestServerTestBase } [Test] + [LongRunning] public async Task PostSave_Validate_At_Least_One_Variant_Flagged_For_Saving() { var localizationService = GetRequiredService(); @@ -154,6 +157,7 @@ public class ContentControllerTests : UmbracoTestServerTestBase /// Returns 404 if any of the posted properties dont actually exist /// [Test] + [LongRunning] public async Task PostSave_Validate_Properties_Exist() { var localizationService = GetRequiredService(); @@ -217,6 +221,7 @@ public class ContentControllerTests : UmbracoTestServerTestBase } [Test] + [LongRunning] public async Task PostSave_Simple_Invariant() { var localizationService = GetRequiredService(); @@ -276,6 +281,7 @@ public class ContentControllerTests : UmbracoTestServerTestBase } [Test] + [LongRunning] public async Task PostSave_Validate_Empty_Name() { var localizationService = GetRequiredService(); @@ -338,6 +344,7 @@ public class ContentControllerTests : UmbracoTestServerTestBase } [Test] + [LongRunning] public async Task PostSave_Validate_Variants_Empty_Name() { var localizationService = GetRequiredService(); @@ -400,6 +407,7 @@ public class ContentControllerTests : UmbracoTestServerTestBase } [Test] + [LongRunning] public async Task PostSave_Validates_Domains_Exist() { var localizationService = GetRequiredService(); @@ -447,6 +455,7 @@ public class ContentControllerTests : UmbracoTestServerTestBase } [Test] + [LongRunning] public async Task PostSave_Validates_All_Ancestor_Cultures_Are_Considered() { var sweIso = "sv-SE"; @@ -534,6 +543,7 @@ public class ContentControllerTests : UmbracoTestServerTestBase } [Test] + [LongRunning] public async Task PostSave_Validates_All_Cultures_Has_Domains() { var localizationService = GetRequiredService(); @@ -590,6 +600,7 @@ public class ContentControllerTests : UmbracoTestServerTestBase } [Test] + [LongRunning] public async Task PostSave_Checks_Ancestors_For_Domains() { var localizationService = GetRequiredService(); @@ -677,6 +688,7 @@ public class ContentControllerTests : UmbracoTestServerTestBase [TestCase( @"

", true)] + [LongRunning] public async Task PostSave_Simple_RichText_With_Base64(string html, bool shouldHaveDataUri) { var url = PrepareApiControllerUrl(x => x.PostSave(null)); diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Web.BackOffice/Controllers/DataTypeControllerTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Web.BackOffice/Controllers/DataTypeControllerTests.cs index 80ededff93..ed27a51aed 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Web.BackOffice/Controllers/DataTypeControllerTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Web.BackOffice/Controllers/DataTypeControllerTests.cs @@ -4,6 +4,7 @@ using Umbraco.Cms.Core.Models; using Umbraco.Cms.Core.Models.ContentEditing; using Umbraco.Cms.Core.Serialization; using Umbraco.Cms.Core.Services; +using Umbraco.Cms.Tests.Common.Attributes; using Umbraco.Cms.Tests.Common.Builders; using Umbraco.Cms.Tests.Common.Builders.Extensions; using Umbraco.Cms.Tests.Integration.TestServerTest; @@ -19,6 +20,7 @@ public class DataTypeControllerTests : UmbracoTestServerTestBase [Test] [TestCase(true)] [TestCase(false)] + [LongRunning] public async Task Has_Values_Returns_Correct_Values(bool expectHasValues) { var dataTypeService = GetRequiredService(); diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Web.BackOffice/Controllers/EntityControllerTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Web.BackOffice/Controllers/EntityControllerTests.cs index 52dd930ac5..0dc9e55a28 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Web.BackOffice/Controllers/EntityControllerTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Web.BackOffice/Controllers/EntityControllerTests.cs @@ -9,6 +9,7 @@ using Umbraco.Cms.Core; using Umbraco.Cms.Core.Models; using Umbraco.Cms.Core.Scoping; using Umbraco.Cms.Core.Services; +using Umbraco.Cms.Tests.Common.Attributes; using Umbraco.Cms.Tests.Common.Builders; using Umbraco.Cms.Tests.Common.Builders.Extensions; using Umbraco.Cms.Tests.Integration.TestServerTest; @@ -24,6 +25,7 @@ public class EntityControllerTests : UmbracoTestServerTestBase private IScopeProvider ScopeProvider => GetRequiredService(); [Test] + [LongRunning] public async Task GetUrlsByIds_MediaWithIntegerIds_ReturnsValidMap() { var mediaTypeService = Services.GetRequiredService(); @@ -67,6 +69,7 @@ public class EntityControllerTests : UmbracoTestServerTestBase } [Test] + [LongRunning] public async Task GetUrlsByIds_Media_ReturnsEmptyStringsInMapForUnknownItems() { var queryParameters = new Dictionary { ["type"] = Constants.UdiEntityType.Media }; @@ -91,6 +94,7 @@ public class EntityControllerTests : UmbracoTestServerTestBase } [Test] + [LongRunning] public async Task GetUrlsByIds_MediaWithGuidIds_ReturnsValidMap() { var mediaTypeService = Services.GetRequiredService(); @@ -177,6 +181,7 @@ public class EntityControllerTests : UmbracoTestServerTestBase } [Test] + [LongRunning] public async Task GetUrlsByIds_Documents_ReturnsHashesInMapForUnknownItems() { var queryParameters = new Dictionary { ["type"] = Constants.UdiEntityType.Document }; @@ -201,6 +206,7 @@ public class EntityControllerTests : UmbracoTestServerTestBase } [Test] + [LongRunning] public async Task GetUrlsByIds_DocumentWithIntIds_ReturnsValidMap() { var contentTypeService = Services.GetRequiredService(); @@ -250,6 +256,7 @@ public class EntityControllerTests : UmbracoTestServerTestBase } [Test] + [LongRunning] public async Task GetUrlsByIds_DocumentWithGuidIds_ReturnsValidMap() { var contentTypeService = Services.GetRequiredService(); @@ -299,6 +306,7 @@ public class EntityControllerTests : UmbracoTestServerTestBase } [Test] + [LongRunning] public async Task GetUrlsByIds_DocumentWithUdiIds_ReturnsValidMap() { var contentTypeService = Services.GetRequiredService(); @@ -348,6 +356,7 @@ public class EntityControllerTests : UmbracoTestServerTestBase } [Test] + [LongRunning] public async Task GetByIds_MultipleCalls_WorksAsExpected() { var contentTypeService = Services.GetRequiredService(); diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Web.BackOffice/Controllers/TemplateQueryControllerTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Web.BackOffice/Controllers/TemplateQueryControllerTests.cs index 0edaea5329..0b6d4dc289 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Web.BackOffice/Controllers/TemplateQueryControllerTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Web.BackOffice/Controllers/TemplateQueryControllerTests.cs @@ -7,6 +7,7 @@ using Newtonsoft.Json; using Newtonsoft.Json.Linq; using NUnit.Framework; using Umbraco.Cms.Core.Models.TemplateQuery; +using Umbraco.Cms.Tests.Common.Attributes; using Umbraco.Cms.Tests.Common.Builders.Extensions; using Umbraco.Cms.Tests.Integration.TestServerTest; using Umbraco.Cms.Web.BackOffice.Controllers; @@ -19,6 +20,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Web.BackOffice.Controllers; public class TemplateQueryControllerTests : UmbracoTestServerTestBase { [Test] + [LongRunning] public async Task GetContentTypes__Ensure_camel_case() { var url = PrepareApiControllerUrl(x => x.GetContentTypes()); diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Web.BackOffice/Controllers/UsersControllerTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Web.BackOffice/Controllers/UsersControllerTests.cs index c89841260a..9ebe896913 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Web.BackOffice/Controllers/UsersControllerTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Web.BackOffice/Controllers/UsersControllerTests.cs @@ -11,6 +11,7 @@ using Umbraco.Cms.Core.Models; using Umbraco.Cms.Core.Models.ContentEditing; using Umbraco.Cms.Core.Models.Membership; using Umbraco.Cms.Core.Services; +using Umbraco.Cms.Tests.Common.Attributes; using Umbraco.Cms.Tests.Common.Builders; using Umbraco.Cms.Tests.Common.Builders.Extensions; using Umbraco.Cms.Tests.Integration.TestServerTest; @@ -24,6 +25,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Web.BackOffice.Controllers; public class UsersControllerTests : UmbracoTestServerTestBase { [Test] + [LongRunning] public async Task Save_User() { var url = PrepareApiControllerUrl(x => x.PostSaveUser(null)); @@ -70,6 +72,7 @@ public class UsersControllerTests : UmbracoTestServerTestBase } [Test] + [LongRunning] public async Task GetPagedUsers_Empty() { // We get page 2 to force an empty response because there always in the useradmin user @@ -92,6 +95,7 @@ public class UsersControllerTests : UmbracoTestServerTestBase } [Test] + [LongRunning] public async Task GetPagedUsers_multiple_pages() { var totalNumberOfUsers = 11; @@ -130,6 +134,7 @@ public class UsersControllerTests : UmbracoTestServerTestBase } [Test] + [LongRunning] public async Task PostUnlockUsers_When_UserIds_Not_Supplied_Expect_Ok_Response() { var url = PrepareApiControllerUrl(x => x.PostUnlockUsers(Array.Empty())); @@ -141,6 +146,7 @@ public class UsersControllerTests : UmbracoTestServerTestBase } [Test] + [LongRunning] public async Task PostUnlockUsers_When_User_Does_Not_Exist_Expect_Zero_Users_Message() { var userId = 42; // Must not exist @@ -157,6 +163,7 @@ public class UsersControllerTests : UmbracoTestServerTestBase } [Test] + [LongRunning] public async Task PostUnlockUsers_When_One_UserId_Supplied_Expect_User_Locked_Out_With_Correct_Response_Message() { var userService = GetRequiredService(); @@ -186,6 +193,7 @@ public class UsersControllerTests : UmbracoTestServerTestBase } [Test] + [LongRunning] public async Task PostUnlockUsers_When_Multiple_UserIds_Supplied_Expect_User_Locked_Out_With_Correct_Response_Message() { @@ -228,6 +236,7 @@ public class UsersControllerTests : UmbracoTestServerTestBase } [Test] + [LongRunning] public async Task Cannot_Disable_Invited_User() { var userService = GetRequiredService(); @@ -258,6 +267,7 @@ public class UsersControllerTests : UmbracoTestServerTestBase } [Test] + [LongRunning] public async Task Can_Disable_Active_User() { var userService = GetRequiredService(); diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Web.BackOffice/Filters/OutgoingEditorModelEventFilterTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Web.BackOffice/Filters/OutgoingEditorModelEventFilterTests.cs index ec4a2598f1..28dd68bc97 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Web.BackOffice/Filters/OutgoingEditorModelEventFilterTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Web.BackOffice/Filters/OutgoingEditorModelEventFilterTests.cs @@ -10,6 +10,7 @@ using Umbraco.Cms.Core.Models.ContentEditing; using Umbraco.Cms.Core.Notifications; using Umbraco.Cms.Core.Serialization; using Umbraco.Cms.Core.Services; +using Umbraco.Cms.Tests.Common.Attributes; using Umbraco.Cms.Tests.Common.Builders; using Umbraco.Cms.Tests.Common.Builders.Extensions; using Umbraco.Cms.Tests.Integration.TestServerTest; @@ -34,6 +35,7 @@ public class OutgoingEditorModelEventFilterTests : UmbracoTestServerTestBase public void Reset() => ResetNotifications(); [Test] + [LongRunning] public async Task Content_Item_With_Schedule_Raises_SendingContentNotification() { IContentTypeService contentTypeService = GetRequiredService(); @@ -68,6 +70,7 @@ public class OutgoingEditorModelEventFilterTests : UmbracoTestServerTestBase } [Test] + [LongRunning] public async Task Publish_Schedule_Is_Mapped_Correctly() { const string UsIso = "en-US"; diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Web.Website/Routing/FrontEndRouteTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Web.Website/Routing/FrontEndRouteTests.cs index 2bc3dc3d89..d8383bc601 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Web.Website/Routing/FrontEndRouteTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Web.Website/Routing/FrontEndRouteTests.cs @@ -9,6 +9,7 @@ using Umbraco.Cms.Core.Routing; using Umbraco.Cms.Core.Services; using Umbraco.Cms.Core.Web; using Umbraco.Cms.Infrastructure.Persistence; +using Umbraco.Cms.Tests.Common.Attributes; using Umbraco.Cms.Tests.Integration.TestServerTest; using Umbraco.Cms.Web.Common.Attributes; using Umbraco.Cms.Web.Website.Controllers; @@ -48,6 +49,7 @@ public class SurfaceControllerTests : UmbracoTestServerTestBase } [Test] + [LongRunning] public async Task Plugin_Controller_Routes_By_Area() { // Create URL manually, because PrepareSurfaceController URl will prepare whatever the controller is routed as diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Web.Website/Security/MemberAuthorizeTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Web.Website/Security/MemberAuthorizeTests.cs index 0fc1dfa85d..c2e7389f66 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Web.Website/Security/MemberAuthorizeTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Web.Website/Security/MemberAuthorizeTests.cs @@ -12,6 +12,7 @@ using Umbraco.Cms.Core.Security; using Umbraco.Cms.Core.Services; using Umbraco.Cms.Core.Web; using Umbraco.Cms.Infrastructure.Persistence; +using Umbraco.Cms.Tests.Common.Attributes; using Umbraco.Cms.Tests.Integration.TestServerTest; using Umbraco.Cms.Web.Common.Controllers; using Umbraco.Cms.Web.Common.Filters; @@ -33,6 +34,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Web.Website.Security } [Test] + [LongRunning] public async Task Secure_SurfaceController_Should_Return_Redirect_WhenNotLoggedIn() { _memberManagerMock.Setup(x => x.IsLoggedIn()).Returns(false); @@ -47,6 +49,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Web.Website.Security } [Test] + [LongRunning] public async Task Secure_SurfaceController_Should_Return_Redirect_WhenNotAuthorized() { _memberManagerMock.Setup(x => x.IsLoggedIn()).Returns(true); @@ -67,6 +70,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Web.Website.Security [Test] + [LongRunning] public async Task Secure_ApiController_Should_Return_Unauthorized_WhenNotLoggedIn() { _memberManagerMock.Setup(x => x.IsLoggedIn()).Returns(false); @@ -78,6 +82,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Web.Website.Security } [Test] + [LongRunning] public async Task Secure_ApiController_Should_Return_Forbidden_WhenNotAuthorized() { _memberManagerMock.Setup(x => x.IsLoggedIn()).Returns(true); diff --git a/tools/Umbraco.JsonSchema/Umbraco.JsonSchema.csproj b/tools/Umbraco.JsonSchema/Umbraco.JsonSchema.csproj index c9275c6b94..90f301b2a1 100644 --- a/tools/Umbraco.JsonSchema/Umbraco.JsonSchema.csproj +++ b/tools/Umbraco.JsonSchema/Umbraco.JsonSchema.csproj @@ -12,5 +12,6 @@ +