Skip to content

Commit

Permalink
Remove skip form install app tests (#5135)
Browse files Browse the repository at this point in the history
* remove skip form instal app tests

* add project to playwright config

* update e2e commands and add changes to workflow

* add apps test for run tests on crone workflow

* testing workflow

* typo

* add empty line

* add test workflow

* restore grep for command

* add on push option to test workflow

* remove test workflow

* remove additional empty line
  • Loading branch information
szczecha authored and Cloud11PL committed Sep 4, 2024
1 parent ece769a commit f1b06f8
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 21 deletions.
5 changes: 5 additions & 0 deletions .changeset/silent-dodos-count.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"saleor-dashboard": patch
---

Remove skip from installing app tests and update workflow to run it only on releases or manual
7 changes: 6 additions & 1 deletion .github/actions/run-pw-tests/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ inputs:
PW_RETRIES:
description: "Playwright retries"
required: true
PROJECT:
description: "Project name form playwright config"
required: false
default: "e2e"

runs:
using: "composite"
Expand Down Expand Up @@ -63,7 +67,8 @@ runs:
URL_TO_RUN: ${{ inputs.URL_TO_RUN }}
WORKERS: ${{ inputs.PW_WORKERS }}
RETRIES: ${{ inputs.PW_RETRIES }}
run: npm run qa:pw-e2e -- --shard "$SHARD_NUMBER"
PROJECT: ${{ inputs.PROJECT }}
run: npx playwright test --grep @e2e --project="$PROJECT" --shard "$SHARD_NUMBER"

- name: Upload blob report to GitHub Actions Artifacts
uses: actions/upload-artifact@v3
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/run-test-cron.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ jobs:
PW_WORKERS: ${{ vars.PW_WORKERS }}
PW_RETRIES: ${{ vars.PW_RETRIES }}
URL_TO_RUN: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
PROJECT: "e2e apps-e2e"

- name: submit-results-to-testmo
if: always()
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/run-test-manual.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ jobs:
PW_WORKERS: ${{ vars.PW_WORKERS }}
PW_RETRIES: ${{ vars.PW_RETRIES }}
URL_TO_RUN: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
PROJECT: "e2e apps-e2e"

- name: submit-results-to-testmo
if: always()
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/run-tests-on-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,8 @@ jobs:
MAILPITURL: ${{ secrets.MAILPITURL }}
URL_TO_RUN: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
PW_WORKERS: ${{ vars.PW_WORKERS }}
PW_RETRIES: ${{ vars.PW_RETRIES }}
PW_RETRIES: ${{ vars.PW_RETRIES }}
PROJECT: "e2e apps-e2e"

- name: submit-results-to-testmo
if: always()
Expand Down Expand Up @@ -318,4 +319,4 @@ jobs:
CONCLUSION: "failure"
TITLE: "Automation tests run"
SUMMARY: "Run failed"
DETAILS_URL: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
DETAILS_URL: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
39 changes: 23 additions & 16 deletions playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,21 @@ export default defineConfig({
workers: parseInt(env.WORKERS || DEFAULT_WORKERS),
reporter: process.env.CI
? [
["blob"],
["github"],
[
"playwright-testmo-reporter",
{
outputFile: "testmo/testmo.xml", // Optional: Output file path. Defaults to 'testmo.xml'.
embedBrowserType: true, // Optional: Embed browser type in the XML file. Defaults to false.
embedTestSteps: true, // Optional: Embed test steps in the XML file. Defaults to true.
testStepCategories: ["hook", "expect", "pw:api", "test.step"], // Optional: Test step categories to include in the XML file. Defaults to ["hook","expect","pw:api","test.step"]. Possible options are "hook", "expect", "pw:api", "test.step".
testTitleDepth: 1, // Optional: Test case title depth to report in the XML file. Defaults to 1. Increase this to 2 include suite name. Increase this even further to include the path.
attachmentBasePathCallback: () =>
process.env.URL_TO_RUN ? process.env.URL_TO_RUN : "",
},
],
]
["blob"],
["github"],
[
"playwright-testmo-reporter",
{
outputFile: "testmo/testmo.xml", // Optional: Output file path. Defaults to 'testmo.xml'.
embedBrowserType: true, // Optional: Embed browser type in the XML file. Defaults to false.
embedTestSteps: true, // Optional: Embed test steps in the XML file. Defaults to true.
testStepCategories: ["hook", "expect", "pw:api", "test.step"], // Optional: Test step categories to include in the XML file. Defaults to ["hook","expect","pw:api","test.step"]. Possible options are "hook", "expect", "pw:api", "test.step".
testTitleDepth: 1, // Optional: Test case title depth to report in the XML file. Defaults to 1. Increase this to 2 include suite name. Increase this even further to include the path.
attachmentBasePathCallback: () =>
process.env.URL_TO_RUN ? process.env.URL_TO_RUN : "",
},
],
]
: [["html"], ["list"]],
expect: { timeout: 5000 },
maxFailures: 10,
Expand All @@ -48,9 +48,16 @@ export default defineConfig({
testMatch: /.*\.setup\.ts/,
},
{
name: "chromium",
name: "e2e",
dependencies: ["setup"],
use: { ...devices["Desktop Chrome"] },
testIgnore: "playwright/tests/apps.spec.ts"
},
{
name: "apps-e2e",
dependencies: ["setup"],
use: { ...devices["Desktop Chrome"] },
testMatch: "playwright/tests/apps.spec.ts",
},
],
});
4 changes: 2 additions & 2 deletions playwright/tests/apps.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ test.beforeEach(({ page }) => {
installationPage = new AppInstallationPage(page);
appPage = new AppPage(page);
});
// Adding temporary skip https://linear.app/saleor/issue/QAG-94/remove-skip-from-app-tests
test.skip("TC: SALEOR_119 User should be able to install and configure app from manifest @e2e", async ({

test("TC: SALEOR_119 User should be able to install and configure app from manifest @e2e", async ({
page,
}) => {
await appsPage.gotoAppsList();
Expand Down

0 comments on commit f1b06f8

Please sign in to comment.