Skip to content

Commit fe9570c

Browse files
committed
Add reporting
1 parent 4e3eb98 commit fe9570c

1 file changed

Lines changed: 31 additions & 15 deletions

File tree

.github/workflows/playwright.yml

Lines changed: 31 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ jobs:
66
runs-on: ubuntu-latest
77
container:
88
image: yireo/magento2playwright:2.4.8-p3
9-
9+
1010
env:
1111
GIT_DEPTH: 1
1212
GIT_STRATEGY: fetch
@@ -85,36 +85,36 @@ jobs:
8585
if: env.SKIP_JOB != 'true'
8686
run: |
8787
cd /tmp/magento
88-
88+
8989
if [ -n "${GITLAB_TOKEN}" ]; then
9090
composer config gitlab-domains gitlab.yireo.com
9191
composer config --global --auth http-basic.gitlab.yireo.com yireo "${GITLAB_TOKEN}"
9292
composer config repositories.loki-third-party composer https://gitlab.yireo.com/api/v4/group/loki-third-party/-/packages/composer/packages.json
9393
composer config repositories.loki-checkout composer https://gitlab.yireo.com/api/v4/group/loki-checkout/-/packages/composer/packages.json
9494
fi
95-
95+
9696
test -f "$GITHUB_WORKSPACE/.github/workflows/composer-additional.sh" && source "$GITHUB_WORKSPACE/.github/workflows/composer-additional.sh"
9797
test -f "$GITHUB_WORKSPACE/.github/workflows/composer-${MAGENTO_VERSION}.sh" && source "$GITHUB_WORKSPACE/.github/workflows/composer-${MAGENTO_VERSION}.sh"
98-
98+
9999
composer config repositories.local-source "{\"type\": \"path\", \"url\": \"$GITHUB_WORKSPACE\", \"options\": {\"symlink\": false}}"
100100
composer require --prefer-source -- "${COMPOSER_NAME}:@dev" loki-checkout/magento2-core-cli:@dev loki-checkout/magento2-functional-tests:@dev yireo/magento2-enable-module-sequence
101-
101+
102102
$GITHUB_WORKSPACE/.github/workflows/magento-install.sh
103-
103+
104104
bin/magento deploy:mode:set developer
105105
bin/magento module:enable Yireo_EnableModuleSequence
106106
bin/magento module:sequence LokiCheckout_FunctionalTests
107107
bin/magento module:sequence LokiCheckout_CoreCli
108108
bin/magento module:sequence "${MAGENTO_MODULE}"
109109
bin/magento setup:upgrade
110110
bin/magento loki-checkout:modules:dump
111-
111+
112112
magerun2 config:store:set loki_functional_tests/general/token loki -n
113-
113+
114114
echo "Copying Magento to workspace..."
115115
mkdir -p $GITHUB_WORKSPACE/magento/
116116
cp -R /tmp/magento/* $GITHUB_WORKSPACE/magento/
117-
117+
118118
echo "Magento setup complete"
119119
120120
- name: Verify Magento installation
@@ -131,22 +131,38 @@ jobs:
131131
echo "Starting Playwright tests..."
132132
echo "GITHUB_WORKSPACE: $GITHUB_WORKSPACE"
133133
echo "MAGENTO_MODULE: $MAGENTO_MODULE"
134-
134+
135135
if [ ! -d "$GITHUB_WORKSPACE/magento" ]; then
136136
echo "ERROR: magento directory not found"
137137
exit 1
138138
fi
139-
139+
140140
echo "Navigating to Playwright test directory..."
141141
cd $GITHUB_WORKSPACE/magento/vendor/loki-checkout/magento2-functional-tests/Test/Playwright/
142-
142+
143143
echo "Installing npm dependencies..."
144144
npm install
145145
npx playwright install chromium
146-
146+
147147
echo "Creating .env file..."
148148
printf "TEST_URL=http://127.0.0.1:8888\nTEST_TOKEN=loki\n" > .env
149149
cat .env
150-
150+
151151
echo "Running Playwright tests for project: ${MAGENTO_MODULE}"
152-
MAGENTO_ROOT=$GITWORK_WORKSPACE/magento npx playwright test --project=${MAGENTO_MODULE}
152+
CI=true MAGENTO_ROOT=$GITWORK_WORKSPACE/magento npx playwright test --project=${MAGENTO_MODULE}
153+
154+
- name: Upload Playwright report
155+
if: ${{ !cancelled() }}
156+
uses: actions/upload-artifact@v4
157+
with:
158+
name: playwright-report
159+
path: playwright-report/
160+
retention-days: 14
161+
162+
- name: Upload raw test results
163+
if: ${{ failure() }}
164+
uses: actions/upload-artifact@v4
165+
with:
166+
name: test-results
167+
path: test-results/
168+
retention-days: 14

0 commit comments

Comments
 (0)