Skip to content

Commit 97d8629

Browse files
ci(end to end): Use recent playwright for workflow
1 parent c4cb5a7 commit 97d8629

File tree

1 file changed

+21
-15
lines changed

1 file changed

+21
-15
lines changed

.github/workflows/module-with-end-to-end-tests.yml

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
EXTENSION_NAME: "Okaeli_CategoryCode"
4141
EXTENSION_PATH: "category-code"
4242
EXTENSION_GITHUB_URL: "julienloizelet/magento2-category-code"
43-
EXTENSION_REF: "v1.1.12"
43+
EXTENSION_REF: "v1.1.14"
4444

4545
steps:
4646

@@ -49,6 +49,7 @@ jobs:
4949

5050
- name: Install Magento 2 with DDEV
5151
uses: ./
52+
id: magento_install
5253
with:
5354
php_version: ${{ matrix.php-version }}
5455
magento_version: ${{ matrix.m2-version }}
@@ -57,8 +58,7 @@ jobs:
5758

5859
- name: Add playwright to DDEV
5960
run: |
60-
ddev add-on get https://github.com/julienloizelet/ddev-playwright/archive/refs/tags/v1.0.2.tar.gz
61-
ddev restart
61+
ddev add-on get julienloizelet/ddev-playwright
6262
6363
- name: Clone M2 ${{ env.EXTENSION_NAME }} files
6464
uses: actions/checkout@v4
@@ -67,6 +67,9 @@ jobs:
6767
repository: ${{ env.EXTENSION_GITHUB_URL }}
6868
ref: ${{ env.EXTENSION_REF }}
6969

70+
- name: DDEV start
71+
run: ddev start
72+
7073
- name: Validate composer.json
7174
run: ddev composer validate --working-dir ./my-own-modules/${{ env.EXTENSION_PATH }}
7275

@@ -107,21 +110,24 @@ jobs:
107110
108111
- name: Prepare for playwright test
109112
run: |
110-
cp .ddev/okaeli-add-on/magento2/custom_files/varnish-profile.xml varnish-profile.xml
111-
ddev magento setup:performance:generate-fixtures ./varnish-profile.xml
112-
cd ${{ github.workspace }}/my-own-modules/${{ env.EXTENSION_PATH }}
113+
# Copy the test layout
114+
cd my-own-modules/${{ env.EXTENSION_PATH }}
113115
mkdir -p view/frontend/layout
114116
cp Test/EndToEnd/layout-update-test-file/catalog_category_code_test_code_1.xml.dist view/frontend/layout/catalog_category_code_test_code_1.xml
117+
cd ${{ github.workspace }}
118+
# Override the Playwright test folder
119+
echo -e "services:\n playwright:\n environment:\n - PLAYWRIGHT_TEST_DIR=my-own-modules/${{ env.EXTENSION_PATH }}/Test/EndToEnd" > .ddev/docker-compose.override.yaml
120+
ddev restart
121+
# Add some fixture data
122+
ddev magento setup:performance:generate-fixtures setup/performance-toolkit/profiles/ce/small.xml
123+
# Set base url in Playwright config
124+
sed -i 's|CHANGE_BASE_URL|${{ steps.magento_install.outputs.m2_url }}|g' my-own-modules/${{ env.EXTENSION_PATH }}/Test/EndToEnd/.env.example
125+
# Install Playwright
126+
ddev playwright-install
115127
ddev magento cache:flush
116-
cd ${{ github.workspace }}/my-own-modules/${{ env.EXTENSION_PATH }}/Test/EndToEnd/__scripts__
117-
chmod +x test-init.sh
118-
./test-init.sh
119-
chmod +x run-tests.sh
120128
121-
- name: Config test
122-
uses: ./.github/workflows/end-to-end/run-single-test
123-
with:
124-
test_path: ${{ github.workspace }}/my-own-modules/${{ env.EXTENSION_PATH }}/Test/EndToEnd
125-
file_path: 1-config.js
129+
- name: Run category page test
130+
run: ddev playwright test category.test
131+
126132

127133

0 commit comments

Comments
 (0)