-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
andr317c
wants to merge
74
commits into
v15/dev
Choose a base branch
from
v15/QA/acceptance-tests-with-appsettings
base: v15/dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 64 commits
Commits
Show all changes
74 commits
Select commit
Hold shift + click to select a range
5e78a00
Start of appsetting
andr317c 8830c22
Updated setup of playwright
andr317c 59d0545
Adjusted the pipeline
andr317c da86e2c
Updated appsetting
andr317c aaffe15
Added install test
andr317c 75cf638
Added comments
andr317c 442a5bd
Updated pipeline
andr317c 1998581
Updated development app settings
andr317c af2f12c
Commented tests out
andr317c f9452e0
comment
andr317c c22d16a
Added if statement
andr317c c19e47a
Merge remote-tracking branch 'origin/v15/dev' into v15/QA/acceptance-…
andr317c f1bd902
Updated pipeline
andr317c 736efcc
Fixed condition
andr317c 6ccd27e
Changed to production
andr317c 0fb19af
Added a log
andr317c ac2686d
Updated copy item
andr317c 8a4f931
Added
andr317c ddd46be
Updated app settings
andr317c b39fe0f
Updated pipeline
andr317c 8469d6c
Moved playwright login
andr317c 6683c1c
Updated pipeline
andr317c b2031aa
Updated app setting
andr317c 3cf1174
Updated nightly
andr317c 7a6a1ab
Updated appsettings
andr317c c736691
Updated get
andr317c a840774
Updated wait on
andr317c f5d771e
Updated appsettings
andr317c 7c10dca
Updated connection string
andr317c 3631058
Updates
andr317c 75568e2
Skips code
andr317c 4381770
Updated variable
andr317c 84ff53a
Merge remote-tracking branch 'origin/v15/dev' into v15/QA/acceptance-…
andr317c 0d93f36
Updated pipeline
andr317c b081226
We want to always retain the trace, to see if the test runs as expect…
andr317c b940877
Added a temporary wait till port is open
andr317c 5cbad91
Fixed condition
andr317c 4c45311
Added missing tcp for wait on
andr317c 8536ac7
Updated URL env
andr317c 4d7e80e
Updated setup
andr317c 8508e5a
Fixed string
andr317c fcffa51
Updated locator
andr317c dcf9d36
Split tests into SQLite and SQLServer
andr317c e6f3b19
Updated pipeline to run all tests
andr317c 6a8b69d
Retain trace on failure
andr317c 3c435c3
Added testFolder var
andr317c 6417869
Merge remote-tracking branch 'origin/v15/dev' into v15/QA/acceptance-…
andr317c 142e4e9
Added appsettings and program for delivery api tests
andr317c a41ba51
Updated playwright config
andr317c 6c959a4
Split test runners into defaultconfig and different app settings
andr317c a6bd1c5
Added delivery api tests
andr317c 3add0ac
Cleaned up tests
andr317c d063c0b
Bumped version
andr317c 4a1a269
Updated pipeline
andr317c 68294f4
Small fixes
andr317c b63a8f1
Added password
andr317c 256bd52
Updated connection string
andr317c f66fd0b
Fixed
andr317c b388f8b
Removed quotes
andr317c a35ddd7
Removed unnecessary connection string
andr317c a8792aa
Added missing password
andr317c 9d08f45
Cleaned up
andr317c bace5dd
Merge remote-tracking branch 'origin/v15/dev' into v15/QA/acceptance-…
andr317c cfc64a0
Cleaned up
andr317c 0db3595
Cleaned up
andr317c 7df879c
Updated to use helpers
andr317c 2069501
Bumped version
andr317c 20d2442
Updated helper usage
andr317c bb45448
Added password to variables and a condition
andr317c 33f7dcf
Added check
andr317c 5bcd29d
Indented value
andr317c 4023945
Fixed condition
andr317c 4db4f14
More updates
andr317c cf1a22b
Updated variable
andr317c File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 58 additions & 1 deletion
59
tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/appsettings.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/" | ||
} | ||
} | ||
} | ||
} |
43 changes: 43 additions & 0 deletions
43
tests/Umbraco.Tests.AcceptanceTest/tests/DeliveryApi/DeliveryApi.spec.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
28
tests/Umbraco.Tests.AcceptanceTest/tests/DeliveryApi/Program.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// Figure out a better way? | ||
andr317c marked this conversation as resolved.
Show resolved
Hide resolved
|
||
WebApplicationBuilder builder = WebApplication.CreateBuilder(args); | ||
|
||
builder.CreateUmbracoBuilder() | ||
andr317c marked this conversation as resolved.
Show resolved
Hide resolved
|
||
.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(); |
64 changes: 64 additions & 0 deletions
64
tests/Umbraco.Tests.AcceptanceTest/tests/DeliveryApi/appsettings.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/" | ||
} | ||
} | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
...braco.Tests.AcceptanceTest/tests/UnattendedInstallConfig/Install/InstallSQLServer.spec.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'); | ||
andr317c marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
// 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); | ||
}); |
29 changes: 29 additions & 0 deletions
29
.../Umbraco.Tests.AcceptanceTest/tests/UnattendedInstallConfig/Install/InstallSQLite.spec.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'); | ||
andr317c marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
// 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); | ||
}); |
54 changes: 54 additions & 0 deletions
54
tests/Umbraco.Tests.AcceptanceTest/tests/UnattendedInstallConfig/appsettings.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/" | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.