Skip to content

V15 QA acceptance tests with appsettings #19550

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 74 commits into
base: v15/dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 64 commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
5e78a00
Start of appsetting
andr317c Dec 4, 2024
8830c22
Updated setup of playwright
andr317c Dec 9, 2024
59d0545
Adjusted the pipeline
andr317c Dec 9, 2024
da86e2c
Updated appsetting
andr317c Dec 12, 2024
aaffe15
Added install test
andr317c Dec 12, 2024
75cf638
Added comments
andr317c Dec 12, 2024
442a5bd
Updated pipeline
andr317c Dec 12, 2024
1998581
Updated development app settings
andr317c Dec 12, 2024
af2f12c
Commented tests out
andr317c Dec 12, 2024
f9452e0
comment
andr317c Dec 12, 2024
c22d16a
Added if statement
andr317c Dec 12, 2024
c19e47a
Merge remote-tracking branch 'origin/v15/dev' into v15/QA/acceptance-…
andr317c Feb 18, 2025
f1bd902
Updated pipeline
andr317c Feb 18, 2025
736efcc
Fixed condition
andr317c Feb 18, 2025
6ccd27e
Changed to production
andr317c Feb 18, 2025
0fb19af
Added a log
andr317c Feb 18, 2025
ac2686d
Updated copy item
andr317c Feb 18, 2025
8a4f931
Added
andr317c Feb 18, 2025
ddd46be
Updated app settings
andr317c Feb 18, 2025
b39fe0f
Updated pipeline
andr317c Feb 18, 2025
8469d6c
Moved playwright login
andr317c Feb 18, 2025
6683c1c
Updated pipeline
andr317c Feb 18, 2025
b2031aa
Updated app setting
andr317c Feb 19, 2025
3cf1174
Updated nightly
andr317c Feb 19, 2025
7a6a1ab
Updated appsettings
andr317c Feb 19, 2025
c736691
Updated get
andr317c Feb 19, 2025
a840774
Updated wait on
andr317c Feb 19, 2025
f5d771e
Updated appsettings
andr317c Feb 19, 2025
7c10dca
Updated connection string
andr317c Feb 19, 2025
3631058
Updates
andr317c Feb 19, 2025
75568e2
Skips code
andr317c Feb 20, 2025
4381770
Updated variable
andr317c Feb 20, 2025
84ff53a
Merge remote-tracking branch 'origin/v15/dev' into v15/QA/acceptance-…
andr317c May 13, 2025
0d93f36
Updated pipeline
andr317c May 13, 2025
b081226
We want to always retain the trace, to see if the test runs as expect…
andr317c May 13, 2025
b940877
Added a temporary wait till port is open
andr317c May 13, 2025
5cbad91
Fixed condition
andr317c May 13, 2025
4c45311
Added missing tcp for wait on
andr317c May 13, 2025
8536ac7
Updated URL env
andr317c May 14, 2025
4d7e80e
Updated setup
andr317c May 14, 2025
8508e5a
Fixed string
andr317c May 14, 2025
fcffa51
Updated locator
andr317c May 14, 2025
dcf9d36
Split tests into SQLite and SQLServer
andr317c May 15, 2025
e6f3b19
Updated pipeline to run all tests
andr317c May 15, 2025
6a8b69d
Retain trace on failure
andr317c May 15, 2025
3c435c3
Added testFolder var
andr317c May 15, 2025
6417869
Merge remote-tracking branch 'origin/v15/dev' into v15/QA/acceptance-…
andr317c Jun 10, 2025
142e4e9
Added appsettings and program for delivery api tests
andr317c Jun 10, 2025
a41ba51
Updated playwright config
andr317c Jun 10, 2025
6c959a4
Split test runners into defaultconfig and different app settings
andr317c Jun 10, 2025
a6bd1c5
Added delivery api tests
andr317c Jun 10, 2025
3add0ac
Cleaned up tests
andr317c Jun 11, 2025
d063c0b
Bumped version
andr317c Jun 11, 2025
4a1a269
Updated pipeline
andr317c Jun 11, 2025
68294f4
Small fixes
andr317c Jun 11, 2025
b63a8f1
Added password
andr317c Jun 11, 2025
256bd52
Updated connection string
andr317c Jun 11, 2025
f66fd0b
Fixed
andr317c Jun 11, 2025
b388f8b
Removed quotes
andr317c Jun 11, 2025
a35ddd7
Removed unnecessary connection string
andr317c Jun 13, 2025
a8792aa
Added missing password
andr317c Jun 13, 2025
9d08f45
Cleaned up
andr317c Jun 13, 2025
bace5dd
Merge remote-tracking branch 'origin/v15/dev' into v15/QA/acceptance-…
andr317c Jun 13, 2025
cfc64a0
Cleaned up
andr317c Jun 13, 2025
0db3595
Cleaned up
andr317c Jun 13, 2025
7df879c
Updated to use helpers
andr317c Jul 1, 2025
2069501
Bumped version
andr317c Jul 7, 2025
20d2442
Updated helper usage
andr317c Jul 7, 2025
bb45448
Added password to variables and a condition
andr317c Jul 7, 2025
33f7dcf
Added check
andr317c Jul 7, 2025
5bcd29d
Indented value
andr317c Jul 7, 2025
4023945
Fixed condition
andr317c Jul 7, 2025
4db4f14
More updates
andr317c Jul 7, 2025
cf1a22b
Updated variable
andr317c Jul 7, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
399 changes: 361 additions & 38 deletions build/nightly-E2E-test-pipelines.yml

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions tests/Umbraco.Tests.AcceptanceTest/package-lock.json

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

2 changes: 1 addition & 1 deletion tests/Umbraco.Tests.AcceptanceTest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
},
"dependencies": {
"@umbraco/json-models-builders": "^2.0.33",
"@umbraco/playwright-testhelpers": "^15.0.52",
"@umbraco/playwright-testhelpers": "^15.0.53",
"camelize": "^1.0.0",
"dotenv": "^16.3.1",
"node-fetch": "^2.6.7"
Expand Down
26 changes: 23 additions & 3 deletions tests/Umbraco.Tests.AcceptanceTest/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,34 @@ export default defineConfig({
testMatch: '**/*.setup.ts',
},
{
name: 'chromium',
name: 'defaultConfig',
testMatch: 'DefaultConfig/**',
dependencies: ['setup'],
use: {
...devices['Desktop Chrome'],
// Use prepared auth state.
ignoreHTTPSErrors: true,
storageState: STORAGE_STATE,
},
storageState: STORAGE_STATE
}
},
{
name: 'deliveryApi',
testMatch: 'DeliveryApi/**',
dependencies: ['setup'],
use: {
...devices['Desktop Chrome'],
// Use prepared auth state.
ignoreHTTPSErrors: true,
storageState: STORAGE_STATE
}
},
// This project is used to test the install steps, for that we do not need to authenticate.
{
name: 'unattendedInstallConfig',
testMatch: 'UnattendedInstallConfig/**',
use: {
...devices['Desktop Chrome']
}
}
],
});
Original file line number Diff line number Diff line change
@@ -1 +1,58 @@
{}
{
"$schema": "appsettings-schema.json",
"Serilog": {
"MinimumLevel": {
"Default": "Information",
"Override": {
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information",
"System": "Warning"
}
},
"WriteTo": [
{
"Name": "Async",
"Args": {
"Configure": [
{
"Name": "Console"
}
]
}
}
]
},
"Umbraco": {
"CMS": {
"Unattended": {
"InstallUnattended": true,
"UnattendedUserName": "Playwright Test",
"UnattendedUserEmail": "[email protected]",
"UnattendedUserPassword": "UmbracoAcceptance123!"
},
"Content": {
"ContentVersionCleanupPolicy": {
"EnableCleanup": false
}
},
"Global": {
"DisableElectionForSingleServer": true,
"InstallMissingDatabase": true,
"Id": "00000000-0000-0000-0000-000000000042",
"VersionCheckPeriod": 0,
"UseHttps": true
},
"HealthChecks": {
"Notification": {
"Enabled": false
}
},
"KeepAlive": {
"DisableKeepAliveTask": true
},
"WebRouting": {
"UmbracoApplicationUrl": "https://localhost:44331/"
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import {expect} from '@playwright/test';
import {AliasHelper, test} from '@umbraco/playwright-testhelpers';

test('can get content from delivery api', async ({umbracoApi}) => {
// Arrange
const documentTypeName = 'TestDocumentType';
const contentName = 'TestContent';
const dataTypeName = 'Textstring';
const textStringValue = 'This is a test text string value';
await umbracoApi.documentType.ensureNameNotExists(documentTypeName);
const dataType = await umbracoApi.dataType.getByName(dataTypeName);
const documentTypeId = await umbracoApi.documentType.createDocumentTypeWithPropertyEditor(documentTypeName, dataTypeName, dataType.id, 'TestGroup');
const documentId = await umbracoApi.document.createDocumentWithTextContent(contentName, documentTypeId, textStringValue, dataTypeName);
const propertyValue = {
dataTypeName: AliasHelper.toAlias(dataTypeName),
dataTypeValue: textStringValue
}

// Act
await umbracoApi.document.publish(documentId);

// Assert
expect(await umbracoApi.deliveryApi.doesContentItemWithIdContainValues(documentId, contentName, AliasHelper.toAlias(documentTypeName), [propertyValue])).toBeTruthy();

// Clean
await umbracoApi.documentType.ensureNameNotExists(documentTypeName);
});

test('can get media image from delivery api', async ({umbracoApi}) => {
// Arrange
const mediaName = 'TestMedia';
const mediaTypeName = 'File';
await umbracoApi.media.ensureNameNotExists(mediaName);
await umbracoApi.media.ensureNameNotExists(mediaName);
const mediaId = await umbracoApi.media.createDefaultMediaFile(mediaName);
const mediaUrl = await umbracoApi.media.getMediaUrlById(mediaId);

// Assert
expect(await umbracoApi.deliveryApi.doesMediaItemWithIdContainValues(mediaId, mediaName, mediaTypeName, mediaUrl)).toBeTruthy();

// Clean
await umbracoApi.media.ensureNameNotExists(mediaName);
});
28 changes: 28 additions & 0 deletions tests/Umbraco.Tests.AcceptanceTest/tests/DeliveryApi/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// Figure out a better way?
WebApplicationBuilder builder = WebApplication.CreateBuilder(args);

builder.CreateUmbracoBuilder()
.AddBackOffice()
.AddWebsite()
.AddDeliveryApi()
.AddComposers()
.Build();

WebApplication app = builder.Build();

await app.BootUmbracoAsync();


app.UseUmbraco()
.WithMiddleware(u =>
{
u.UseBackOffice();
u.UseWebsite();
})
.WithEndpoints(u =>
{
u.UseBackOfficeEndpoints();
u.UseWebsiteEndpoints();
});

await app.RunAsync();
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
{
"$schema": "appsettings-schema.json",
"Serilog": {
"MinimumLevel": {
"Default": "Information",
"Override": {
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information",
"System": "Warning"
}
},
"WriteTo": [
{
"Name": "Async",
"Args": {
"Configure": [
{
"Name": "Console"
}
]
}
}
]
},
"Umbraco": {
"CMS": {
"DeliveryApi": {
"Enabled": true,
"Media": {
"Enabled": true
}
},
"Unattended": {
"InstallUnattended": true,
"UnattendedUserName": "Playwright Test",
"UnattendedUserEmail": "[email protected]",
"UnattendedUserPassword": "UmbracoAcceptance123!"
},
"Content": {
"ContentVersionCleanupPolicy": {
"EnableCleanup": false
}
},
"Global": {
"DisableElectionForSingleServer": true,
"InstallMissingDatabase": true,
"Id": "00000000-0000-0000-0000-000000000042",
"VersionCheckPeriod": 0,
"UseHttps": true
},
"HealthChecks": {
"Notification": {
"Enabled": false
}
},
"KeepAlive": {
"DisableKeepAliveTask": true
},
"WebRouting": {
"UmbracoApplicationUrl": "https://localhost:44331/"
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// To be able to test different databases, we need to set an additional UnattendedInstallConfig up because we would have to start from scratch, otherwise we would be using the same database.
import {expect} from '@playwright/test';
import {ConstantHelper, test} from '@umbraco/playwright-testhelpers';

const name = 'TestName';
const email = process.env.UMBRACO_USER_LOGIN;
const password = process.env.UMBRACO_USER_PASSWORD;

test('Install Umbraco using SQLServer Express', async ({page, umbracoUi}) => {
test.slow();
// Arrange
await page.goto(process.env.URL + '/umbraco/install');

// Act
await page.getByLabel('name').fill(name);
await page.getByLabel('email').fill(email);
await page.getByLabel('password', {exact: true}).fill(password);
await page.getByLabel('Next').click();
await page.getByLabel('Next').click();
await page.locator('#database-type').locator('#native').selectOption('SQL Server Express LocalDB');
await expect(page.locator('#database-type').locator('option:checked')).toHaveText('SQL Server Express LocalDB')
await page.getByLabel('Install').click();

// Assert
await expect(page.locator('[name="username"]')).toBeVisible({timeout: 60000});
await page.locator('[name="username"]').fill(email);
await page.getByLabel('Password').fill(password);
await page.getByLabel('Login').click();
await umbracoUi.content.goToSection(ConstantHelper.sections.content);
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// To be able to test different databases, we need to set an additional UnattendedInstallConfig up because we would have to start from scratch, otherwise we would be using the same database.
import {expect} from '@playwright/test';
import {ConstantHelper, test} from '@umbraco/playwright-testhelpers';

const name = 'TestName';
const email = process.env.UMBRACO_USER_LOGIN;
const password = process.env.UMBRACO_USER_PASSWORD;

test('Install Umbraco using SQLite', async ({page, umbracoUi}) => {
test.slow();
// Arrange
await page.goto(process.env.URL + '/umbraco/install');

// Act
await page.getByLabel('name').fill(name);
await page.getByLabel('email').fill(email);
await page.getByLabel('password', {exact: true}).fill(password);
await page.getByLabel('Next').click();
await page.getByLabel('Next').click();
await expect(page.locator('#database-type').locator('option:checked')).toHaveText('SQLite')
await page.getByLabel('Install').click();

// Assert
await expect(page.locator('[name="username"]')).toBeVisible({timeout: 60000});
await page.locator('[name="username"]').fill(email);
await page.getByLabel('Password').fill(password);
await page.getByLabel('Login').click();
await umbracoUi.content.goToSection(ConstantHelper.sections.content);
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{
"$schema": "appsettings-schema.json",
"Serilog": {
"MinimumLevel": {
"Default": "Information",
"Override": {
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information",
"System": "Warning"
}
},
"WriteTo": [
{
"Name": "Async",
"Args": {
"Configure": [
{
"Name": "Console"
}
]
}
}
]
},
"Umbraco": {
"CMS": {
"Unattended": {
"InstallUnattended": false
},
"Content": {
"ContentVersionCleanupPolicy": {
"EnableCleanup": false
}
},
"Global": {
"DisableElectionForSingleServer": true,
"Id": "00000000-0000-0000-0000-000000000042",
"VersionCheckPeriod": 0,
"UseHttps": true
},
"HealthChecks": {
"Notification": {
"Enabled": false
}
},
"KeepAlive": {
"DisableKeepAliveTask": true
},
"WebRouting": {
"UmbracoApplicationUrl": "https://localhost:44331/"
}
}
}
}
Loading