* Remove Linux only Docker build for E2E tests
* Fix cmsVersion variable
* Remove custom build number step (already done by Nerdbank.GitVersioning)
* Add and use global.json to configure .NET SDK version
* Only publish tests build output
* Only include unit tests and integration build output (without reference assemblies)
* Added "pr: none" to nightly trigger (#15044)
* Only run SQL Server Acceptance Tests on release builds or when parameter is set
* Use SQLite in-memory database and configure database optimizations (#15461)
* Disable content version cleanup and server election
* Reference Umbraco.Tests.AcceptanceTest.UmbracoProject instead of copying files
* Suspend/disable scheduled publishing
* Ensure all Playwright results are copied to the artifact staging directory
* Update E2E SQL Server job and also run on Linux
* Fix building acceptance test project
* Fix building acceptance test project (suing PrivateAssets)
* Explicitly disable building project references in E2E tests and use pre-built output
* Include obj folder of acceptance test project in build artifacts
* Download build artifacts
* Re-add PrivateAssets
* Revert to copying C# files to E2E application
* Disable Integrated Security for SQL Server on Linux
* Update SQL Server on Linux connection string
* Disable encryption on SQL Server for Linux
* Update SQL Server on Linux steps
* Add Database to SQL Server connection string on Linux
* Update Integration Tests and use SQL Server 2022 Docker image
---------
Co-authored-by: Bjarke Berg <mail@bergmania.dk>
(cherry picked from commit 0e1ca76d6e)
Umbraco Acceptance Tests
You can watch a video following these instructions here and a longer UmbraCollab recording here. Make sure to use the latest recommended contribution branch rather than v10 that's mentioned in the video. Alternatively, follow along the instructions below.
Prerequisites
- NodeJS 16+
- A running installed Umbraco on url: https://localhost:44331 (Default development port)
- Install using a
SqlServer/LocalDbas the tests execute too fast forSqliteto handle.
- Install using a
Getting started
The tests are located in the project/folder as Umbraco.Tests.AcceptanceTests. Make sure you run npm ci & npx playwright install in that folder, or let your IDE do that.
The script will ask you to enter the username and password for a superadmin user of your Umbraco CMS.
Executing tests
There are two npm scripts that can be used to execute the test:
npm run test- Executes the tests headless.
npm run ui- Executes the tests in a browser handled by a playwright application.
In case of errors it is recommended to use await page.pause() so you can step through your test.
Executing single tests
If you wish to run a single test, which may be helpful when writing tests you can use the following command. As before, you need to run these tests in the 'tests/Umbraco.Tests.AcceptanceTest' folder.
npx playwright test <testname.ts>
For example to run the Login Test,
npx playwright test tests/DefaultConfig/Login/Login.spec.ts
Environment Configuration
The environment configuration is begin setup by the npm installation script.
This results in the creation of this file: .env.
This file is already added to .gitignore and can contain values that are different for each developer machine.
The file has the following content:
UMBRACO_USER_LOGIN=email for superadmin
UMBRACO_USER_PASSWORD=password for superadmin
URL=https://localhost:44331
You can change this if you like or run the config script to reset the values, type "npm run config" in your terminal.
Documentation
For further documentation on Playwright, see the Playwright documentation.