Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
8d2e6e0
Added initial acceptance test project
nhudinh0309 Feb 5, 2026
9f3ad45
Updated gitingore
nhudinh0309 Feb 5, 2026
784f400
Removed unused tests
nhudinh0309 Feb 9, 2026
7355813
Added ui helper for search page
nhudinh0309 Feb 9, 2026
df28005
Added tests for full-text search
nhudinh0309 Feb 9, 2026
604069d
Added tests for searching facets
nhudinh0309 Feb 9, 2026
5f0b7f1
Added tests for pagination
nhudinh0309 Feb 9, 2026
6a56211
Added tests for sorting search result
nhudinh0309 Feb 9, 2026
983bdd0
Added steps to run acceptance tests in the pipeline
nhudinh0309 Feb 9, 2026
524b878
Added acceptance test in .sln
nhudinh0309 Feb 9, 2026
25bf83d
Setup pipeline for E2E tests
nhudinh0309 Feb 9, 2026
c2a7499
Merge branch 'main' into qa/add-acceptance-test
nhudinh0309 Feb 9, 2026
673356c
Cleaned up
nhudinh0309 Feb 9, 2026
b2c1f0d
Skip interactive configuration when running CI
nhudinh0309 Feb 10, 2026
8874bce
Added checkout step before downloading artifacts
nhudinh0309 Feb 10, 2026
067d2de
Added uSync environment variables to enable auto-import at startup an…
nhudinh0309 Feb 10, 2026
b3cec00
Fixed uSync
nhudinh0309 Feb 10, 2026
51a3c55
Added a step to create the npm cache directory before the cache task …
nhudinh0309 Feb 10, 2026
f5a2b52
Added the list reporter alongside junit for CI
nhudinh0309 Feb 10, 2026
21653b4
Added "Generate .env" step after "Use Node.js" and removed the old "C…
nhudinh0309 Feb 10, 2026
363a11d
Fixed
nhudinh0309 Feb 11, 2026
bb2ed67
Merge remote-tracking branch 'origin/main' into qa/add-acceptance-test
nhudinh0309 Feb 11, 2026
b585480
Updated yaml file
nhudinh0309 Feb 11, 2026
5e1980a
Cleanup testSiteUrl variables
nhudinh0309 Feb 11, 2026
187c0ec
Refactor yaml file
nhudinh0309 Feb 12, 2026
a838365
Removed smoke tags
nhudinh0309 Feb 12, 2026
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
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -453,3 +453,8 @@ $RECYCLE.BIN/
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json

##
## GitHub
##
.github/
192 changes: 191 additions & 1 deletion build/azure-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ stages:
steps:
- checkout: self
submodules: false
lfs: false,
lfs: false
fetchDepth: 1
fetchFilter: tree:0

Expand Down Expand Up @@ -260,6 +260,196 @@ stages:
displayName: Stop SQL Server LocalDB (Windows)
condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'))

- stage: E2E
displayName: E2E Tests
dependsOn: Build
variables:
npm_config_cache_e2e: $(Pipeline.Workspace)/.npm_e2e
# Enable console logging in Release mode
SERILOG__WRITETO__0__NAME: Async
SERILOG__WRITETO__0__ARGS__CONFIGURE__0__NAME: Console
# Set unattended install settings
UMBRACO__CMS__UNATTENDED__INSTALLUNATTENDED: true
UMBRACO__CMS__UNATTENDED__UNATTENDEDUSERNAME: Playwright Test
UMBRACO__CMS__UNATTENDED__UNATTENDEDUSERPASSWORD: UmbracoAcceptance123!
UMBRACO__CMS__UNATTENDED__UNATTENDEDUSEREMAIL: playwright@umbraco.com
# Custom Umbraco settings
UMBRACO__CMS__CONTENT__CONTENTVERSIONCLEANUPPOLICY__ENABLECLEANUP: false
UMBRACO__CMS__GLOBAL__DISABLEELECTIONFORSINGLESERVER: true
UMBRACO__CMS__GLOBAL__INSTALLMISSINGDATABASE: true
UMBRACO__CMS__GLOBAL__ID: 00000000-0000-0000-0000-000000000042
UMBRACO__CMS__GLOBAL__VERSIONCHECKPERIOD: 0
UMBRACO__CMS__GLOBAL__USEHTTPS: true
UMBRACO__CMS__HEALTHCHECKS__NOTIFICATION__ENABLED: false
UMBRACO__CMS__KEEPALIVE__DISABLEKEEPALIVETASK: true
UMBRACO__CMS__WEBROUTING__UMBRACOAPPLICATIONURL: https://localhost:44324/
ASPNETCORE_URLS: https://localhost:44324
jobs:
- job:
displayName: E2E Tests (SQLite)
pool:
vmImage: 'ubuntu-latest'
timeoutInMinutes: 30

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we have a timeout?

variables:
CONNECTIONSTRINGS__UMBRACODBDSN: "Data Source=|DataDirectory|/Umbraco.sqlite.db;Cache=Shared;Foreign Keys=True;Pooling=True"
CONNECTIONSTRINGS__UMBRACODBDSN_PROVIDERNAME: Microsoft.Data.Sqlite
steps:
# Checkout source (full clone for Nerdbank.GitVersioning)
- checkout: self
fetchDepth: 0

# Setup environment
- task: DownloadPipelineArtifact@2
displayName: Download NuGet artifacts
inputs:
artifact: build_output
path: $(Build.SourcesDirectory)

- task: UseDotNet@2
displayName: Use .NET SDK from global.json
inputs:
useGlobalJson: true

- task: NodeTool@0
displayName: Use Node.js
inputs:
versionSpec: '22.x'

- pwsh: |
"UMBRACO_USER_LOGIN=$(UMBRACO__CMS__UNATTENDED__UNATTENDEDUSEREMAIL)
UMBRACO_USER_PASSWORD=$(UMBRACO__CMS__UNATTENDED__UNATTENDEDUSERPASSWORD)
URL=$(ASPNETCORE_URLS)" | Out-File .env
displayName: Generate .env
workingDirectory: $(Build.SourcesDirectory)/src/Umbraco.Test.Search.AcceptanceTest

# Cache NPM packages
- script: mkdir -p $(npm_config_cache_e2e)
displayName: Create NPM cache directory

- task: Cache@2
displayName: Cache NPM packages
inputs:
key: '"npm_e2e" | "$(Agent.OS)" | src/Umbraco.Test.Search.AcceptanceTest/package-lock.json'
restoreKeys: |
"npm_e2e" | "$(Agent.OS)"
"npm_e2e"
path: $(npm_config_cache_e2e)

# Restore NPM packages
- script: npm ci --no-fund --no-audit --prefer-offline
displayName: Restore NPM packages
workingDirectory: src/Umbraco.Test.Search.AcceptanceTest

- script: npx playwright install --with-deps chromium
displayName: Install Playwright browsers
workingDirectory: src/Umbraco.Test.Search.AcceptanceTest

# Generate HTTPS dev certificate
- script: dotnet dev-certs https --trust
displayName: Generate HTTPS dev certificate
continueOnError: true

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this needed?


# Publish and run the test site
- script: dotnet publish src/Umbraco.Web.TestSite.V17/Umbraco.Web.TestSite.V17.csproj --configuration $(buildConfiguration) --output $(Build.ArtifactStagingDirectory)/testsite

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this step not only publish it? It does not run anything

displayName: Publish test site

# Copy _uSync as sibling of testsite to match Development config path "../_uSync/Shared/"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is meant with "as sibling of testsite"? Is it Copy uSync to be in the same path as the testsite?

- script: |
echo "=== Copying uSync data ==="
cp -r $(Build.SourcesDirectory)/src/_uSync $(Build.ArtifactStagingDirectory)/
echo "=== Verifying folder structure ==="
ls -la $(Build.ArtifactStagingDirectory)/
echo "=== uSync folder contents ==="
find $(Build.ArtifactStagingDirectory)/_uSync -type f | head -20
displayName: Copy uSync data

- script: |
cd $(Build.ArtifactStagingDirectory)/testsite
echo "=== Environment ==="
echo "ASPNETCORE_ENVIRONMENT=$ASPNETCORE_ENVIRONMENT"
echo "Working directory: $(pwd)"
echo "=== Verifying uSync path ==="
ls -la ../_uSync/Shared/ || echo "uSync folder not found at ../_uSync/Shared/"
echo "=== Starting test site ==="
nohup dotnet Umbraco.Web.TestSite.V17.dll --urls="$(ASPNETCORE_URLS)" > testsite.log 2>&1 &
echo $! > testsite.pid
echo "Test site started with PID $(cat testsite.pid)"
displayName: Start test site
env:
ASPNETCORE_ENVIRONMENT: Development
ASPNETCORE_URLS: $(ASPNETCORE_URLS)
UMBRACO__CMS__UNATTENDED__INSTALLUNATTENDED: $(UMBRACO__CMS__UNATTENDED__INSTALLUNATTENDED)
UMBRACO__CMS__UNATTENDED__UNATTENDEDUSERNAME: $(UMBRACO__CMS__UNATTENDED__UNATTENDEDUSERNAME)
UMBRACO__CMS__UNATTENDED__UNATTENDEDUSERPASSWORD: $(UMBRACO__CMS__UNATTENDED__UNATTENDEDUSERPASSWORD)
UMBRACO__CMS__UNATTENDED__UNATTENDEDUSEREMAIL: $(UMBRACO__CMS__UNATTENDED__UNATTENDEDUSEREMAIL)
UMBRACO__CMS__GLOBAL__INSTALLMISSINGDATABASE: $(UMBRACO__CMS__GLOBAL__INSTALLMISSINGDATABASE)
UMBRACO__CMS__GLOBAL__USEHTTPS: $(UMBRACO__CMS__GLOBAL__USEHTTPS)
UMBRACO__CMS__GLOBAL__DISABLEELECTIONFORSINGLESERVER: $(UMBRACO__CMS__GLOBAL__DISABLEELECTIONFORSINGLESERVER)
UMBRACO__CMS__GLOBAL__VERSIONCHECKPERIOD: $(UMBRACO__CMS__GLOBAL__VERSIONCHECKPERIOD)
UMBRACO__CMS__CONTENT__CONTENTVERSIONCLEANUPPOLICY__ENABLECLEANUP: $(UMBRACO__CMS__CONTENT__CONTENTVERSIONCLEANUPPOLICY__ENABLECLEANUP)
UMBRACO__CMS__HEALTHCHECKS__NOTIFICATION__ENABLED: $(UMBRACO__CMS__HEALTHCHECKS__NOTIFICATION__ENABLED)
UMBRACO__CMS__KEEPALIVE__DISABLEKEEPALIVETASK: $(UMBRACO__CMS__KEEPALIVE__DISABLEKEEPALIVETASK)
CONNECTIONSTRINGS__UMBRACODBDSN: $(CONNECTIONSTRINGS__UMBRACODBDSN)
CONNECTIONSTRINGS__UMBRACODBDSN_PROVIDERNAME: $(CONNECTIONSTRINGS__UMBRACODBDSN_PROVIDERNAME)

- script: |
echo "Waiting for test site to be ready..."
for i in {1..60}; do
if curl -k -s -o /dev/null -w "%{http_code}" $(ASPNETCORE_URLS) | grep -q "200\|301\|302"; then
echo "Test site is ready!"
echo "=== Last 50 lines of testsite.log ==="
tail -50 $(Build.ArtifactStagingDirectory)/testsite/testsite.log || true
echo "=== Checking for uSync messages ==="
grep -i "usync" $(Build.ArtifactStagingDirectory)/testsite/testsite.log || echo "No uSync messages found"
exit 0
fi
echo "Attempt $i: Test site not ready yet, waiting..."
sleep 5
done
echo "Test site failed to start"
echo "=== Full testsite.log ==="
cat $(Build.ArtifactStagingDirectory)/testsite/testsite.log
exit 1
displayName: Wait for test site to be ready

# Install Playwright and dependencies
- pwsh: npx playwright install chromium
displayName: Install Playwright only with Chromium browser
workingDirectory: src/Umbraco.Test.Search.AcceptanceTest
Comment on lines +415 to +418

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We also install playwright at line 343


# Run acceptance tests
- script: npm run test
displayName: Run Playwright tests
workingDirectory: src/Umbraco.Test.Search.AcceptanceTest
env:
CI: true

# Publish test artifacts
- task: PublishPipelineArtifact@1
displayName: Publish test artifacts
condition: succeededOrFailed()
inputs:
targetPath: src/Umbraco.Test.Search.AcceptanceTest/results
artifactName: acceptance-test-results

# Publish test results
- task: PublishTestResults@2
displayName: Publish test results
condition: succeededOrFailed()
inputs:
testResultsFormat: 'JUnit'
testResultsFiles: 'src/Umbraco.Test.Search.AcceptanceTest/results/results.xml'
testRunTitle: 'Acceptance Test Results'
failTaskOnFailedTests: true

# Stop test site
- script: |
if [ -f $(Build.ArtifactStagingDirectory)/testsite/testsite.pid ]; then
kill $(cat $(Build.ArtifactStagingDirectory)/testsite/testsite.pid) || true
fi
displayName: Stop test site
condition: always()

- stage: Dependency_Track
displayName: Dependency Track
dependsOn:
Expand Down
2 changes: 2 additions & 0 deletions src/Umbraco.Cms.Search.sln
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Umbraco.Web.TestSite.V17",
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Umbraco.Cms.Search.Core.Client", "Umbraco.Cms.Search.Core.Client\Umbraco.Cms.Search.Core.Client.csproj", "{31BEFBC0-089B-46B8-973B-AB54457D4A83}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Umbraco.Test.Search.AcceptanceTest", "Umbraco.Test.Search.AcceptanceTest", "{A1B2C3D4-E5F6-7890-ABCD-EF1234567890}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down
5 changes: 5 additions & 0 deletions src/Umbraco.Test.Search.AcceptanceTest/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
UMBRACO_USER_LOGIN=admin@example.com
UMBRACO_USER_PASSWORD=your-password-here
URL=https://localhost:44324
STORAGE_STATE_PATH=playwright/.auth/user.json
CONSOLE_ERRORS_PATH=console-errors.json
21 changes: 21 additions & 0 deletions src/Umbraco.Test.Search.AcceptanceTest/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Dependencies
node_modules/

# Environment
.env

# Playwright
playwright/.auth/
results/
test-results/

# Build
dist/

# IDE
.idea/
.vscode/

# OS
.DS_Store
Thumbs.db
Loading
Loading