Skip to content

Commit ea84b86

Browse files
ZeegaaniOvergaardnikolajlauridsenelit0451andr317c
authored
V11: v10 to v11 (#13205)
* Fix for potential race condition in packages search (#13153) * search on input allowing to wait for copy/paste etc * invoke resourcePromise() with correct parameters * return the xhrStatus allowing the caller to check if the request was aborted * fix: send in canceler.promise to allow the timeout to work * catch any errors and ignore aborts if they happen * move the logic to handle cancellations outside Angulars $scope.$apply * remove file accidentally committed * V10: Fix request accessor memory leak (#13152) * Dispose OnChange event registration when disposing the notification handler * Ensure that the ApplicationUrl is only initialized once Since notifications handlers are transient,_hasAppUrl and _isInit defaults to false on every request causing it to always be called. * Make notification handler and EnsureApplicationUrl internal * Add missing ForceLeft and ForceRight (#13190) * Fix tags with CSV storage type (#13188) * Fixing null check as default(NRT) is null => default(configuration?.Delimiter) is also null and we were counting on it being the same as default(char) * Adding tests to check cases with multiple tags (or tag made of comma separated values) * Add data-element to umb property so we can find it (#13199) Co-authored-by: Zeegaan <[email protected]> * V10/bugfix/create simple package test (#13162) * Fixed assert to hopefully find the package each time so it isnt flaky anymore * Updated so it retries 5 times instead of 2 * Dont submit html-report * Dont have output defined in npm run * Copy over playwright trace.zip files before publishing * Updated assert so it looks after the package in the table * updated so we get the first fail as the trace file * Bumped version for testhelpers * Updated so the test checks if the package actually exists. Added a wait that checks if the created packages button is visible * Updated package lock * Fixed so it now calls the correct testhelper Co-authored-by: Zeegaan <[email protected]> Co-authored-by: Jacob Overgaard <[email protected]> Co-authored-by: Mole <[email protected]> Co-authored-by: Elitsa Marinovska <[email protected]> Co-authored-by: Zeegaan <[email protected]> Co-authored-by: Andreas Zerbst <[email protected]>
1 parent f4280ff commit ea84b86

File tree

5 files changed

+35
-14
lines changed

5 files changed

+35
-14
lines changed

build/azure-pipelines.yml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -441,13 +441,12 @@ stages:
441441
- pwsh: npx playwright install --with-deps
442442
displayName: Install Playwright
443443
workingDirectory: tests/Umbraco.Tests.AcceptanceTest
444-
- pwsh: npm run test --ignore-certificate-errors --output $(Build.ArtifactStagingDirectory)\test-results
444+
- pwsh: npm run test --ignore-certificate-errors
445445
displayName: Run Playwright (Desktop)
446446
continueOnError: true
447447
workingDirectory: tests/Umbraco.Tests.AcceptanceTest
448448
env:
449449
CI: true
450-
PLAYWRIGHT_HTML_REPORT: $(Build.ArtifactStagingDirectory)\playwright-report
451450
- pwsh: |
452451
docker logs $(dockerImageName) > $(Build.ArtifactStagingDirectory)/playwright.log 2>&1
453452
docker stop $(dockerImageName)
@@ -456,13 +455,27 @@ stages:
456455
- pwsh: Stop-Process $env:AcceptanceTestProcessId
457456
condition: eq(variables['Agent.OS'], 'Windows_NT')
458457
displayName: Stop app (Windows only)
458+
- task: PowerShell@2
459+
displayName: Check if artifacts folder exists
460+
inputs:
461+
targetType: inline
462+
script: |
463+
$MyVariable = Test-Path -Path $(Build.SourcesDirectory)/tests/Umbraco.Tests.AcceptanceTest/results
464+
Write-Host "##vso[task.setvariable variable=resultFolderExists;]$MyVariable"
465+
- task: CopyFiles@2
466+
displayName: Prepare artifacts
467+
condition: eq(variables.resultFolderExists, 'True')
468+
inputs:
469+
sourceFolder: $(Build.SourcesDirectory)/tests/Umbraco.Tests.AcceptanceTest/results/
470+
targetFolder: $(Build.ArtifactStagingDirectory)/playwright
459471
- task: PublishPipelineArtifact@1
460472
condition: always()
461473
displayName: Publish test artifacts
462474
inputs:
463475
targetPath: $(Build.ArtifactStagingDirectory)
464476
artifact: 'E2E artifacts - $(Agent.OS) - Attempt #$(System.JobAttempt)'
465477

478+
466479
###############################################
467480
## Release
468481
###############################################

tests/Umbraco.Tests.AcceptanceTest/package-lock.json

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/Umbraco.Tests.AcceptanceTest/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
},
2020
"dependencies": {
2121
"@umbraco/json-models-builders": "^1.0.0",
22-
"@umbraco/playwright-testhelpers": "^1.0.2",
22+
"@umbraco/playwright-testhelpers": "^1.0.3",
2323
"camelize": "^1.0.0",
2424
"faker": "^4.1.0",
2525
"form-data": "^4.0.0",

tests/Umbraco.Tests.AcceptanceTest/playwright.config.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ const config: PlaywrightTestConfig = {
2121
/* Fail the build on CI if you accidentally left test.only in the source code. */
2222
forbidOnly: !!process.env.CI,
2323
/* Retry on CI only */
24-
retries: process.env.CI ? 2 : 5,
24+
retries: process.env.CI ? 5 : 2,
2525
// We don't want to run parallel, as tests might differ in state
2626
workers: 1,
2727
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
28-
reporter: process.env.CI ? 'html' : 'line',
28+
reporter: process.env.CI ? 'line' : 'html',
2929
outputDir : "./results",
3030

3131
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
@@ -36,7 +36,7 @@ const config: PlaywrightTestConfig = {
3636
// baseURL: 'http://localhost:44332',
3737

3838
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
39-
trace: 'on-first-retry',
39+
trace: 'retain-on-failure',
4040
ignoreHTTPSErrors: true,
4141
},
4242

tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Packages/packages.spec.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,17 @@ test.describe('Packages', () => {
8989
// Navigate pack to packages and Assert the file is created
9090
// Waits until the button download is visible
9191
await page.locator('[label-key="general_download"]').isVisible();
92+
// Checks if the packages was created
93+
const doesExist = await umbracoApi.packages.doesNameExist(packageName);
94+
await expect(doesExist).toBe(true);
9295
await umbracoUi.goToSection(ConstantHelper.sections.packages);
96+
97+
// Needs to wait until the page has loaded and the button is clickable
98+
await page.locator('[data-element="sub-view-umbCreatedPackages"]').isVisible();
9399
await page.locator('[data-element="sub-view-umbCreatedPackages"]').click();
94-
await expect(await page.locator("body", {hasText: packageName})).toBeVisible();
100+
// Asserts that the package can be found in the table
101+
await expect(await page.locator('.table-hover')).toHaveCount(1);
102+
await expect(await page.locator('.table-hover').first()).toContainText(packageName);
95103

96104
// Cleanup
97105
await umbracoApi.packages.ensureNameNotExists(packageName);

0 commit comments

Comments
 (0)