diff --git a/.github/workflows/checksUI.yml b/.github/workflows/checksUI.yml old mode 100644 new mode 100755 diff --git a/.github/workflows/ui-test.yml b/.github/workflows/sanity-tests.yml old mode 100644 new mode 100755 similarity index 97% rename from .github/workflows/ui-test.yml rename to .github/workflows/sanity-tests.yml index 53e4d6271..6c4d84fbb --- a/.github/workflows/ui-test.yml +++ b/.github/workflows/sanity-tests.yml @@ -1,4 +1,4 @@ -name: UI Tests +name: Upgrade CLI on: ## Check each PR push: @@ -20,10 +20,10 @@ env: jobs: ui_test_matrix: if: github.event.pull_request.draft == false - name: UI Tests (Matrix) + name: Upgrade CLI (Matrix) runs-on: ubuntu-latest env: - JSON_FILE: ${{ (github.event_name == 'schedule' || (github.event_name == 'pull_request' && github.event.pull_request.head.ref == 'dev' && github.event.pull_request.base.ref == 'master')) && 'nightly.json' || 'sanity.json' }} + JSON_FILE: ${{ (github.event_name == 'schedule' || (github.event_name == 'pull_request' && github.event.pull_request.head.ref == 'dev' && github.event.pull_request.base.ref == 'master')) && 'nightlySanity.json' || 'sanity.json' }} outputs: matrix: ${{ steps.set-matrix.outputs.matrix }} steps: @@ -34,7 +34,7 @@ jobs: run: echo "matrix=$(jq -c '. | del(.include[] | select(has("comment")))' .github/workflows/ui-test/${{ env.JSON_FILE }})" >> $GITHUB_OUTPUT ui_test: - name: UI Tests + name: Sanity Tests runs-on: ubuntu-latest needs: ui_test_matrix strategy: @@ -112,7 +112,7 @@ jobs: DB_PASSWD: prestashop DB_NAME: prestashop DB_PREFIX: ps_ - run: npx playwright test + run: npm run test:sanity - name: Rollback run: | @@ -128,7 +128,7 @@ jobs: DB_PASSWD: prestashop DB_NAME: prestashop DB_PREFIX: ps_ - run: npx playwright test + run: npm run test:sanity - name: Export Docker errors working-directory: tests/UI/ diff --git a/.github/workflows/ui-test/nightly.json b/.github/workflows/ui-test/nightlySanity.json old mode 100644 new mode 100755 similarity index 100% rename from .github/workflows/ui-test/nightly.json rename to .github/workflows/ui-test/nightlySanity.json diff --git a/.github/workflows/ui-test/nightlyUI.json b/.github/workflows/ui-test/nightlyUI.json new file mode 100644 index 000000000..86b1d32db --- /dev/null +++ b/.github/workflows/ui-test/nightlyUI.json @@ -0,0 +1,1200 @@ +{ + "include": [ + { + "comment": "1.7.0.6 -> 1.7.8.11 PHP 7.1 online" + }, + { + "PS_VERSION_START": "1.7.0.6", + "PS_VERSION_END": "1.7.8.11", + "PHP_VERSION": "7.1", + "UPGRADE_CHANNEL": "online" + }, + { + "comment": "1.7.1.0 ~ 1.7.1.2 -> 1.7.8.11 PHP 7.1 online" + }, + { + "PS_VERSION_START": "1.7.1.0", + "PS_VERSION_END": "1.7.8.11", + "PHP_VERSION": "7.1", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "1.7.1.1", + "PS_VERSION_END": "1.7.8.11", + "PHP_VERSION": "7.1", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "1.7.1.2", + "PS_VERSION_END": "1.7.8.11", + "PHP_VERSION": "7.1", + "UPGRADE_CHANNEL": "online" + }, + { + "comment": "1.7.2.0 ~ 1.7.2.5 -> 1.7.8.11 PHP 7.1 online" + }, + { + "PS_VERSION_START": "1.7.2.0", + "PS_VERSION_END": "1.7.8.11", + "PHP_VERSION": "7.1", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "1.7.2.1", + "PS_VERSION_END": "1.7.8.11", + "PHP_VERSION": "7.1", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "1.7.2.2", + "PS_VERSION_END": "1.7.8.11", + "PHP_VERSION": "7.1", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "1.7.2.3", + "PS_VERSION_END": "1.7.8.11", + "PHP_VERSION": "7.1", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "1.7.2.4", + "PS_VERSION_END": "1.7.8.11", + "PHP_VERSION": "7.1", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "1.7.2.5", + "PS_VERSION_END": "1.7.8.11", + "PHP_VERSION": "7.1", + "UPGRADE_CHANNEL": "online" + }, + { + "comment": "1.7.3.0 ~ 1.7.3.4 -> 1.7.8.11 PHP 7.1 online" + }, + { + "PS_VERSION_START": "1.7.3.0", + "PS_VERSION_END": "1.7.8.11", + "PHP_VERSION": "7.1", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "1.7.3.1", + "PS_VERSION_END": "1.7.8.11", + "PHP_VERSION": "7.1", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "1.7.3.2", + "PS_VERSION_END": "1.7.8.11", + "PHP_VERSION": "7.1", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "1.7.3.3", + "PS_VERSION_END": "1.7.8.11", + "PHP_VERSION": "7.1", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "1.7.3.4", + "PS_VERSION_END": "1.7.8.11", + "PHP_VERSION": "7.1", + "UPGRADE_CHANNEL": "online" + }, + { + "comment": "1.7.4.0 ~ 1.7.4.4 -> 1.7.8.11 PHP 7.1 online" + }, + { + "comment": "https://github.com/PrestaShop/docker/issues/399", + "PS_VERSION_START": "1.7.4.0", + "PS_VERSION_END": "1.7.8.11", + "PHP_VERSION": "7.1", + "UPGRADE_CHANNEL": "online" + }, + { + "comment": "https://github.com/PrestaShop/docker/issues/399", + "PS_VERSION_START": "1.7.4.1", + "PS_VERSION_END": "1.7.8.11", + "PHP_VERSION": "7.1", + "UPGRADE_CHANNEL": "online" + }, + { + "comment": "bug", + "PS_VERSION_START": "1.7.4.2", + "PS_VERSION_END": "1.7.8.11", + "PHP_VERSION": "7.1", + "UPGRADE_CHANNEL": "online" + }, + { + "comment": "bug", + "PS_VERSION_START": "1.7.4.3", + "PS_VERSION_END": "1.7.8.11", + "PHP_VERSION": "7.1", + "UPGRADE_CHANNEL": "online" + }, + { + "comment": "bug", + "PS_VERSION_START": "1.7.4.4", + "PS_VERSION_END": "1.7.8.11", + "PHP_VERSION": "7.1", + "UPGRADE_CHANNEL": "online" + }, + { + "comment": "1.7.5.0 ~ 1.7.5.2 -> 1.7.8.11 PHP 7.1 online" + }, + { + "PS_VERSION_START": "1.7.5.0", + "PS_VERSION_END": "1.7.8.11", + "PHP_VERSION": "7.1", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "1.7.5.1", + "PS_VERSION_END": "1.7.8.11", + "PHP_VERSION": "7.1", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "1.7.5.2", + "PS_VERSION_END": "1.7.8.11", + "PHP_VERSION": "7.1", + "UPGRADE_CHANNEL": "online" + }, + { + "comment": "1.7.5.0 ~ 1.7.5.2 -> 8.2.0 PHP 7.2 online" + }, + { + "PS_VERSION_START": "1.7.5.0", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "7.2", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "1.7.5.1", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "7.2", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "1.7.5.2", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "7.2", + "UPGRADE_CHANNEL": "online" + }, + { + "comment": "1.7.6.0 ~ 1.7.6.9 -> 1.7.8.11 PHP 7.1 online" + }, + { + "PS_VERSION_START": "1.7.6.0", + "PS_VERSION_END": "1.7.8.11", + "PHP_VERSION": "7.1", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "1.7.6.1", + "PS_VERSION_END": "1.7.8.11", + "PHP_VERSION": "7.1", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "1.7.6.2", + "PS_VERSION_END": "1.7.8.11", + "PHP_VERSION": "7.1", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "1.7.6.3", + "PS_VERSION_END": "1.7.8.11", + "PHP_VERSION": "7.1", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "1.7.6.4", + "PS_VERSION_END": "1.7.8.11", + "PHP_VERSION": "7.1", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "1.7.6.5", + "PS_VERSION_END": "1.7.8.11", + "PHP_VERSION": "7.1", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "1.7.6.6", + "PS_VERSION_END": "1.7.8.11", + "PHP_VERSION": "7.1", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "1.7.6.7", + "PS_VERSION_END": "1.7.8.11", + "PHP_VERSION": "7.1", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "1.7.6.8", + "PS_VERSION_END": "1.7.8.11", + "PHP_VERSION": "7.1", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "1.7.6.9", + "PS_VERSION_END": "1.7.8.11", + "PHP_VERSION": "7.1", + "UPGRADE_CHANNEL": "online" + }, + { + "comment": "1.7.6.0 ~ 1.7.6.9 -> 8.2.0 PHP 7.2 online" + }, + { + "PS_VERSION_START": "1.7.6.0", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "7.2", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "1.7.6.1", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "7.2", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "1.7.6.2", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "7.2", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "1.7.6.3", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "7.2", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "1.7.6.4", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "7.2", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "1.7.6.5", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "7.2", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "1.7.6.6", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "7.2", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "1.7.6.7", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "7.2", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "1.7.6.8", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "7.2", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "1.7.6.9", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "7.2", + "UPGRADE_CHANNEL": "online" + }, + { + "comment": "1.7.7.0 ~ 1.7.7.8 -> 1.7.8.11 PHP 7.1 online" + }, + { + "PS_VERSION_START": "1.7.7.0", + "PS_VERSION_END": "1.7.8.11", + "PHP_VERSION": "7.1", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "1.7.7.1", + "PS_VERSION_END": "1.7.8.11", + "PHP_VERSION": "7.1", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "1.7.7.2", + "PS_VERSION_END": "1.7.8.11", + "PHP_VERSION": "7.1", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "1.7.7.3", + "PS_VERSION_END": "1.7.8.11", + "PHP_VERSION": "7.1", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "1.7.7.4", + "PS_VERSION_END": "1.7.8.11", + "PHP_VERSION": "7.1", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "1.7.7.5", + "PS_VERSION_END": "1.7.8.11", + "PHP_VERSION": "7.1", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "1.7.7.6", + "PS_VERSION_END": "1.7.8.11", + "PHP_VERSION": "7.1", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "1.7.7.7", + "PS_VERSION_END": "1.7.8.11", + "PHP_VERSION": "7.1", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "1.7.7.8", + "PS_VERSION_END": "1.7.8.11", + "PHP_VERSION": "7.1", + "UPGRADE_CHANNEL": "online" + }, + { + "comment": "1.7.7.0 ~ 1.7.7.8 -> 8.2.0 PHP 7.2 ~ 7.3 online" + }, + { + "PS_VERSION_START": "1.7.7.0", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "7.2", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "1.7.7.0", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "7.3", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "1.7.7.1", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "7.2", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "1.7.7.1", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "7.3", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "1.7.7.2", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "7.2", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "1.7.7.2", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "7.3", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "1.7.7.3", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "7.2", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "1.7.7.3", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "7.3", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "1.7.7.4", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "7.2", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "1.7.7.4", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "7.3", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "1.7.7.5", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "7.2", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "1.7.7.5", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "7.3", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "1.7.7.6", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "7.2", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "1.7.7.6", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "7.3", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "1.7.7.7", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "7.2", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "1.7.7.7", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "7.3", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "1.7.7.8", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "7.2", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "1.7.7.8", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "7.3", + "UPGRADE_CHANNEL": "online" + }, + { + "comment": "1.7.8.0 ~ 1.7.8.10 -> 1.7.8.11 PHP 7.1 online" + }, + { + "PS_VERSION_START": "1.7.8.0", + "PS_VERSION_END": "1.7.8.11", + "PHP_VERSION": "7.1", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "1.7.8.1", + "PS_VERSION_END": "1.7.8.11", + "PHP_VERSION": "7.1", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "1.7.8.2", + "PS_VERSION_END": "1.7.8.11", + "PHP_VERSION": "7.1", + "UPGRADE_CHANNEL": "online" + }, + { + "comment": "bug", + "PS_VERSION_START": "1.7.8.3", + "PS_VERSION_END": "1.7.8.11", + "PHP_VERSION": "7.1", + "UPGRADE_CHANNEL": "online" + }, + { + "comment": "bug", + "PS_VERSION_START": "1.7.8.4", + "PS_VERSION_END": "1.7.8.11", + "PHP_VERSION": "7.1", + "UPGRADE_CHANNEL": "online" + }, + { + "comment": "bug", + "PS_VERSION_START": "1.7.8.5", + "PS_VERSION_END": "1.7.8.11", + "PHP_VERSION": "7.1", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "1.7.8.6", + "PS_VERSION_END": "1.7.8.11", + "PHP_VERSION": "7.1", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "1.7.8.7", + "PS_VERSION_END": "1.7.8.11", + "PHP_VERSION": "7.1", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "1.7.8.8", + "PS_VERSION_END": "1.7.8.11", + "PHP_VERSION": "7.1", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "1.7.8.9", + "PS_VERSION_END": "1.7.8.11", + "PHP_VERSION": "7.1", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "1.7.8.10", + "PS_VERSION_END": "1.7.8.11", + "PHP_VERSION": "7.1", + "UPGRADE_CHANNEL": "online" + }, + { + "comment": "1.7.8.0 ~ 1.7.8.11 -> 8.2.0 PHP 7.2 ~ 7.4 online" + }, + { + "PS_VERSION_START": "1.7.8.0", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "7.2", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "1.7.8.0", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "7.3", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "1.7.8.0", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "7.4", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "1.7.8.1", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "7.2", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "1.7.8.1", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "7.3", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "1.7.8.1", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "7.4", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "1.7.8.2", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "7.2", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "1.7.8.2", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "7.3", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "1.7.8.2", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "7.4", + "UPGRADE_CHANNEL": "online" + }, + { + "comment": "bug", + "PS_VERSION_START": "1.7.8.3", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "7.2", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "1.7.8.3", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "7.3", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "1.7.8.3", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "7.4", + "UPGRADE_CHANNEL": "online" + }, + { + "comment": "bug", + "PS_VERSION_START": "1.7.8.4", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "7.2", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "1.7.8.4", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "7.3", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "1.7.8.4", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "7.4", + "UPGRADE_CHANNEL": "online" + }, + { + "comment": "bug", + "PS_VERSION_START": "1.7.8.5", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "7.2", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "1.7.8.5", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "7.3", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "1.7.8.5", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "7.4", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "1.7.8.6", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "7.2", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "1.7.8.6", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "7.3", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "1.7.8.6", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "7.4", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "1.7.8.7", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "7.2", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "1.7.8.7", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "7.3", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "1.7.8.7", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "7.4", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "1.7.8.8", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "7.2", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "1.7.8.8", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "7.3", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "1.7.8.8", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "7.4", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "1.7.8.9", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "7.2", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "1.7.8.9", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "7.3", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "1.7.8.9", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "7.4", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "1.7.8.10", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "7.2", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "1.7.8.10", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "7.3", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "1.7.8.10", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "7.4", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "1.7.8.11", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "7.2", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "1.7.8.11", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "7.3", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "1.7.8.11", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "7.4", + "UPGRADE_CHANNEL": "online" + }, + { + "comment": "8.0.0 ~ 8.0.5 -> 8.2.0 PHP 7.2 ~ 8.1 online" + }, + { + "PS_VERSION_START": "8.0.0", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "7.2", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "8.0.0", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "7.3", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "8.0.0", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "7.4", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "8.0.0", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "8.0", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "8.0.0", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "8.1", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "8.0.1", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "7.2", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "8.0.1", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "7.3", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "8.0.1", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "7.4", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "8.0.1", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "8.0", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "8.0.1", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "8.1", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "8.0.2", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "7.2", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "8.0.2", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "7.3", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "8.0.2", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "7.4", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "8.0.2", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "8.0", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "8.0.2", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "8.1", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "8.0.3", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "7.2", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "8.0.3", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "7.3", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "8.0.3", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "7.4", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "8.0.3", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "8.0", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "8.0.3", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "8.1", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "8.0.4", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "7.2", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "8.0.4", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "7.3", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "8.0.4", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "7.4", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "8.0.4", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "8.0", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "8.0.4", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "8.1", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "8.0.5", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "7.2", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "8.0.5", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "7.3", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "8.0.5", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "7.4", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "8.0.5", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "8.0", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "8.0.5", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "8.1", + "UPGRADE_CHANNEL": "online" + }, + { + "comment": "8.1.0 ~ 8.1.7 -> 8.2.0 PHP 7.2 ~ 8.1 online" + }, + { + "PS_VERSION_START": "8.1.0", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "7.2", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "8.1.0", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "7.3", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "8.1.0", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "7.4", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "8.1.0", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "8.0", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "8.1.0", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "8.1", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "8.1.1", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "7.2", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "8.1.1", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "7.3", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "8.1.1", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "7.4", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "8.1.1", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "8.0", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "8.1.1", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "8.1", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "8.1.2", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "7.2", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "8.1.2", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "7.3", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "8.1.2", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "7.4", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "8.1.2", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "8.0", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "8.1.2", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "8.1", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "8.1.3", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "7.2", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "8.1.3", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "7.3", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "8.1.3", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "7.4", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "8.1.3", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "8.0", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "8.1.3", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "8.1", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "8.1.4", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "7.2", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "8.1.4", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "7.3", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "8.1.4", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "7.4", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "8.1.4", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "8.0", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "8.1.4", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "8.1", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "8.1.5", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "7.2", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "8.1.5", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "7.3", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "8.1.5", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "7.4", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "8.1.5", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "8.0", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "8.1.5", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "8.1", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "8.1.6", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "7.2", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "8.1.6", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "7.3", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "8.1.6", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "7.4", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "8.1.6", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "8.0", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "8.1.6", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "8.1", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "8.1.7", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "7.2", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "8.1.7", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "7.3", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "8.1.7", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "7.4", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "8.1.7", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "8.0", + "UPGRADE_CHANNEL": "online" + }, + { + "PS_VERSION_START": "8.1.7", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "8.1", + "UPGRADE_CHANNEL": "online" + } + ] +} diff --git a/.github/workflows/ui-test/sanity.json b/.github/workflows/ui-test/sanity.json old mode 100644 new mode 100755 index 1b45407b8..21a6ab575 --- a/.github/workflows/ui-test/sanity.json +++ b/.github/workflows/ui-test/sanity.json @@ -64,7 +64,7 @@ "UPGRADE_CHANNEL": "online" }, { - "comment": "8.1.7 -> 8.2.0 PHP 8.1 online" + "comment": "8.1.7 -> 8.2.0 PHP 8.0 online" }, { "PS_VERSION_START": "8.1.7", diff --git a/.github/workflows/ui-test/ui.json b/.github/workflows/ui-test/ui.json new file mode 100755 index 000000000..8848fa1f0 --- /dev/null +++ b/.github/workflows/ui-test/ui.json @@ -0,0 +1,76 @@ +{ + "include": [ + { + "comment": "1.7.6.0 -> 1.7.8.11 PHP 7.1 online" + }, + { + "PS_VERSION_START": "1.7.6.0", + "PS_VERSION_END": "1.7.8.11", + "PHP_VERSION": "7.1", + "UPGRADE_CHANNEL": "online" + }, + { + "comment": "1.7.6.9 -> 8.2.0 PHP 7.2 online" + }, + { + "PS_VERSION_START": "1.7.6.9", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "7.2", + "UPGRADE_CHANNEL": "online" + }, + { + "comment": "1.7.7.0 -> 1.7.8.11 PHP 7.1 online" + }, + { + "PS_VERSION_START": "1.7.7.0", + "PS_VERSION_END": "1.7.8.11", + "PHP_VERSION": "7.1", + "UPGRADE_CHANNEL": "online" + }, + { + "comment": "1.7.7.8 -> 8.2.0 PHP 7.3 online" + }, + { + "PS_VERSION_START": "1.7.7.8", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "7.3", + "UPGRADE_CHANNEL": "online" + }, + { + "comment": "1.7.8.10 -> 1.7.8.11 PHP 7.1 online" + }, + { + "PS_VERSION_START": "1.7.8.10", + "PS_VERSION_END": "1.7.8.11", + "PHP_VERSION": "7.1", + "UPGRADE_CHANNEL": "online" + }, + { + "comment": "1.7.8.11 -> 8.2.0 PHP 7.4 online" + }, + { + "PS_VERSION_START": "1.7.8.11", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "7.4", + "UPGRADE_CHANNEL": "online" + }, + { + "comment": "8.0.5 -> 8.2.0 PHP 8.1 online" + }, + { + "PS_VERSION_START": "8.0.5", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "8.1", + "UPGRADE_CHANNEL": "online" + }, + { + "comment": "8.1.7 -> 8.2.0 PHP 8.0 online" + }, + { + "PS_VERSION_START": "8.1.7", + "PS_VERSION_END": "8.2.0", + "PHP_VERSION": "8.1", + "UPGRADE_CHANNEL": "online" + } + ] +} diff --git a/.github/workflows/ui-tests.yml b/.github/workflows/ui-tests.yml new file mode 100755 index 000000000..f3e8c8de3 --- /dev/null +++ b/.github/workflows/ui-tests.yml @@ -0,0 +1,154 @@ +name: Upgrade UI +on: + ## Check each PR + push: + branches: + - dev + - master + pull_request: + ## Manual execution on branch + workflow_dispatch: + ## Nightly + ### Needs secrets + #### GC_PROJECT_ID + #### GC_SERVICE_KEY + #### NIGHTLY_TOKEN + schedule: + - cron: '0 0 * * *' +env: + CAMPAIGN: 'autoupgrade' +jobs: + ui_test_matrix: + if: github.event.pull_request.draft == false + name: Upgrade UI (Matrix) + runs-on: ubuntu-latest + env: + JSON_FILE: ${{ (github.event_name == 'schedule' || (github.event_name == 'pull_request' && github.event.pull_request.head.ref == 'dev' && github.event.pull_request.base.ref == 'master')) && 'nightlyUI.json' || 'ui.json' }} + outputs: + matrix: ${{ steps.set-matrix.outputs.matrix }} + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Set matrix + id: set-matrix + run: echo "matrix=$(jq -c '. | del(.include[] | select(has("comment")))' .github/workflows/ui-test/${{ env.JSON_FILE }})" >> $GITHUB_OUTPUT + + ui_test: + name: UI Tests + runs-on: ubuntu-latest + needs: ui_test_matrix + strategy: + fail-fast: false + matrix: ${{ fromJSON(needs.ui_test_matrix.outputs.matrix) }} + env: + PS_DOCKER: ${{ matrix.PS_VERSION_START }}-${{ matrix.PHP_VERSION }} + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Start containers + working-directory: tests/UI/ + env: + PS_VERSION: ${{ env.PS_DOCKER }} + run: | + docker compose -f "docker-compose.yml" up -d --build + bash -c 'while [[ "$(curl -L -s -o /dev/null -w %{http_code} http://localhost/)" != "200" ]]; do sleep 5; done' + + - name: Composer install + run: composer install + + - name: Display new interface + run: | + docker exec -t prestashop bash -c 'apt-get update' + docker exec -t prestashop bash -c 'curl -sL https://deb.nodesource.com/setup_20.x | bash -' + docker exec -t prestashop bash -c 'apt-get install -y nodejs' + docker exec -t prestashop bash -c 'cd /var/www/html/modules/autoupgrade/_dev && npm install && npm run vite:build' + + - name: Install dependencies + working-directory: tests/UI/ + run: npm ci + + - name: Install Playwright Browsers + working-directory: tests/UI/ + run: npx playwright install chromium --with-deps + + - name: Run functional tests + working-directory: tests/UI/ + env: + PS_VERSION: ${{ matrix.PS_VERSION_START }} + DB_USER: prestashop + DB_PASSWD: prestashop + DB_NAME: prestashop + DB_PREFIX: ps_ + run: npm run test:functional + + - name: Export Docker errors + working-directory: tests/UI/ + if: always() + run: docker compose logs --no-color >& docker-compose.log + + - name: Upload artifact + uses: actions/upload-artifact@v4 + if: always() + with: + name: playwright-report-${{ matrix.PS_VERSION_START }}-${{ matrix.PS_VERSION_END }}-${{ matrix.UPGRADE_CHANNEL }}-${{ matrix.PHP_VERSION }} + path: | + tests/UI/reports/ + tests/UI/report.json + tests/UI/docker-compose.log + retention-days: 30 + + nightly: + name: Nightly Report + if: ${{ github.event_name == 'schedule' }} + needs: + - ui_test_matrix + - ui_test + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: ${{ fromJSON(needs.ui_test_matrix.outputs.matrix) }} + permissions: + contents: 'read' + id-token: 'write' + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Download report + uses: actions/download-artifact@v4 + with: + name: playwright-report-${{ matrix.PS_VERSION_START }}-${{ matrix.PS_VERSION_END }}-${{ matrix.UPGRADE_CHANNEL }}-${{ matrix.PHP_VERSION }} + path: tests/UI/ + + # Nightly : Rename file + - name: "Nightly : Rename file" + working-directory: tests/UI/ + run: | + mkdir -p nightly + REPORT_NAME="${{ env.CAMPAIGN }}_$(date +%Y-%m-%d)-${{ matrix.PS_VERSION_START }}_(Channel:_${{ matrix.UPGRADE_CHANNEL }}_PHP:_${{ matrix.PHP_VERSION }})" + mv report.json nightly/${REPORT_NAME}.json + + # Nightly : Auth GCP + - name: "Nightly : Auth GCP" + uses: google-github-actions/auth@v2 + with: + credentials_json: ${{ secrets.GC_SERVICE_KEY }} + project_id: ${{ secrets.GC_PROJECT_ID }} + + # Nightly : Setup GCP + - name: "Nightly : Setup GCP" + uses: google-github-actions/setup-gcloud@v2 + + # Nightly : Upload to Google Cloud Storage (GCS) + - name: "Nightly : Upload to Google Cloud Storage (GCS)" + working-directory: tests/UI/ + run: gsutil cp -r "nightly/**" gs://prestashop-core-nightly/reports + + # Nightly : Push Report + - name: "Nightly : Push Report" + run: | + REPORT_NAME="${{ env.CAMPAIGN }}_$(date +%Y-%m-%d)-${{ matrix.PS_VERSION_START }}_(Channel:_${{ matrix.UPGRADE_CHANNEL }}_PHP:_${{ matrix.PHP_VERSION }})" + curl -v "https://api-nightly.prestashop-project.org/import/report/playwright?token=${{ secrets.NIGHTLY_TOKEN }}&filename=${REPORT_NAME}.json&campaign=${{ env.CAMPAIGN }}&platform=cli" diff --git a/tests/UI/.eslintrc.js b/tests/UI/.eslintrc.js old mode 100644 new mode 100755 diff --git a/tests/UI/.gitignore b/tests/UI/.gitignore old mode 100644 new mode 100755 index 68c5d18f0..e15fa4ac7 --- a/tests/UI/.gitignore +++ b/tests/UI/.gitignore @@ -1,5 +1,5 @@ node_modules/ /test-results/ /playwright-report/ -/blob-report/ +/reports/ /playwright/.cache/ diff --git a/tests/UI/campaigns/functional/01_upgrade.spec.ts b/tests/UI/campaigns/functional/01_upgrade.spec.ts new file mode 100755 index 000000000..825af35e3 --- /dev/null +++ b/tests/UI/campaigns/functional/01_upgrade.spec.ts @@ -0,0 +1,308 @@ +import { + // Import utils + utilsTest, + // Import BO pages + boDashboardPage, + boLoginPage, + boModuleManagerPage, + boInstalledModulesPage, + boModuleSelectionPage, + boModuleManagerUninstalledModulesPage, + boMarketplacePage, + boMaintenancePage, + dataModules, + modAutoupgradeBoMain, +} from '@prestashop-core/ui-testing'; + +import { + test, expect, Page, BrowserContext, +} from '@playwright/test'; +import semver from 'semver'; +import {exec} from 'child_process'; + +const psVersion = utilsTest.getPSVersion(); + +/* + Verify the New UI + */ +test.describe('Verify the New UI', () => { + let browserContext: BrowserContext; + let page: Page; + + test.beforeAll(async ({browser}) => { + browserContext = await browser.newContext(); + page = await browserContext.newPage(); + }); + test.afterAll(async () => { + await page.close(); + }); + + // Steps + test('should login in BO', async () => { + await boLoginPage.goTo(page, global.BO.URL); + await boLoginPage.successLogin(page, global.BO.EMAIL, global.BO.PASSWD); + + const pageTitle = await boDashboardPage.getPageTitle(page); + expect(pageTitle).toContain(boDashboardPage.pageTitle); + }); + + // Steps to install module + if (semver.lt(psVersion, '7.4.0')) { + test('should go to \'Modules > Modules & Services\' page', async () => { + await boDashboardPage.goToSubMenu( + page, + boDashboardPage.modulesParentLink, + boDashboardPage.moduleManagerLink, + ); + await boModuleManagerPage.closeSfToolBar(page); + + const pageTitle = await boModuleSelectionPage.getPageTitle(page); + expect(pageTitle).toContain(boModuleSelectionPage.pageTitle); + }); + + test(`should install the module '${dataModules.autoupgrade.name}'`, async () => { + const successMessage = await boModuleSelectionPage.installModule(page, dataModules.autoupgrade.tag); + expect(successMessage).toEqual(boModuleSelectionPage.installMessageSuccessful(dataModules.autoupgrade.tag)); + }); + } else if (semver.lt(psVersion, '7.5.0')) { + test('should go to \'Modules > Modules & Services\' page', async () => { + await boDashboardPage.goToSubMenu( + page, + boDashboardPage.modulesParentLink, + boDashboardPage.moduleManagerLink, + ); + await boModuleManagerPage.closeSfToolBar(page); + + const pageTitle = await boInstalledModulesPage.getPageTitle(page); + expect(pageTitle).toContain(boInstalledModulesPage.pageTitle); + }); + + test('should go to Selection page', async () => { + await boInstalledModulesPage.goToSelectionPage(page); + + const pageTitle = await boModuleSelectionPage.getPageTitle(page); + expect(pageTitle).toContain(boModuleSelectionPage.pageTitle); + }); + + test(`should install the module '${dataModules.autoupgrade.name}'`, async () => { + const successMessage = await boModuleSelectionPage.installModule(page, dataModules.autoupgrade.tag); + expect(successMessage).toEqual(boModuleSelectionPage.installMessageSuccessful(dataModules.autoupgrade.tag)); + }); + } else if (semver.lt(psVersion, '7.6.0')) { + test('should go to \'Modules > Marketplace\' page', async () => { + await boDashboardPage.goToSubMenu( + page, + boDashboardPage.modulesParentLink, + boDashboardPage.moduleCatalogueLink, + ); + await boModuleManagerPage.closeSfToolBar(page); + + const pageTitle = await boMarketplacePage.getPageTitle(page); + expect(pageTitle).toContain(boMarketplacePage.pageTitle); + }); + + test(`should install the module '${dataModules.autoupgrade.name}'`, async () => { + const successMessage = await boMarketplacePage.installModule(page, dataModules.autoupgrade.tag); + expect(successMessage).toEqual(boMarketplacePage.installMessageSuccessful(dataModules.autoupgrade.tag)); + }); + } else if (semver.lt(psVersion, '8.0.0')) { + test('should go to \'Modules > Module Manager\' page', async () => { + await boDashboardPage.goToSubMenu( + page, + boDashboardPage.modulesParentLink, + boDashboardPage.moduleManagerLink, + ); + await boModuleManagerPage.closeSfToolBar(page); + + const pageTitle = await boModuleManagerPage.getPageTitle(page); + expect(pageTitle).toContain(boModuleManagerPage.pageTitle); + }); + + test(`should install the module '${dataModules.autoupgrade.name}'`, async () => { + await boModuleManagerUninstalledModulesPage.goToTabUninstalledModules(page); + + const isInstalled = await boModuleManagerUninstalledModulesPage.installModule(page, dataModules.autoupgrade.tag); + expect(isInstalled).toBeTruthy(); + }); + } + + // Steps to go to module configuration page + if (semver.lt(psVersion, '7.4.0')) { + test('should go to Installed modules page', async () => { + await boModuleSelectionPage.goToInstalledModulesPage(page); + + const pageTitle = await boInstalledModulesPage.getPageTitle(page); + expect(pageTitle).toContain(boInstalledModulesPage.pageTitle); + }); + + test(`should search the module '${dataModules.autoupgrade.name}'`, async () => { + const isModuleVisible = await boInstalledModulesPage.searchModule(page, dataModules.autoupgrade); + expect(isModuleVisible).toEqual(true); + }); + + test(`should go to the configuration page of the module '${dataModules.autoupgrade.name}'`, async () => { + await boInstalledModulesPage.goToModuleConfigurationPage(page, dataModules.autoupgrade.tag); + + const pageTitle = await modAutoupgradeBoMain.getPageTitle(page); + expect(pageTitle).toEqual(modAutoupgradeBoMain.pageTitle); + }); + } else if (semver.lt(psVersion, '7.5.0')) { + test('should go to Modules and services page', async () => { + await boDashboardPage.goToSubMenu( + page, + boDashboardPage.modulesParentLink, + boDashboardPage.moduleManagerLink, + ); + + const pageTitle = await boInstalledModulesPage.getPageTitle(page); + expect(pageTitle).toContain(boInstalledModulesPage.pageTitle); + }); + + test(`should search the module '${dataModules.autoupgrade.name}'`, async () => { + const isModuleVisible = await boInstalledModulesPage.searchModule(page, dataModules.autoupgrade); + expect(isModuleVisible).toEqual(true); + }); + + test(`should go to the configuration page of the module '${dataModules.autoupgrade.name}'`, async () => { + await boInstalledModulesPage.goToModuleConfigurationPage(page, dataModules.autoupgrade.tag); + + const pageTitle = await modAutoupgradeBoMain.getPageTitle(page); + expect(pageTitle).toEqual(modAutoupgradeBoMain.pageTitle); + }); + } else { + test('should go to Module Manager page', async () => { + await boDashboardPage.goToSubMenu( + page, + boDashboardPage.modulesParentLink, + boDashboardPage.moduleManagerLink, + ); + + const pageTitle = await boModuleManagerPage.getPageTitle(page); + expect(pageTitle).toContain(boModuleManagerPage.pageTitle); + }); + + test(`should search the module '${dataModules.autoupgrade.name}'`, async () => { + const isModuleVisible = await boModuleManagerPage.searchModule(page, dataModules.autoupgrade); + expect(isModuleVisible).toEqual(true); + }); + + // Go to the old UI + test(`should go to the configuration page of the module '${dataModules.autoupgrade.name}'`, async () => { + await boModuleManagerPage.goToConfigurationPage(page, dataModules.autoupgrade.tag); + + const pageTitle = await modAutoupgradeBoMain.getPageTitle(page); + expect(pageTitle).toEqual(modAutoupgradeBoMain.pageTitle); + }); + } + + // @todelete : Display new UI + test('should display the new interface', async () => { + const url = await modAutoupgradeBoMain.getCurrentURL(page); + const uurl = url.split('&token'); + await modAutoupgradeBoMain.goTo(page, `${uurl[0]}&new-ui=1&route=home-page&token${uurl[1]}`); + + const pageTitle = await modAutoupgradeBoMain.getPageTitle(page); + expect(pageTitle).toEqual(modAutoupgradeBoMain.pageTitle); + }); + + test('should click on update your store radio button then get started', async () => { + const isStepContentVisible = await modAutoupgradeBoMain.updateYourStore(page); + expect(isStepContentVisible).toEqual(true); + + const stepTitle = await modAutoupgradeBoMain.getStepTitle(page); + expect(stepTitle).toEqual('Version choice'); + + await exec('docker exec -t prestashop chmod -R 777 /var/www/html/modules'); + }); + + test('should choose the version to update and check requirements block', async () => { + test.setTimeout(100_000); + const isRequirementBlockVisible = await modAutoupgradeBoMain.chooseNewVersion(page); + expect(isRequirementBlockVisible).toEqual(true); + }); + + test('should go to maintenance page', async () => { + page = await modAutoupgradeBoMain.goToMaintenancePage(page); + + const pageTitle = await boMaintenancePage.getPageTitle(page); + expect(pageTitle).toContain(boMaintenancePage.pageTitle); + }); + + test('should disable the store', async () => { + const result = await boMaintenancePage.changeShopStatus(page, false); + expect(result).toContain(boMaintenancePage.successfulUpdateMessage); + }); + + test('should add maintenance IP', async () => { + const result = await boMaintenancePage.addMyIpAddress(page); + expect(result).toContain(boMaintenancePage.successfulUpdateMessage); + }); + + test('should close the page', async () => { + page = await boMaintenancePage.closePage(browserContext, page, 0); + + const pageTitle = await modAutoupgradeBoMain.getPageTitle(page); + expect(pageTitle).toEqual(modAutoupgradeBoMain.pageTitle); + }); + + test('should check that all the requirements are OK', async () => { + await exec('docker exec -t prestashop chmod -R 777 /var/www/html/modules'); + + const isNextButtonEnabled = await modAutoupgradeBoMain.checkRequirements(page); + expect(isNextButtonEnabled).toEqual(true); + }); + + test('should check the current PS version', async () => { + const currentVersion = await modAutoupgradeBoMain.getCurrentPSAndPHPVersion(page); + expect(currentVersion).toContain(psVersion); + }); + + test('should check the new PS version', async () => { + const newVersion = await modAutoupgradeBoMain.getNewPSVersion(page); + expect(newVersion).not.toContain(`${psVersion} `); + }); + + test('should click on next button and check that the step title is \'Update options\'', async () => { + await modAutoupgradeBoMain.goToNextStep(page); + + const stepTitle = await modAutoupgradeBoMain.getStepTitle(page); + expect(stepTitle).toEqual('Update options'); + }); + + test('should click on next button and check that the step title is \'Back up your store\'', async () => { + await modAutoupgradeBoMain.goToNextStep(page); + + const stepTitle = await modAutoupgradeBoMain.getStepTitle(page); + expect(stepTitle).toEqual('Back up your store'); + }); + + test('should click on \'Launch backup\' button and check the modal', async () => { + const isModalVisible = await modAutoupgradeBoMain.clickOnLaunchBackup(page); + expect(isModalVisible).toEqual(true); + }); + + test('should click on cancel button and check that the modal is not visible', async () => { + const isModalNotVisible = await modAutoupgradeBoMain.cancelBackup(page); + expect(isModalNotVisible).toEqual(true); + }); + + test('should click on update without backup and confirm the modal', async () => { + await modAutoupgradeBoMain.clickOnUpdateWithoutBackup(page); + await page.waitForTimeout(2000); + + const stepTitle = await modAutoupgradeBoMain.getStepTitle(page); + expect(stepTitle).toEqual('Update'); + }); + + test('should wait until the end of the update ', async () => { + test.setTimeout(5000_000); + + const successMessage = await modAutoupgradeBoMain.checkUpdateSuccess(page); + expect(successMessage).toEqual(modAutoupgradeBoMain.updateSuccessMessage); + }); + + test('should check the title of the last step', async () => { + const stepTitle = await modAutoupgradeBoMain.getStepTitle(page); + expect(stepTitle).toEqual('Post-update checklist'); + }); +}); diff --git a/tests/UI/campaigns/sanity/06_shopVersion/01_CheckVersion.spec.ts b/tests/UI/campaigns/sanity/06_shopVersion/01_checkVersion.spec.ts old mode 100644 new mode 100755 similarity index 100% rename from tests/UI/campaigns/sanity/06_shopVersion/01_CheckVersion.spec.ts rename to tests/UI/campaigns/sanity/06_shopVersion/01_checkVersion.spec.ts diff --git a/tests/UI/campaigns/sanity/06_shopVersion/02_checkVersionInDatabase.spec.ts b/tests/UI/campaigns/sanity/06_shopVersion/02_checkVersionInDatabase.spec.ts old mode 100644 new mode 100755 diff --git a/tests/UI/package-lock.json b/tests/UI/package-lock.json old mode 100644 new mode 100755 index 080e794a5..ebecaa48b --- a/tests/UI/package-lock.json +++ b/tests/UI/package-lock.json @@ -523,7 +523,7 @@ }, "node_modules/@prestashop-core/ui-testing": { "version": "0.0.12", - "resolved": "git+ssh://git@github.com/PrestaShop/ui-testing-library.git#49a1a110e5b399f24225a3e8ccaf59161d2a9c05", + "resolved": "git+ssh://git@github.com/PrestaShop/ui-testing-library.git#805748a4543a3574faafbb9b5fa9e39332d730de", "license": "MIT", "dependencies": { "@faker-js/faker": "^9.0.3", @@ -6683,7 +6683,7 @@ } }, "@prestashop-core/ui-testing": { - "version": "git+ssh://git@github.com/PrestaShop/ui-testing-library.git#49a1a110e5b399f24225a3e8ccaf59161d2a9c05", + "version": "git+ssh://git@github.com/PrestaShop/ui-testing-library.git#805748a4543a3574faafbb9b5fa9e39332d730de", "from": "@prestashop-core/ui-testing@https://github.com/PrestaShop/ui-testing-library#main", "requires": { "@faker-js/faker": "^9.0.3", diff --git a/tests/UI/package.json b/tests/UI/package.json old mode 100644 new mode 100755 index 45fa0f75b..cd5d1d715 --- a/tests/UI/package.json +++ b/tests/UI/package.json @@ -8,8 +8,10 @@ "lint": "eslint --ignore-path .gitignore .", "// TypeScript Check": "Script to check typescript", "check:typescript": "tsc --build ./tsconfig.json", - "// Run tests": "Script to run sanity tests", - "test:sanity": "npx playwright test --ui --headed" + "// Sanity": "Scripts to run sanity tests", + "test:sanity": "npx playwright test /sanity", + "// Functional": "Scripts to run functional tests", + "test:functional": "npx playwright test /functional" }, "keywords": [], "author": "", diff --git a/tests/UI/readme.md b/tests/UI/readme.md old mode 100644 new mode 100755 index af75b1d65..a0099373d --- a/tests/UI/readme.md +++ b/tests/UI/readme.md @@ -74,12 +74,10 @@ npx playwright install ```bash # 1 - Install a docker image of the version you need to test (for example 8.1.5 on php 7.2) PS_VERSION=8.1.5-7.2 PS_DOMAIN=localhost:9999 docker-compose -f "docker-compose.yml" up --build -# 2 - Install autoupgrade module -docker exec -t prestashop php bin/console prestashop:module install autoupgrade -# 3 - Create backup +# 2 - Create backup docker exec -t prestashop php modules/autoupgrade/bin/console backup:create admin-dev -# 4 - If you want to upgrade using channel **local** +# 3 - If you want to upgrade using channel **local** # Download local ZIP and XML of PS 8.2.0 docker exec -t prestashop curl --fail -L https://github.com/PrestaShop/zip-archives/raw/main/prestashop_8.2.0.zip -o admin-dev/autoupgrade/download/prestashop_8.2.0.zip @@ -89,19 +87,19 @@ docker exec -t prestashop sh -c "echo '{\"local\":\"online\",\"archive_zip\":\"p \"archive_xml\":\"prestashop_8.2.0.xml\",\"PS_AUTOUP_CUSTOM_MOD_DESACT\":\"true\",\"PS_AUTOUP_CHANGE_DEFAULT_THEME\" :\"false\",\"PS_AUTOUP_KEEP_IMAGES\":\"true\",\"PS_DISABLE_OVERRIDES\":\"true\"}' > modules/autoupgrade/config.json" -# 4 - If you want to upgrade using channel **online** +# 3 - If you want to upgrade using channel **online** # Create config file of new version 8.2.0 docker exec -t prestashop sh -c "echo '{\"channel\":\"online\",\"archive_zip\":\"prestashop_8.2.0.zip\", \"archive_xml\":\"prestashop_8.2.0.xml\",\"PS_AUTOUP_CUSTOM_MOD_DESACT\":\"true\",\"PS_AUTOUP_CHANGE_DEFAULT_THEME\" :\"false\",\"PS_AUTOUP_KEEP_IMAGES\":\"true\",\"PS_DISABLE_OVERRIDES\":\"true\"}' > modules/autoupgrade/config.json" -# 5 - Update to 8.2.0 +# 4 - Update to 8.2.0 docker exec -t prestashop php modules/autoupgrade/bin/console update:start --config-file-path=modules/autoupgrade/config.json --channel=online admin-dev -# 6 - Permission +# 5 - Permission docker exec -t prestashop chmod 777 -R /var/www/html/var -# 7 - If your PS start version is < 1.7.1 you should disable welcome module +# 6 - If your PS start version is < 1.7.1 you should disable welcome module docker exec -t prestashop php bin/console prestashop:module disable welcome docker exec -t prestashop chmod 777 -R /var/www/html/var ``` diff --git a/tests/UI/tsconfig.json b/tests/UI/tsconfig.json old mode 100644 new mode 100755