Ниже я покажу как можно настроить использование Web Components Tester без использования Selenium.
package.json
Сперва следует установить следующие зависимости:
{
"name": "wct-without-selenium",
"version": "1.0.0",
"devDependencies": {
"chromedriver": "^2.27.3",
"selenium-standalone-jar": "^3.0.1",
"web-component-tester": "^4.2.0"
},
"scripts": {
"postinstall": "bash postinstall.bash"
}
}
postinstall.bash
Скрипт установки должен выглядеть следующим образом:
#!/usr/bin/env bash
# dir
mkdir node_modules/selenium-standalone/.selenium
mkdir node_modules/selenium-standalone/.selenium/selenium-server
mkdir node_modules/selenium-standalone/.selenium/chromedriver
mkdir node_modules/selenium-standalone/.selenium/geckodriver
# server.jar
cp node_modules/selenium-standalone-jar/bin/selenium-server-standalone-3.0.1.jar node_modules/selenium-standalone/.selenium/selenium-server
mv node_modules/selenium-standalone-jar/bin/selenium-server-standalone-3.0.1.jar node_modules/selenium-standalone/.selenium/selenium-server/3.0.1-server.jar
# chromedriver
cp node_modules/chromedriver/bin/chromedriver node_modules/selenium-standalone/.selenium/chromedriver
mv node_modules/selenium-standalone/.selenium/chromedriver/chromedriver node_modules/selenium-standalone/.selenium/chromedriver/2.27-x64-chromedriver
# geckodriver
cd node_modules/selenium-standalone/.selenium/geckodriver
wget https://github.com/mozilla/geckodriver/releases/download/v0.14.0/geckodriver-v0.14.0-linux64.tar.gz
gunzip geckodriver-v0.14.0-linux64.tar.gz
tar xf geckodriver-v0.14.0-linux64.tar
mv geckodriver 0.11.1-x64-geckodriver
chmod +x 0.11.1-x64-geckodriver
wct.bash
Наконец, пример запуска:
xvfb-run -a --server-args="-screen 0, 1366x768x24" ./node_modules/.bin/wct --skip-selenium-install --skip-update-check --verbose