Skip to content

Commit

Permalink
Merge branch 'main' into MERX-960-back-btn-pagination
Browse files Browse the repository at this point in the history
  • Loading branch information
poulch authored Oct 11, 2024
2 parents ab9c7c5 + 1535d70 commit 17a2669
Show file tree
Hide file tree
Showing 154 changed files with 3,408 additions and 8,945 deletions.
5 changes: 5 additions & 0 deletions .changeset/fuzzy-impalas-juggle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"saleor-dashboard": patch
---

Now we login accounts before playwright jobs are being started. This means playwright shards only consume account files, skipping the authentication part, it avoids account suspending by the API due to multiple attempnts in the same time
5 changes: 5 additions & 0 deletions .changeset/late-pants-collect.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"saleor-dashboard": minor
---

Always add comment after tests to CORE release PR, even if previous job fails.
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -105,5 +105,5 @@
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-unused-vars": "off"
},
"ignorePatterns": ["node_modules/", "**/types/**/*", "type-policies.ts"]
"ignorePatterns": ["node_modules/", "**/types/**/*", "type-policies.ts", "playwright/auth.js"]
}
2 changes: 1 addition & 1 deletion .featureFlags/discounts-rules.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
name: discounts_rules
displayName: Discounts rules
enabled: false
enabled: true
payload: "default"
visible: true
---
Expand Down
38 changes: 5 additions & 33 deletions .featureFlags/generated.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
// @ts-nocheck

import L19499 from "./images/discounts-list.png"
import I59669 from "./images/improved_refunds.png"
import M04994 from "./images/order-filters.png"
import C77988 from "./images/filters.png"
import R80834 from "./images/discounts-list.png"
import E27647 from "./images/improved_refunds.png"

const discounts_rules = () => (<><p><img src={L19499} alt="Discount rules"/></p>
const discounts_rules = () => (<><p><img src={R80834} alt="Discount rules"/></p>
<p>Apply the new discounts rules to narrow your promotions audience.
Set up conditions and channels that must be fulfilled to apply defined reward.</p>
</>)
const improved_refunds = () => (<><p><img src={I59669} alt="Improved refunds"/></p>
const improved_refunds = () => (<><p><img src={E27647} alt="Improved refunds"/></p>
<h3 id="enable-the-enhanced-refund-feature-to-streamline-your-refund-process">Enable the enhanced refund feature to streamline your refund process:</h3>
<ul>
<li><p>• Choose between automatic calculations based on selected items or enter refund amounts directly for overcharges and custom adjustments.</p>
Expand All @@ -18,14 +16,6 @@ const improved_refunds = () => (<><p><img src={I59669} alt="Improved refunds"/><
</li>
</ul>

</>)
const order_filters = () => (<><p><img src={M04994} alt="new filters"/></p>
<p>Experience the new look and enhanced abilities of new orders filtering mechanism.
Easily combine any criteria you want, and quickly browse their values.</p>
</>)
const product_filters = () => (<><p><img src={C77988} alt="new filters"/></p>
<p>Experience the new look and enhanced abilities of new fitering mechanism.
Easily combine any criteria you want, and quickly browse their values.</p>
</>)

export const AVAILABLE_FLAGS = [{
Expand All @@ -34,7 +24,7 @@ export const AVAILABLE_FLAGS = [{
component: discounts_rules,
visible: true,
content: {
enabled: false,
enabled: true,
payload: "default",
}
},{
Expand All @@ -46,22 +36,4 @@ export const AVAILABLE_FLAGS = [{
enabled: true,
payload: "default",
}
},{
name: "order_filters",
displayName: "Orders filtering",
component: order_filters,
visible: true,
content: {
enabled: true,
payload: "default",
}
},{
name: "product_filters",
displayName: "Products filtering",
component: product_filters,
visible: true,
content: {
enabled: true,
payload: "default",
}
}] as const;
12 changes: 0 additions & 12 deletions .featureFlags/order-filters.md

This file was deleted.

12 changes: 0 additions & 12 deletions .featureFlags/product-filters.md

This file was deleted.

48 changes: 48 additions & 0 deletions .github/actions/prepare-accounts/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Prepare accounts
description: Prepare accounts that are used by Playwright
inputs:
BASE_URL:
description: "Dashboard base url"
required: true
API_URL:
description: "API url"
required: true
E2E_USER_NAME:
description: "Username for e2e tests"
required: true
E2E_USER_PASSWORD:
description: "Password for e2e tests"
required: true
E2E_PERMISSIONS_USERS_PASSWORD:
description: "Permissions user password for e2e tests"
required: true
E2E_ENCODE_PASS:
description: "Password for encoding credentials"
required: true

outputs:
ACCOUNTS:
description: "Encrypted accounts"
value: ${{ steps.accounts.outputs.ACCOUNTS }}


runs:
using: "composite"
steps:
- uses: actions/setup-node@v3
with:
node-version-file: ".nvmrc"

- name: Prepare accounts
shell: bash
id: accounts
env:
BASE_URL: ${{ inputs.BASE_URL }}
API_URL: ${{ inputs.API_URL }}
E2E_USER_NAME: ${{ inputs.E2E_USER_NAME }}
E2E_USER_PASSWORD: ${{ inputs.E2E_USER_PASSWORD }}
E2E_ENCODE_PASS: ${{ inputs.E2E_ENCODE_PASS }}
E2E_PERMISSIONS_USERS_PASSWORD: ${{ inputs.E2E_PERMISSIONS_USERS_PASSWORD }}
run: |
ACCOUNTS=$(node playwright/auth.js login)
echo "ACCOUNTS=${ACCOUNTS}" >> "$GITHUB_OUTPUT"
32 changes: 32 additions & 0 deletions .github/actions/restore-accounts/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Restore accounts
description: Restore accounts to be consumed by Playwright
inputs:
ACCOUNTS:
description: "Accounts encrypted string"
required: true
E2E_ENCODE_PASS:
description: "Password for encoding credentials"
required: true
BASE_URL:
description: "Dashboard base url"
required: true
API_URL:
description: "API url"
required: true

runs:
using: "composite"
steps:
- uses: actions/setup-node@v3
with:
node-version-file: ".nvmrc"

- name: Restore accounts
shell: bash
env:
E2E_ENCODE_PASS: ${{ inputs.E2E_ENCODE_PASS }}
ACCOUNTS: ${{ inputs.ACCOUNTS }}
API_URL: ${{ inputs.API_URL }}
BASE_URL: ${{ inputs.BASE_URL }}
run: |
node playwright/auth.js restore "$ACCOUNTS"
18 changes: 16 additions & 2 deletions .github/actions/run-pw-tests/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,15 @@ inputs:
description: "Playwright retries"
required: true
PROJECT:
description: "Project name form playwright config"
description: "Project name from playwright config"
required: false
default: "e2e"
ACCOUNTS:
description: "Accounts hash"
required: true
E2E_ENCODE_PASS:
description: "Password for encoding credentials"
required: true

runs:
using: "composite"
Expand All @@ -47,6 +53,14 @@ runs:
shell: bash
run: npm ci

- name: Restore accounts
uses: ./.github/actions/restore-accounts
with:
BASE_URL: ${{ inputs.BASE_URL }}
API_URL: ${{ inputs.API_URL }}
ACCOUNTS: ${{ inputs.ACCOUNTS }}
E2E_ENCODE_PASS: ${{ inputs.E2E_ENCODE_PASS }}

- name: Install Playwright Browsers
shell: bash
run: npx playwright install --with-deps
Expand Down Expand Up @@ -82,4 +96,4 @@ runs:
with:
name: all-blob-reports
path: blob-report
retention-days: 1
retention-days: 1
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ jobs:
secrets: inherit

add-comment-to-release-pr:
if: ${{ !cancelled() }}
needs: run-tests-on-release
runs-on: ubuntu-22.04
steps:
Expand Down
18 changes: 17 additions & 1 deletion .github/workflows/pr-automation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ jobs:
deploy-dashboard:
if: github.event.pull_request.head.repo.full_name == 'saleor/saleor-dashboard'
outputs:
ACCOUNTS: ${{ steps.accounts.outputs.ACCOUNTS }}
runs-on: ubuntu-22.04
needs: initialize-cloud
permissions:
Expand Down Expand Up @@ -151,6 +153,17 @@ jobs:
deployment_id: ${{ steps.deployment.outputs.deployment_id }}
env: ${{ needs.initialize-cloud.outputs.POOL_NAME }}

- name: Prepare accounts
id: accounts
uses: ./.github/actions/prepare-accounts
with:
BASE_URL: ${{ needs.initialize-cloud.outputs.BASE_URL }}
API_URL: ${{ needs.initialize-cloud.outputs.API_URL }}
E2E_USER_NAME: ${{ secrets.E2E_USER_NAME }}
E2E_USER_PASSWORD: ${{ secrets.E2E_USER_PASSWORD }}
E2E_ENCODE_PASS: ${{ secrets.E2E_ENCODE_PASS }}
E2E_PERMISSIONS_USERS_PASSWORD: ${{ secrets.E2E_PERMISSIONS_USERS_PASSWORD }}

run-tests:
if: ${{ contains(github.event.pull_request.labels.*.name, 'run pw-e2e') }}
runs-on: ubuntu-22.04
Expand All @@ -159,6 +172,7 @@ jobs:
fail-fast: false
matrix:
shard: ${{ fromJson(needs.initialize-cloud.outputs.SHARD_MATRIX) }}

steps:
- uses: actions/checkout@v4

Expand All @@ -174,6 +188,8 @@ jobs:
MAILPITURL: ${{ secrets.MAILPITURL }}
PW_WORKERS: ${{ vars.PW_WORKERS }}
PW_RETRIES: ${{ vars.PW_RETRIES }}
ACCOUNTS: ${{ needs.deploy-dashboard.outputs.ACCOUNTS }}
E2E_ENCODE_PASS: ${{ secrets.E2E_ENCODE_PASS }}

merge-reports:
if: "!cancelled() && contains(github.event.pull_request.labels.*.name, 'run pw-e2e')"
Expand All @@ -184,4 +200,4 @@ jobs:
- uses: actions/checkout@v4

- name: Merge playwright reports
uses: ./.github/actions/merge-pw-reports
uses: ./.github/actions/merge-pw-reports
13 changes: 13 additions & 0 deletions .github/workflows/run-test-cron.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ jobs:
BACKUP_ID: ${{ steps.cloud_variables.outputs.BACKUP_ID }}
BACKUP_VER: ${{ steps.cloud_variables.outputs.BACKUP_VER }}
BACKUP_NAME: ${{ steps.cloud_variables.outputs.BACKUP_NAME }}
ACCOUNTS: ${{ steps.accounts.outputs.ACCOUNTS }}
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -44,6 +45,17 @@ jobs:
POOL_INSTANCE: ${{ steps.cloud_variables.outputs.POOL_INSTANCE }}
BACKUP_ID: ${{ steps.cloud_variables.outputs.BACKUP_ID }}

- name: Prepare accounts
id: accounts
uses: ./.github/actions/prepare-accounts
with:
BASE_URL: ${{ needs.cloud_variables.outputs.BASE_URL }}
API_URL: ${{ needs.cloud_variables.outputs.API_URL }}
E2E_USER_NAME: ${{ secrets.E2E_USER_NAME }}
E2E_USER_PASSWORD: ${{ secrets.E2E_USER_PASSWORD }}
E2E_ENCODE_PASS: ${{ secrets.E2E_ENCODE_PASS }}
E2E_PERMISSIONS_USERS_PASSWORD: ${{ secrets.E2E_PERMISSIONS_USERS_PASSWORD }}

create-run-on-testmo:
runs-on: ubuntu-22.04
needs: initialize-cloud
Expand Down Expand Up @@ -76,6 +88,7 @@ jobs:
API_URL: ${{ needs.initialize-cloud.outputs.API_URL }}
E2E_USER_NAME: ${{ secrets.E2E_USER_NAME }}
E2E_USER_PASSWORD: ${{ secrets.E2E_USER_PASSWORD }}
ACCOUNTS: ${{ needs.initialize-cloud.outputs.ACCOUNTS }}
E2E_PERMISSIONS_USERS_PASSWORD: ${{ secrets.E2E_PERMISSIONS_USERS_PASSWORD }}
MAILPITURL: ${{ secrets.MAILPITURL }}
PW_WORKERS: ${{ vars.PW_WORKERS }}
Expand Down
14 changes: 14 additions & 0 deletions .github/workflows/run-test-manual.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ jobs:
BACKUP_ID: ${{ steps.cloud_variables.outputs.BACKUP_ID }}
BACKUP_VER: ${{ steps.cloud_variables.outputs.BACKUP_VER }}
BACKUP_NAME: ${{ steps.cloud_variables.outputs.BACKUP_NAME }}
ACCOUNTS: ${{ steps.accounts.outputs.ACCOUNTS }}
steps:
- uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -51,6 +52,18 @@ jobs:
POOL_INSTANCE: ${{ steps.cloud_variables.outputs.POOL_INSTANCE }}
BACKUP_ID: ${{ steps.cloud_variables.outputs.BACKUP_ID }}

- name: Prepare accounts
id: accounts
uses: ./.github/actions/prepare-accounts
with:
BASE_URL: ${{ steps.cloud_variables.outputs.BASE_URL }}
API_URL: ${{ steps.cloud_variables.outputs.API_URL }}
E2E_USER_NAME: ${{ secrets.E2E_USER_NAME }}
E2E_USER_PASSWORD: ${{ secrets.E2E_USER_PASSWORD }}
E2E_ENCODE_PASS: ${{ secrets.E2E_ENCODE_PASS }}
E2E_PERMISSIONS_USERS_PASSWORD: ${{ secrets.E2E_PERMISSIONS_USERS_PASSWORD }}


create-run-on-testmo:
runs-on: ubuntu-22.04
needs: initialize-cloud
Expand Down Expand Up @@ -84,6 +97,7 @@ jobs:
E2E_USER_NAME: ${{ secrets.E2E_USER_NAME }}
E2E_USER_PASSWORD: ${{ secrets.E2E_USER_PASSWORD }}
E2E_PERMISSIONS_USERS_PASSWORD: ${{ secrets.E2E_PERMISSIONS_USERS_PASSWORD }}
ACCOUNTS: ${{ needs.initialize-cloud.outputs.ACCOUNTS }}
MAILPITURL: ${{ secrets.MAILPITURL }}
PW_WORKERS: ${{ vars.PW_WORKERS }}
PW_RETRIES: ${{ vars.PW_RETRIES }}
Expand Down
Loading

0 comments on commit 17a2669

Please sign in to comment.