Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Table of Contents

...

...

Selenium 설치

UI 프로젝트에 selenium node 모듈 추가

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

When faced jest envrioment error.

ChromeDriver 설치

Change directory to a temp folder.

cd /tmp/

Get ChromeDriver using wget

sudo wget https://chromedriver.storage.googleapis.com/89.0.4389.23/chromedriver_linux64.zip

Unzip ChromeDriver

unzip chromedriver_linux64.zip

Move ChromeDriver to the bin applications folder.

sudo mv chromedriver /usr/bin/chromedriver

설치 확인

chromedriver --version

google chrome 설치

go to temp

cd /tmp/

Install using curl

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

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

설치 확인

google-chrome --version && which google-chrome

Jest 에러 발생시 설정 추가

Code Block
  "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.

Code Block
# 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

Code Block
# 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

...

Selenium 설정

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

pacakge.json

Attach script on pacakge.json

Code Block
"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

...

Code Block
# 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

Image RemovedImage Added

Failed

...

...