diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 07babda2..0ecafc05 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -41,8 +41,10 @@ jobs: - run: yarn test - run: | node_modules/.bin/tsc $GITHUB_WORKSPACE/__tests__/chromedriver.ts - node_modules/.bin/ncc build $GITHUB_WORKSPACE/__tests__/chromedriver.js -o $GITHUB_WORKSPACE/__tests__ - rm -rf node_modules + # Cannot find chromedriver when using ncc. + # see https://github.com/nanasess/setup-chromedriver/issues/303 + # node_modules/.bin/ncc build $GITHUB_WORKSPACE/__tests__/chromedriver.js -o $GITHUB_WORKSPACE/__tests__ + # rm -rf node_modules - if: matrix.chrome_version != 'current' env: CHROME_VERSION: ${{ matrix.chrome_version }} @@ -70,9 +72,9 @@ jobs: - name: setup run: | export DISPLAY=:99 - chromedriver --url-base=/wd/hub & + chromedriver --verbose --url-base=/wd/hub & sudo Xvfb -ac :99 -screen 0 1280x1024x24 > /dev/null 2>&1 & # disable headless mode - node $GITHUB_WORKSPACE/__tests__/index.js + node $GITHUB_WORKSPACE/__tests__/chromedriver.js test_default_version: runs-on: ${{ matrix.os }} @@ -95,8 +97,10 @@ jobs: - run: yarn test - run: | node_modules/.bin/tsc $GITHUB_WORKSPACE/__tests__/chromedriver.ts - node_modules/.bin/ncc build $GITHUB_WORKSPACE/__tests__/chromedriver.js -o $GITHUB_WORKSPACE/__tests__ - rm -rf node_modules + # Cannot find chromedriver when using ncc. + # see https://github.com/nanasess/setup-chromedriver/issues/303 + # node_modules/.bin/ncc build $GITHUB_WORKSPACE/__tests__/chromedriver.js -o $GITHUB_WORKSPACE/__tests__ + # rm -rf node_modules - uses: ./ if: matrix.branch == 'now' - uses: nanasess/setup-chromedriver@master @@ -107,4 +111,4 @@ jobs: export DISPLAY=:99 chromedriver --url-base=/wd/hub & sudo Xvfb -ac :99 -screen 0 1280x1024x24 > /dev/null 2>&1 & # disable headless mode - node $GITHUB_WORKSPACE/__tests__/index.js + node $GITHUB_WORKSPACE/__tests__/chromedriver.js diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index fc3ca8da..43b3ec27 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -35,8 +35,10 @@ jobs: - run: yarn test - run: | node_modules/.bin/tsc $GITHUB_WORKSPACE/__tests__/chromedriver.ts - node_modules/.bin/ncc build $GITHUB_WORKSPACE/__tests__/chromedriver.js -o $GITHUB_WORKSPACE/__tests__ - rm -rf node_modules + # Cannot find chromedriver when using ncc. + # see https://github.com/nanasess/setup-chromedriver/issues/303 + # node_modules/.bin/ncc build $GITHUB_WORKSPACE/__tests__/chromedriver.js -o $GITHUB_WORKSPACE/__tests__ + # rm -rf node_modules shell: bash - shell: pwsh run: | @@ -63,7 +65,7 @@ jobs: - name: setup run: | chromedriver --url-base=/wd/hub & - node "$Env:GITHUB_WORKSPACE\__tests__\index.js" + node "$Env:GITHUB_WORKSPACE\__tests__\chromedriver.js" test_default_version: runs-on: ${{ matrix.os }} @@ -84,8 +86,10 @@ jobs: - run: yarn test - run: | node_modules/.bin/tsc $GITHUB_WORKSPACE/__tests__/chromedriver.ts - node_modules/.bin/ncc build $GITHUB_WORKSPACE/__tests__/chromedriver.js -o $GITHUB_WORKSPACE/__tests__ - rm -rf node_modules + # Cannot find chromedriver when using ncc. + # see https://github.com/nanasess/setup-chromedriver/issues/303 + # node_modules/.bin/ncc build $GITHUB_WORKSPACE/__tests__/chromedriver.js -o $GITHUB_WORKSPACE/__tests__ + # rm -rf node_modules shell: bash - uses: ./ if: matrix.branch == 'now' @@ -94,4 +98,4 @@ jobs: - name: setup run: | chromedriver --url-base=/wd/hub & - node "$Env:GITHUB_WORKSPACE\__tests__\index.js" + node "$Env:GITHUB_WORKSPACE\__tests__\chromedriver.js" diff --git a/__tests__/chromedriver.ts b/__tests__/chromedriver.ts index 4835d5fc..996222c5 100644 --- a/__tests__/chromedriver.ts +++ b/__tests__/chromedriver.ts @@ -1,5 +1,7 @@ -import { Builder, Capabilities, until, By, Key } from 'selenium-webdriver'; +import { Builder, Capabilities, until, By, Key, logging } from 'selenium-webdriver'; (async () => { + const logger = logging.getLogger('selenium'); + logger.setLevel(logging.Level.DEBUG); const timeout = 30000; const driver = new Builder() .withCapabilities(Capabilities.chrome()) diff --git a/lib/setup-chromedriver.js b/lib/setup-chromedriver.js index c53ce6d2..b0e25073 100644 --- a/lib/setup-chromedriver.js +++ b/lib/setup-chromedriver.js @@ -41,6 +41,7 @@ function run() { console.log(`##setup chromedriver`); const version = core.getInput("chromedriver-version", { required: false }); const plat = process.platform; + core.addPath('/usr/local/bin'); let arch = "linux"; switch (plat) { case "win32": diff --git a/src/setup-chromedriver.ts b/src/setup-chromedriver.ts index 5727bccd..4d661bbf 100644 --- a/src/setup-chromedriver.ts +++ b/src/setup-chromedriver.ts @@ -7,6 +7,7 @@ async function run() { console.log(`##setup chromedriver`); const version = core.getInput("chromedriver-version", { required: false }); const plat = process.platform; + core.addPath('/usr/local/bin'); let arch = "linux"; switch (plat) { case "win32":