PluginProbe
Elementor Website Builder – more than just a page builder / 3.32.5
Elementor Website Builder – more than just a page builder v3.32.5
4.3.0-beta2 4.3.0-beta1 4.2.4 4.2.3 4.2.2 4.2.1 4.2.0 4.1.5 4.2.0-beta2 4.2.0-dev2 4.2.0-beta1 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0 4.1.0-beta3 4.1.0-dev3 4.0.9 4.1.0-beta2 4.1.0-dev2 4.0.8 4.1.0-beta1 4.1.0-dev1 4.0.7 All 451 releases
elementor / run-on-linux.js

run-on-linux.js in Elementor Website Builder – more than just a page builder 3.32.5, at run-on-linux.js

45 lines 1.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 const { spawn, exec } = require( 'child_process' );
2 const packageJson = require( './package.json' );
3
4 function isDockerExist() {
5 return new Promise( ( resolve ) => {
6 exec( 'docker -v', ( error ) => {
7 resolve( ! error );
8 } );
9 } );
10 }
11
12 async function run( tag ) {
13 const playwrightVersion = packageJson.devDependencies[ '@playwright/test' ];
14 const workingDir = process.cwd();
15
16 const command = 'docker run';
17 const options = [
18 '--rm',
19 '--network host',
20 `--volume ${ workingDir }:/work`,
21 '--workdir /work/',
22 '--interactive',
23 process.env.CI ? '' : '--tty',
24 ];
25 const image = `mcr.microsoft.com/playwright:v${ playwrightVersion.replace( '^', '' ) }-jammy`;
26 const commandToRun = `/bin/bash -c "npm run test:playwright -- --grep="${ tag }""`;
27
28 spawn( `${ command } ${ options.join( ' ' ) } ${ image } ${ commandToRun }`, {
29 stdio: 'inherit',
30 stderr: 'inherit',
31 shell: true,
32 } );
33 }
34
35 ( async () => {
36 if ( ! await isDockerExist() ) {
37 // eslint-disable-next-line no-console
38 console.error( 'Docker is not installed, please install it first.' );
39
40 process.exit( 1 );
41 }
42
43 await run( process.argv.slice( 2 ) );
44 } )();
45