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

ChromeDriver 설치

Change directory to a temp folder.

...

설치 확인

chromedriver --version

google chrome 설치

go to temp

cd /tmp/

Install using curl

...

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"
  },

...

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

Failed

...