mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-04 08:47:23 +08:00
Set checkout page before block/classic tests
This commit is contained in:
parent
e2e2897714
commit
54e740e396
5 changed files with 98 additions and 57 deletions
27
tests/playwright/utils/server.js
Normal file
27
tests/playwright/utils/server.js
Normal file
|
@ -0,0 +1,27 @@
|
|||
const { exec } = require('node:child_process');
|
||||
|
||||
/**
|
||||
* Executes the command on the server (inside DDEV). Can be called inside and outside DDEV.
|
||||
*/
|
||||
export const serverExec = async (cmd) => {
|
||||
const isDdev = process.env.IS_DDEV_PROJECT === 'true';
|
||||
if (!isDdev) {
|
||||
cmd = 'ddev exec ' + cmd;
|
||||
}
|
||||
|
||||
console.log(cmd);
|
||||
|
||||
return new Promise((resolve) => exec(cmd, (error, stdout, stderr) => {
|
||||
if (stderr) {
|
||||
console.error(stderr);
|
||||
}
|
||||
if (stdout) {
|
||||
console.log(stdout);
|
||||
}
|
||||
if (error) {
|
||||
throw error;
|
||||
} else {
|
||||
resolve(stdout);
|
||||
}
|
||||
}))
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue