From 89c5ef958259c9a4013e077590cc8fd22280f3b7 Mon Sep 17 00:00:00 2001 From: Zeegaan Date: Fri, 30 Sep 2022 12:01:54 +0200 Subject: [PATCH 1/8] Update yml to use powershell to check folder --- build/azure-pipelines.yml | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/build/azure-pipelines.yml b/build/azure-pipelines.yml index f83492a35f..89f3573f56 100644 --- a/build/azure-pipelines.yml +++ b/build/azure-pipelines.yml @@ -363,6 +363,8 @@ stages: value: Server=$(UmbracoDatabaseServer);Database=$(UmbracoDatabaseName);Integrated Security=true; - name: PLAYWRIGHT_BASE_URL value: https://localhost:8443 + - name: ACCEPTANCE_TEST_FOLDER_EXISTS + value: false strategy: matrix: Linux: @@ -468,19 +470,28 @@ stages: targetType: inline workingDirectory: tests/Umbraco.Tests.AcceptanceTest script: 'npm run test --ignore-certificate-errors' - - bash: | - if [ -f $(Build.SourcesDirectory)/tests/Umbraco.Tests.AcceptanceTest/results/ ]; then - echo "##vso[task.setVariable variable=myfileexists]true" - fi + - task: PowerShell@2 + displayName: Check if artifacts folder exists + inputs: + targetType: inline + script: | + $MyVariable = Test-Path -Path $(Build.SourcesDirectory)/tests/Umbraco.Tests.AcceptanceTest/results + Write-Host "##vso[task.setvariable variable=myVar;]$MyVariable" + - task: Powershell@2 + displayName: Echo myVar + inputs: + targetType: inline + script: | + echo variables.myVar - task: CopyFiles@2 displayName: Prepare artifacts - condition: eq(variables.myfileexists, 'true') + condition: eq(variables.myVar, 'true') inputs: sourceFolder: $(Build.SourcesDirectory)/tests/Umbraco.Tests.AcceptanceTest/results/ targetFolder: $(Build.ArtifactStagingDirectory)/playwright - task: PublishPipelineArtifact@1 displayName: "Publish test artifacts" - condition: eq(variables.myfileexists, 'true') + condition: eq(variables.myVar, 'true') inputs: targetPath: $(Build.ArtifactStagingDirectory) artifact: 'E2E artifacts - $(Agent.OS) - Attempt #$(System.JobAttempt)' From 74a2dd88c34fff009b5b938d241709174d040644 Mon Sep 17 00:00:00 2001 From: Zeegaan Date: Fri, 30 Sep 2022 12:03:05 +0200 Subject: [PATCH 2/8] Add failing test --- .../tests/DefaultConfig/Users/users.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Users/users.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Users/users.spec.ts index 69c8021d72..109a93bbb1 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Users/users.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Users/users.spec.ts @@ -59,7 +59,7 @@ test.describe('Users', () => { await page.locator('.umb-button > .btn > .umb-button__content').click(); // Assert - await expect(await umbracoUi.getButtonByLabelKey("user_goToProfile")).toBeVisible(); + await expect(await umbracoUi.getButtonByLabelKey("user_goToProfile")).not.toBeVisible(); }); test('Update user', async ({umbracoUi, umbracoApi, page}) => { From cde1a27ff4f234dcf9c08c0e74a50ed43cbf9f4b Mon Sep 17 00:00:00 2001 From: Zeegaan Date: Fri, 30 Sep 2022 13:37:38 +0200 Subject: [PATCH 3/8] Add proper failing test --- .../tests/DefaultConfig/Users/users.spec.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Users/users.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Users/users.spec.ts index 109a93bbb1..3c8ebca1bf 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Users/users.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Users/users.spec.ts @@ -59,7 +59,7 @@ test.describe('Users', () => { await page.locator('.umb-button > .btn > .umb-button__content').click(); // Assert - await expect(await umbracoUi.getButtonByLabelKey("user_goToProfile")).not.toBeVisible(); + await expect(await umbracoUi.getButtonByLabelKey("user_goToProfile")).toBeVisible(); }); test('Update user', async ({umbracoUi, umbracoApi, page}) => { @@ -94,6 +94,6 @@ test.describe('Users', () => { await page.locator('umb-button[label="Yes, delete"]').click(); // Assert deletion succeeds - await umbracoUi.isSuccessNotificationVisible(); + await umbracoUi.isErrorNotificationVisible(); }); }); \ No newline at end of file From f0fe5261f2ea64105b033114d90da389203bd245 Mon Sep 17 00:00:00 2001 From: Zeegaan Date: Fri, 30 Sep 2022 13:38:14 +0200 Subject: [PATCH 4/8] Add echoing --- build/azure-pipelines.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build/azure-pipelines.yml b/build/azure-pipelines.yml index 89f3573f56..29ea2ff73e 100644 --- a/build/azure-pipelines.yml +++ b/build/azure-pipelines.yml @@ -482,16 +482,16 @@ stages: inputs: targetType: inline script: | - echo variables.myVar + echo $variables.myVar - task: CopyFiles@2 displayName: Prepare artifacts - condition: eq(variables.myVar, 'true') + condition: eq(variables.myVar, 'True') inputs: sourceFolder: $(Build.SourcesDirectory)/tests/Umbraco.Tests.AcceptanceTest/results/ targetFolder: $(Build.ArtifactStagingDirectory)/playwright - task: PublishPipelineArtifact@1 displayName: "Publish test artifacts" - condition: eq(variables.myVar, 'true') + condition: eq(variables.myVar, 'True') inputs: targetPath: $(Build.ArtifactStagingDirectory) artifact: 'E2E artifacts - $(Agent.OS) - Attempt #$(System.JobAttempt)' From 212c03605255dd09ca46a7f8ebd95c9d8e18aae4 Mon Sep 17 00:00:00 2001 From: Zeegaan Date: Mon, 3 Oct 2022 07:35:56 +0200 Subject: [PATCH 5/8] Refix user test --- .../tests/DefaultConfig/Users/users.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Users/users.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Users/users.spec.ts index 3c8ebca1bf..69c8021d72 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Users/users.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Users/users.spec.ts @@ -94,6 +94,6 @@ test.describe('Users', () => { await page.locator('umb-button[label="Yes, delete"]').click(); // Assert deletion succeeds - await umbracoUi.isErrorNotificationVisible(); + await umbracoUi.isSuccessNotificationVisible(); }); }); \ No newline at end of file From 2a506320f1210fb436e1fe803729a0b1627c34e9 Mon Sep 17 00:00:00 2001 From: Zeegaan Date: Mon, 3 Oct 2022 07:36:40 +0200 Subject: [PATCH 6/8] Remove echo from build --- build/azure-pipelines.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/build/azure-pipelines.yml b/build/azure-pipelines.yml index 29ea2ff73e..bf15f827e0 100644 --- a/build/azure-pipelines.yml +++ b/build/azure-pipelines.yml @@ -477,12 +477,6 @@ stages: script: | $MyVariable = Test-Path -Path $(Build.SourcesDirectory)/tests/Umbraco.Tests.AcceptanceTest/results Write-Host "##vso[task.setvariable variable=myVar;]$MyVariable" - - task: Powershell@2 - displayName: Echo myVar - inputs: - targetType: inline - script: | - echo $variables.myVar - task: CopyFiles@2 displayName: Prepare artifacts condition: eq(variables.myVar, 'True') From 9e82bc5a4643eddd4b2e703add570485621277e7 Mon Sep 17 00:00:00 2001 From: Zeegaan Date: Mon, 3 Oct 2022 07:37:47 +0200 Subject: [PATCH 7/8] Remove unused pipelines variable --- build/azure-pipelines.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/build/azure-pipelines.yml b/build/azure-pipelines.yml index bf15f827e0..c66e199029 100644 --- a/build/azure-pipelines.yml +++ b/build/azure-pipelines.yml @@ -363,8 +363,6 @@ stages: value: Server=$(UmbracoDatabaseServer);Database=$(UmbracoDatabaseName);Integrated Security=true; - name: PLAYWRIGHT_BASE_URL value: https://localhost:8443 - - name: ACCEPTANCE_TEST_FOLDER_EXISTS - value: false strategy: matrix: Linux: From 6eb57302fb2d4e757755a337b8a035e33bac030b Mon Sep 17 00:00:00 2001 From: Zeegaan Date: Mon, 3 Oct 2022 07:38:49 +0200 Subject: [PATCH 8/8] Give proper variable name --- build/azure-pipelines.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build/azure-pipelines.yml b/build/azure-pipelines.yml index c66e199029..f3d0ce0c1b 100644 --- a/build/azure-pipelines.yml +++ b/build/azure-pipelines.yml @@ -474,16 +474,16 @@ stages: targetType: inline script: | $MyVariable = Test-Path -Path $(Build.SourcesDirectory)/tests/Umbraco.Tests.AcceptanceTest/results - Write-Host "##vso[task.setvariable variable=myVar;]$MyVariable" + Write-Host "##vso[task.setvariable variable=resultFolderExists;]$MyVariable" - task: CopyFiles@2 displayName: Prepare artifacts - condition: eq(variables.myVar, 'True') + condition: eq(variables.resultFolderExists, 'True') inputs: sourceFolder: $(Build.SourcesDirectory)/tests/Umbraco.Tests.AcceptanceTest/results/ targetFolder: $(Build.ArtifactStagingDirectory)/playwright - task: PublishPipelineArtifact@1 displayName: "Publish test artifacts" - condition: eq(variables.myVar, 'True') + condition: eq(variables.resultFolderExists, 'True') inputs: targetPath: $(Build.ArtifactStagingDirectory) artifact: 'E2E artifacts - $(Agent.OS) - Attempt #$(System.JobAttempt)'