It's All Writing.

Writing makes you happy.

How to execute End-to-End Testing with WebdriverIO on CircleCI 2.0

It's easy way to execute Web application's End-toEnd testing that using circleci/node:latest and selenium/standalone-chrome:latest as image of Docker.

I'll show sample .circleci/config.yml as below.

version: 2
jobs:
  build:
    docker:
      - image: circleci/node:latest
      - image: selenium/standalone-chrome:latest
    steps:
      - checkout

      # Download and cache dependencies
      - restore_cache:
          keys:
          - v1-dependencies-{{ checksum "package.json" }}
          # fallback to using the latest cache if no exact match is found
          - v1-dependencies-

      - run: npm install

      - save_cache:
          paths:
            - node_modules
          key: v1-dependencies-{{ checksum "package.json" }}

      - run:
          name: Run WebdirverIO tests
          command: |
              node_modules/.bin/wdio wdio.conf.js
          no_output_timeout: 30m

      - store_test_results:
          path: ./wdio-logs

      - store_artifacts:
          path: ./screenShots/

      - store_artifacts:
          path: ./errorShots/

If you use wdio-junit-reporter as reporter of WebdriverIO, WebdriverIO outputs logs ( jUnit format ) in ./wdio-logs directory. Then CircleCI will show you reports the logs.

Also, setting -store_artifacts makes you can download screen shots and screen shots of error from Artifacts.