|
56 | 56 | | `GITHUB_USER_NAME` | Username for the GitHub user configuration | |
57 | 57 | | `GITHUB_USER_SSH_KEY` | Private SSH key associated with the GitHub user passed as `GITHUB_USER_NAME` | |
58 | 58 |
|
59 | | -**Example with configuration parameters:** |
| 59 | +## Example with configuration parameters |
60 | 60 |
|
61 | 61 | ```yml |
62 | 62 | name: E2E Testing |
|
90 | 90 | NPM_REGISTRY_TOKEN: ${{ secrets.DEPLOYBOT_PACKAGES_READ_ACCESS_TOKEN}} |
91 | 91 | ``` |
92 | 92 |
|
93 | | -**Example with custom inputs:** |
| 93 | +## Example with custom inputs |
94 | 94 |
|
95 | 95 | ```yml |
96 | 96 | name: E2E Testing |
@@ -127,11 +127,75 @@ jobs: |
127 | 127 | NPM_REGISTRY_TOKEN: ${{ secrets.DEPLOYBOT_PACKAGES_READ_ACCESS_TOKEN}} |
128 | 128 | ``` |
129 | 129 |
|
130 | | -**Example of secrets:** |
| 130 | +## Example of secrets |
131 | 131 |
|
132 | 132 | For `ENV_FILE_DATA`: |
133 | 133 |
|
134 | | -```SHELL |
135 | | -TEST_EXEC_KEY=YOUR-KEY |
136 | | -WP_BASE_URL=https://example.com |
| 134 | +```bash |
| 135 | +# playwright-utils config |
| 136 | +WP_BASE_URL='http://mywp.site' |
| 137 | +WP_USERNAME=admin |
| 138 | +WP_PASSWORD=password |
| 139 | +WP_BASIC_AUTH_USER=admin |
| 140 | +WP_BASIC_AUTH_PASS=password |
| 141 | +STORAGE_STATE_PATH='./storage-states' |
| 142 | +STORAGE_STATE_PATH_ADMIN='./storage-states/admin.json' |
| 143 | +WORDPRESS_DB_USER=root |
| 144 | +WORDPRESS_DB_PASSWORD=password |
| 145 | +
|
| 146 | +WPCLI_ENV_TYPE= # localhost, vip, wpenv, ddev, ssh |
| 147 | +WPCLI_PATH= # for localhost, wpenv |
| 148 | +# For WPCLI_ENV_TYPE=ssh |
| 149 | +SSH_LOGIN= |
| 150 | +SSH_HOST= |
| 151 | +SSH_PORT= |
| 152 | +SSH_PATH= |
| 153 | +# For WPCLI_ENV_TYPE=vip |
| 154 | +VIP_APP= |
| 155 | +VIP_ENV= |
| 156 | +
|
| 157 | +# WooCommerce specific env vars |
| 158 | +WC_API_KEY= |
| 159 | +WC_API_SECRET= |
| 160 | +WC_DEFAULT_COUNTRY=usa |
| 161 | +WC_DEFAULT_CURRENCY=USD |
| 162 | +
|
| 163 | +# Xray in Jira |
| 164 | +XRAY_CLIENT_ID= |
| 165 | +XRAY_CLIENT_SECRET= |
| 166 | +TEST_EXEC_KEY= |
137 | 167 | ``` |
| 168 | + |
| 169 | +## Examples of `PRE_SCRIPT` |
| 170 | + |
| 171 | +### VIP connection |
| 172 | + |
| 173 | +```bash |
| 174 | +PRE_SCRIPT: | |
| 175 | + npm install -g @automattic/vip |
| 176 | + mkdir -p ~/.config/configstore |
| 177 | + echo '{"vip-go-cli": "'"$VIP_TOKEN"'"}' > ~/.config/configstore/vip-go-cli.json |
| 178 | +``` |
| 179 | + |
| 180 | +### Distributing vars per env |
| 181 | + |
| 182 | +In case of several test environments (staging, production, etc.) `PRE_SCRIPT` can be used to setup env-specific vars from `ENV_FILE_DATA`. For example `PERCY_TOKEN`: |
| 183 | + |
| 184 | +```bash |
| 185 | +PRE_SCRIPT: | |
| 186 | + echo "PERCY_TOKEN=$PERCY_TOKEN_STAGE" >> "$GITHUB_ENV" |
| 187 | +``` |
| 188 | + |
| 189 | +### Download and zip plugin artifact |
| 190 | + |
| 191 | +For cases when plugin is built within the same workflow: |
| 192 | + |
| 193 | +```bash |
| 194 | +PRE_SCRIPT: | |
| 195 | + gh run download ${{ github.run_id }} -p "woocommerce-paypal-payments-*" -D tests/qa/resources/files |
| 196 | + cd tests/qa/resources/files |
| 197 | + mv woocommerce-paypal-payments-*/woocommerce-paypal-payments . |
| 198 | + zip -r woocommerce-paypal-payments.zip woocommerce-paypal-payments |
| 199 | + rm -rf woocommerce-paypal-payments woocommerce-paypal-payments-*/ |
| 200 | +``` |
| 201 | + |
0 commit comments