Skip to content
This repository has been archived by the owner on Mar 31, 2021. It is now read-only.

Commit

Permalink
7-e2e get the test into a running docker container
Browse files Browse the repository at this point in the history
  • Loading branch information
metas-ts committed Mar 14, 2019
1 parent d5eeaff commit 0d6e0ea
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 13 deletions.
17 changes: 15 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,26 @@ RUN apt-get update && apt-get -y upgrade && apt-get -y autoremove

WORKDIR /e2e

COPY .babelrc .

# I think this is needed so the npm intall will get all needed dependencies
COPY package.json .

RUN npm install --save-dev [email protected]
RUN npm install --save-dev @cypress/[email protected]
RUN npm install --save-dev @cypress/[email protected]

COPY reporter-config.json /e2e
COPY reporter-config.json .

# note: if we had a recent git version in here, we could follow https://stackoverflow.com/a/3489576 to check out the revision we need
COPY cypress-git-repo /e2e
#COPY cypress-git-repo /e2e
COPY cypress.json .
COPY src ./src
COPY cypress ./cypress

# TODO see if we really need the webpack stuff
COPY webpack.config.js .
#RUN npm install --save-dev [email protected] webpack-git-hash

# The following npm install is needed; without it, running cypress would fail as follows
# --------------
Expand All @@ -37,6 +49,7 @@ COPY cypress-git-repo /e2e
# --------------
RUN npm install


# thx to https://docs.cypress.io/guides/tooling/reporters.html#Multiple-Reporters
# mocha 6.0.0 and 6.0.1 don't work, thx to https://github.com/cypress-io/cypress/issues/3537
RUN npm install --save-dev [email protected] [email protected] [email protected]
Expand Down
22 changes: 11 additions & 11 deletions run_cypress.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,6 @@ then
export DEBUG=cypress:*
fi

cd /e2e

# write the config file used by cypress to acces the rest-API etc
echo "module.exports = {" > cypress/config.js
echo " API_URL: '${api_url}'," >> cypress/config.js
echo " PLUGIN_API_URL: '${plugin_api_url}'," >> cypress/config.js
echo " WS_URL: '${ws_url}'," >> cypress/config.js
echo " username: '${username}'," >> cypress/config.js
echo " password: '${password}'," >> cypress/config.js
echo "};" >> cypress/config.js

# start printing all bash commands from here onwards, if activated
if [ "$debug_print_bash_cmds" != "n" ];
then
Expand All @@ -61,6 +50,17 @@ then
set -x
fi

# write the config file used by cypress to acces the rest-API etc
echo "module.exports = {" > /e2e/cypress/config.js
echo " API_URL: '${api_url}'," >> /e2e/cypress/config.js
echo " PLUGIN_API_URL: '${plugin_api_url}'," >> /e2e/cypress/config.js
echo " WS_URL: '${ws_url}'," >> /e2e/cypress/config.js
echo " username: '${username}'," >> /e2e/cypress/config.js
echo " password: '${password}'," >> /e2e/cypress/config.js
echo "};" >> /e2e/cypress/config.js

cd /e2e

export CYPRESS_baseUrl=$frontend_url

# Thx to https://docs.cypress.io/guides/tooling/reporters.html#Spec-to-STDOUT-save-JUnit-XML-files
Expand Down

0 comments on commit 0d6e0ea

Please sign in to comment.