Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »


Install

yarn install chrome driver geckodriver selenium-side-runner selenium-webdriver

When faced jest envrioment error.

  "jest": {
    "setupFiles": [
      "./test/jestsetup.js"
    ],
    // "snapshotSerializers": [
    //  "enzyme-to-json/serializer"
    // ],
    "testEnvironment": "jest-environment-selenium",
    "setupTestFrameworkScriptFile": "jest-environment-selenium/dist/setup.js"
  },

Install in AWS EC2-user

Installing ChromeDriver

  1. Change directory to a temp folder.

  2. Get ChromeDriver using wget

  3. Unzip ChromeDriver

  4. Move ChromeDriver to the bin applications folder.

# move to /tmp
cd/tmp/

# download chrome driver 
sudo wget https://chromedriver.storage.googleapis.com/83.0.4103.39/chromedriver_linux64.zip

unzip chromedriver_linux64.zip

sudo mv chromedriver /usr/bin/chromedriver

# check version
chromedriver --version

Install google chrome

  1. move to temp

  2. install using wget

# move to /tmp
cd/tmp/

# download google chrome
curl https://intoli.com/install-google-chrome.sh | bash

sudo mv /usr/bin/google-chrome-stable /usr/bin/google-chrome

# check version
google-chrome --version && which google-chrome


The configuration

has been configured Chrome for Linux, Firefox for UI tester.

pacakge.json

Attach script on pacakge.json

"scripts": {
  "test-chrome:dev": "selenium-side-runner --debug --timeout 30000 --config-file selenium/config/chrome-dev.yml selenium/*.side",
  "test-chrome:stg": "selenium-side-runner --debug --timeout 30000 --config-file selenium/config/chrome-stg.yml selenium/*.side",
  "test-firefox:dev": "selenium-side-runner --debug --timeout 30000 --config-file selenium/config/firefox-dev.yml selenium/*.side",
  "test-firefox:stg": "selenium-side-runner --debug --timeout 30000 --config-file selenium/config/firefox-stg.yml selenium/*.side"
}

Set yml

  1. create folder selenium/config

  2. make chrome-dev.yml, chrome-stg.yml

  3. make firefox-dev.yml, firefox-stg.yml

# chrome-dev.yml
capabilities:
  browserName: "chrome"
  goog:chromeOptions:
    args: 
      - headless
      - no-sandbox
      - disable-infobars
      - disable-gpu
      - disable-dev-shm-usage
baseUrl: "http://dev-builder.justten.io"

# firefox-dev.yml
capabilities:
  browserName: "firefox"
baseUrl: "http://dev-builder.justten.io/"


Run

move inside project

run cli

yarn run test-chrome:dev


Result

Success

Failed

  • No labels