-
Notifications
You must be signed in to change notification settings - Fork 153
228 lines (198 loc) · 8.23 KB
/
e2e-wpuf.yml
File metadata and controls
228 lines (198 loc) · 8.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
name: Playwright tests/e2e
on:
workflow_dispatch:
inputs:
testsuite:
description: 'Test suite to run'
required: true
default: 'E2E'
type: choice
options:
- 'E2E'
schedule:
# 1:00 AM Bangladesh Time
- cron: '0 19 * * 0'
push:
branches: ['develop']
pull_request:
branches: ['develop']
jobs:
test:
if: github.repository != 'weDevsOfficial/wp-user-frontend' && github.repository != 'weDevsOfficial/wpuf-pro'
timeout-minutes: 240
runs-on: ubuntu-22.04
steps:
# Setup PHP
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: "7.4"
# Checkout WP-User-Frontend repo
- name: Checkout testing repo
id: clone-wp-user-frontend
uses: actions/checkout@v4
# Use desired version of NodeJS
- name: Use desired version of NodeJS
uses: actions/setup-node@v4
with:
node-version: 24
cache: npm
# Clone wpuf-pro
- name: Clone wpuf-pro
id: clone-wpuf-pro
uses: actions/checkout@v4
with:
repository: weDevsOfficial/wpuf-pro
token: ${{ secrets.ACCESS_TOKEN }}
path: plugins/wpuf-pro
ref: develop
# Build wpuf-pro
- name: Build WPUF-pro
working-directory: plugins/wpuf-pro
run: |
composer i --no-dev -o
composer update --no-dev -o
npm i --legacy-peer-deps
grunt --force
# Build wp-user-frontend
- name: Build wpuf-lite
run: |
composer i --no-dev -o
composer update --no-dev -o
npm i
npm run build
grunt release --force
grunt --force
# Install test dependencies with performance optimizations
- name: Install test dependencies
working-directory: tests/e2e
run: |
npm ci --prefer-offline --no-audit --no-fund
- name: Install Plugins
working-directory: plugins/
run: |
# Download and extract WP Mail Log
wget https://downloads.wordpress.org/plugin/wp-mail-log.latest-stable.zip
unzip wp-mail-log.latest-stable.zip
rm wp-mail-log.latest-stable.zip
# Download and extract WooCommerce
wget https://downloads.wordpress.org/plugin/woocommerce.latest-stable.zip
unzip woocommerce.latest-stable.zip
rm woocommerce.latest-stable.zip
# Download and extract Easy Digital Downloads
wget https://downloads.wordpress.org/plugin/easy-digital-downloads.latest-stable.zip
unzip easy-digital-downloads.latest-stable.zip
rm easy-digital-downloads.latest-stable.zip
# Download and extract WC Vendors
wget https://downloads.wordpress.org/plugin/wc-vendors.latest-stable.zip
unzip wc-vendors.latest-stable.zip
rm wc-vendors.latest-stable.zip
# Download and extract WC Multivendor Membership
wget https://downloads.wordpress.org/plugin/wc-multivendor-membership.latest-stable.zip
unzip wc-multivendor-membership.latest-stable.zip
rm wc-multivendor-membership.latest-stable.zip
# Download and extract Dokan
wget https://downloads.wordpress.org/plugin/dokan-lite.latest-stable.zip
unzip dokan-lite.latest-stable.zip
rm dokan-lite.latest-stable.zip
# # Download and extract The Events Calendar
# wget https://downloads.wordpress.org/plugin/the-events-calendar.latest-stable.zip
# unzip the-events-calendar.latest-stable.zip
# rm the-events-calendar.latest-stable.zip
# Start wordpress environment
- name: Start WordPress Env and Show URL
id: wp-env
if: success()
uses: nick-fields/retry@v3
with:
timeout_minutes: 4
max_attempts: 2
retry_on: error
command: |
cd tests/e2e
npx wp-env start
# Cache browser binaries, cache key is based on Playwright version and OS
- name: Cache playwright binaries
id: playwright-cache
uses: actions/cache@v4
with:
path: |
~/.cache/ms-playwright
key: ${{ runner.os }}-playwright-${{ env.PLAYWRIGHT_VERSION }}
restore-keys: |
${{ runner.os }}-playwright-
# Install browser binaries & OS dependencies if cache missed
- name: Install Playwright browser binaries & OS dependencies
id: pw-install
if: steps.playwright-cache.outputs.cache-hit != 'true'
working-directory: tests/e2e
run: |
npx playwright install chromium --with-deps
# Run Playwright tests/e2e
- name: 🧪 Run e2e tests
env:
CI: true
# Test environment variables
BASE_URL: ${{ secrets.QA_BASE_URL }}
ADMIN_USERNAME: ${{ secrets.QA_ADMIN_USERNAME }}
ADMIN_PASSWORD: ${{ secrets.QA_ADMIN_PASSWORD }}
WPUF_PRO_LICENSE_KEY: ${{ secrets.WPUF_PRO_LICENSE_KEY }}
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
GOOGLE_MAP_API_KEY: ${{ secrets.GOOGLE_MAP_API_KEY }}
RECAPTCHA_SITE_KEY: ${{ secrets.RECAPTCHA_SITE_KEY }}
RECAPTCHA_SECRET_KEY: ${{ secrets.RECAPTCHA_SECRET_KEY }}
CLOUDFLARE_TURNSTILE_SITE_KEY: ${{ secrets.CLOUDFLARE_TURNSTILE_SITE_KEY }}
CLOUDFLARE_TURNSTILE_SECRET_KEY: ${{ secrets.CLOUDFLARE_TURNSTILE_SECRET_KEY }}
if: success() && (github.event_name != 'workflow_dispatch' || ( github.event_name == 'workflow_dispatch' && (github.event.inputs.testsuite == 'E2E' || github.event.inputs.testsuite == 'All')))
working-directory: tests/e2e
run: |
mkdir -p test-results
npm run test:sharded:ci
# continue-on-error: true
# Generate and post advanced test summary
- name: Generate and post advanced test summary
if: always()
working-directory: tests/e2e
run: npm run sharded-summary
# ✅ Upload Playwright HTML report (always)
- name: Upload Playwright HTML Report
if: always()
uses: actions/upload-artifact@v4
with:
name: playwright-report
path: |
tests/e2e/playwright-report/
tests/e2e/test-results/
retention-days: 1
# Send Email Report if passed
- name: Send Test Report on email (Passed)
if: success()
uses: dawidd6/action-send-mail@v3
with:
server_address: smtp.gmail.com
server_port: 465
username: ${{ secrets.SMTP_EMAIL_USERNAME }}
password: ${{ secrets.SMTP_EMAIL_PASSWORD }}
subject: ${{ github.job }} job of ${{ github.repository }} has ${{ job.status }}
body: |
${{ github.job }} job in workflow ${{ github.workflow }} of ${{ github.repository }} has ${{ job.status }}.
Test was conducted on WPUF plugin.
To View full test run, click on the following link: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
to: rubaiyat.mohammad@wedevs.com, anik@wedevs.com
from: wedevs.testing1@gmail.com
# Send Email Report if failed
- name: Send Test Report on email (Failed)
if: failure()
uses: dawidd6/action-send-mail@v3
with:
server_address: smtp.gmail.com
server_port: 465
username: ${{ secrets.SMTP_EMAIL_USERNAME }}
password: ${{ secrets.SMTP_EMAIL_PASSWORD }}
subject: ${{ github.job }} job of ${{ github.repository }} has ${{ job.status }}
body: |
${{ github.job }} job in workflow ${{ github.workflow }} of ${{ github.repository }} has ${{ job.status }}.
Test was conducted on WPUF plugin.
To View full test run, click on the following link: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
to: rubaiyat.mohammad@wedevs.com
from: wedevs.testing1@gmail.com