Reputation: 11
I am trying to do automated end-to-end tests using Protractor+SauceLabs, in a Docker container, and am getting 'Error message: No update-config.json found. Run 'webdriver-manager update' to download binaries.' I am now running 'webdriver-manager update --standalone false' before running the end-toend tests, (standalone because I don't need the standalone version which would also require java). Interestingly, (can see in command line output below) that command works and I can actually find the update-config.json file, however I still get the same error. This may just be a bug with protractor, but I wanted to check on Stack Overflow first. Any help would be greatly appreciated, thanks!
Oh and of course the tests work locally even when I delete nodemodules, and run npm install, and npm run e2e sauce, OR clear them, do npm install, npm run webdriver-update, and npm run e2e-sauce.
Relevant Dependencies "@angular/cli": "1.6.6", "node": "8.10.0", "npm": "5.6.0", "protractor": "5.1.2", "ts-node": "4.1.0",
package.json commands:
"e2e-sauce": "ng e2e --port 8100 --env test --sauce",
"webdriver-update": "webdriver-manager update --standalone false --gecko false",
the bash script I am running:
# for testing purposes, normally environment variable
GIT_COMMIT=aTestCommit;
if [[ -z $GIT_COMMIT ]]; then
echo "\$GIT_COMMIT environment variable is required!";
exit 1;
fi
function cleanup {
docker rm -f $GIT_COMMIT
}
trap cleanup EXIT INT TERM
COMMAND=""
COMMAND+="npm run webdriver-update"
COMMAND+=" && ls ./node_modules/protractor/node_modules/webdriver-manager/selenium"
COMMAND+=" && ng e2e --port 8100 --env test --sauce"
set -ex
docker-compose create --build builder
docker-compose run --name $GIT_COMMIT builder bash -c "$COMMAND"
DockerFile:
FROM node:8
# Install Chrome
RUN \
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - && \
echo "deb http://dl.google.com/linux/chrome/deb/ stable main" > /etc/apt/sources.list.d/google.list && \
apt-get update && \
apt-get install -y google-chrome-stable && \
rm -rf /var/lib/apt/lists/*
# Set the working directory to /app
WORKDIR /app
# Give the node user access to /usr/local
RUN chown -R node:node /usr/local
# Give the node user access to /usr/local
RUN chown -R node:node /app
# Change to the node user
USER node
# Install the Angular CLI globally
RUN npm install -g @angular/[email protected]
# Add the package.json and the package-lock.json to the container at /app
COPY package.json package-lock.json ./
# Install dependencies called out in the package.json
RUN npm install
# Add angular-cli karma and typescript configs to the container at /app
COPY .angular-cli.json karma.conf.js tsconfig.json tslint.json protractor.conf.js ./
# Add the app src to the container at /app/src
COPY src ./src
# Add the e2e tests to the container at /app/e2e
COPY e2e ./e2e
Command line output on running my bash script:
> webdriver-manager update --standalone false
[18:04:49] I/file_manager - creating folder /app/node_modules/protractor/node_modules/webdriver-manager/selenium
[18:04:56] I/update - chromedriver: unzipping chromedriver_2.37.zip
[18:04:56] I/update - chromedriver: setting permissions to 0755 for /app/node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_2.37
[18:05:01] I/update - geckodriver: unzipping geckodriver-v0.20.1.tar.gz
[18:05:01] I/update - geckodriver: setting permissions to 0755 for /app/node_modules/protractor/node_modules/webdriver-manager/selenium/geckodriver-v0.20.1
chrome-response.xml gecko-response.json update-config.json
chromedriver_2.37 geckodriver-v0.20.1
chromedriver_2.37.zip geckodriver-v0.20.1.tar.gz
The option '--sauce' is not registered with the e2e command. Run `ng e2e --help` for a list of supported options.
** NG Live Development Server is listening on localhost:8100, open your browser on https://localhost:8100/ **
10% building modules 3/3 modules 0 activeGenerating SSL Certificate s
Date: 2018-04-12T18:05:18.269Z i Hash: b57e600f446f16a8f14c
Time: 13770ms
chunk {inline} inline.bundle.js, inline.bundle.js.map (inline) 5.83 kB [entry] [rendered]
chunk {main} main.bundle.js, main.bundle.js.map (main) 130 kB [initial] [rendered]
chunk {polyfills} polyfills.bundle.js, polyfills.bundle.js.map (polyfills) 323 kB [initial] [rendered]
chunk {styles} styles.bundle.js, styles.bundle.js.map (styles) 17.6 kB [initial] [rendered]
chunk {transactions.module} transactions.module.chunk.js, transactions.module.chunk.js.map () 1.17 MB [rendered]
chunk {vendor} vendor.bundle.js, vendor.bundle.js.map (vendor) 4.11 MB [initial] [rendered]
(node:31) [DEP0022] DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead.
webpack: Compiled successfully.
[18:05:18] I/update - chromedriver: file exists /app/node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_2.37.zip
[18:05:18] I/update - chromedriver: unzipping chromedriver_2.37.zip
[18:05:18] I/update - chromedriver: setting permissions to 0755 for /app/node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_2.37
[18:05:18] I/update - chromedriver: chromedriver_2.37 up to date
[18:05:18] I/launcher - Running 1 instances of WebDriver
[18:05:18] E/local - Error code: 135
[18:05:18] E/local - Error message: No update-config.json found. Run 'webdriver-manager update' to download binaries.
[18:05:18] E/local - Error: No update-config.json found. Run 'webdriver-manager update' to download binaries.
Upvotes: 1
Views: 1193
Reputation: 11
Discovered that it was because I was not using the standalone version of selenium (I shouldn't have used '--standalone false'). After removing that line and install java in my Dockerfile it worked like a dream.
Upvotes: 0
Reputation: 13712
The root cause is angular cli ng e2e
will execute webdriver-manager update
as default.
And you use global angular cli not the project local one, so it will try to use global webdriver-manager
to execute update, but you did not install global webdriver-manager
, so ng e2e
report Error: No update-config.json found
.
Two options to fix your problem:
Option 1: Disable webdriver-manager update
of ng e2e
by add --wu false
COMMAND+=" && ng e2e --port 8100 --env test --sauce --wu false"
But you need to update webdriver by yourself, like you did so far.
Option2: Install angular cli as project local package, not global package, by remove -g
option
# Install the Angular CLI globally
RUN npm install @angular/[email protected]
Upvotes: 0