diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index d9ceaea..0000000 --- a/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "Appium/tests/helpers/mocks"] - path = Appium/tests/helpers/mocks - url = https://github.com/jasonkarns/bats-mock diff --git a/.travis.yml b/.travis.yml index 1358991..ea06e0d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,7 +10,7 @@ before_install: script: - docker build -t "appium/appium:latest" -f Appium/Dockerfile . - - docker run --rm "appium/appium:latest" bats tests + - docker run --rm -v $PWD/Appium/tests:/root/tests "appium/appium:latest" bash tests/run-bats.sh after_success: - if [[ $TRAVIS_PULL_REQUEST == "false" ]] && [[ "$TRAVIS_TAG" != "" ]]; then diff --git a/Appium/Dockerfile b/Appium/Dockerfile index 26a0727..00274b9 100644 --- a/Appium/Dockerfile +++ b/Appium/Dockerfile @@ -26,8 +26,6 @@ WORKDIR /root # Network downloader # libqt5webkit5 # Web content engine (Fix issue in Android) -# bats -# Testing framework for Bash # libgconf-2-4 # Required package for chrome and chromedriver to run on Linux # xvfb @@ -42,7 +40,6 @@ RUN apt-get -qqy update && \ curl \ wget \ libqt5webkit5 \ - bats \ libgconf-2-4 \ xvfb \ && rm -rf /var/lib/apt/lists/* @@ -99,11 +96,6 @@ RUN echo "${TZ}" > /etc/timezone #=============== EXPOSE 4723 -#==================== -# Add Unit test file -#==================== -COPY Appium/tests /root/tests - #==================================================== # Scripts to run appium and connect to Selenium Grid #==================================================== diff --git a/Appium/tests/grid.bats b/Appium/tests/grid.bats index c141308..0062fbd 100644 --- a/Appium/tests/grid.bats +++ b/Appium/tests/grid.bats @@ -1,6 +1,6 @@ #!/usr/bin/env bats -load helpers/mocks/stub +load ../node_modules/bats-mock/stub default_node_config=\ '{ diff --git a/Appium/tests/helpers/mocks b/Appium/tests/helpers/mocks deleted file mode 160000 index db2ac2b..0000000 --- a/Appium/tests/helpers/mocks +++ /dev/null @@ -1 +0,0 @@ -Subproject commit db2ac2b3d2cb3ea80d19a44d5bf38aede07ba762 diff --git a/Appium/tests/run-bats.sh b/Appium/tests/run-bats.sh new file mode 100755 index 0000000..5ae9105 --- /dev/null +++ b/Appium/tests/run-bats.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +#Install bats +echo "Installing Bats before test execution" +npm install bats@0.4.2 +npm install bats-mock@1.0.1 + +#Run tests +./node_modules/.bin/bats /root/tests/*.bats