From 90e650df2ea3f65b9ab957ee5a84b909ba6f3808 Mon Sep 17 00:00:00 2001 From: davert Date: Wed, 18 Sep 2024 22:54:12 +0300 Subject: [PATCH] updated the way playwright server started --- .github/workflows/webdriver-chrome.yml | 4 +++- package.json | 8 +++++++- src/Playwright.php | 2 +- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.github/workflows/webdriver-chrome.yml b/.github/workflows/webdriver-chrome.yml index 459b602..f58dfbd 100644 --- a/.github/workflows/webdriver-chrome.yml +++ b/.github/workflows/webdriver-chrome.yml @@ -17,7 +17,7 @@ jobs: - uses: actions/setup-node@v4 with: node-version: lts/* - - name: Install NPM dependencies + - name: Install dependencies run: npm i - name: Install Playwright Browsers @@ -42,6 +42,8 @@ jobs: - name: Start dev server run: php -S 127.0.0.1:8000 -t tests/data/app >/dev/null 2>&1 & + - name: Start playwright proxy server + run: node server.js >/dev/null 2>&1 & - name: Tests run: php ./vendor/bin/codecept run diff --git a/package.json b/package.json index 0eb1ed6..4634089 100644 --- a/package.json +++ b/package.json @@ -4,11 +4,17 @@ "description": "", "main": "server.js", "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" + "post-install-cmd": [ + "npm install codeception-module-playwright" + ], + "post-update-cmd": [ + "npm install codeception-module-playwright" + ] }, "bin": { "codeception-module-playwright": "./server.js" }, + "keywords": [], "author": "", "license": "ISC", diff --git a/src/Playwright.php b/src/Playwright.php index 60643fb..6a0dc24 100644 --- a/src/Playwright.php +++ b/src/Playwright.php @@ -37,7 +37,7 @@ class Playwright extends Module public function _initialize() { if ($this->config['pw_start']) { - $process = new Process(['npx', self::NPM_PACKAGE]); + $process = new Process(['npx', '-y', self::NPM_PACKAGE]); $process->start(); sleep(2);