-
Notifications
You must be signed in to change notification settings - Fork 2
E2E: QA Added Umbraco.Test.Search.AcceptanceTest project with initial acceptance tests #70
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
base: main
Are you sure you want to change the base?
Changes from all commits
8d2e6e0
9f3ad45
784f400
7355813
df28005
604069d
5f0b7f1
6a56211
983bdd0
524b878
25bf83d
c2a7499
673356c
b2c1f0d
8874bce
067d2de
b3cec00
51a3c55
f5a2b52
21653b4
363a11d
bb2ed67
b585480
5e1980a
187c0ec
a838365
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -453,3 +453,8 @@ $RECYCLE.BIN/ | |
| !.vscode/tasks.json | ||
| !.vscode/launch.json | ||
| !.vscode/extensions.json | ||
|
|
||
| ## | ||
| ## GitHub | ||
| ## | ||
| .github/ | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -148,7 +148,7 @@ stages: | |
| steps: | ||
| - checkout: self | ||
| submodules: false | ||
| lfs: false, | ||
| lfs: false | ||
| fetchDepth: 1 | ||
| fetchFilter: tree:0 | ||
|
|
||
|
|
@@ -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 | ||
| 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 | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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/" | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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: | ||
|
|
||
| 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 |
| 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 |
There was a problem hiding this comment.
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?