Skip to content
This repository has been archived by the owner on Apr 21, 2020. It is now read-only.

Testing WebDriverIO #43

Merged
merged 78 commits into from
Mar 7, 2017
Merged

Testing WebDriverIO #43

merged 78 commits into from
Mar 7, 2017

Conversation

ordavidil
Copy link
Contributor

#29


apt-get install openjdk-7-jre-headless -y

# Install Selenium.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

selenium isn't needed for the tests, as they run via Chrome driver directly.

@amitaibu
Copy link
Member

@ordavidil maybe instead of trying to install Chrome, you can use another docker container for this. See, which is using https://github.com/elgalu/docker-selenium. Otherwise, maybe that repo can at least act as a source to see how do it.

@ordavidil
Copy link
Contributor Author

ordavidil commented Feb 21, 2017

@ItamarGronich
Check this PR ^^

also you might want to check this one:
https://hub.docker.com/r/casperlai/docker-webdriverio/

@AronNovak
Copy link
Member

@ordavidil It seems i can start it now, not sure if i will have a clean timeslot now, but just took a look.
So

 > Test WebDriverIO. 
[07:31:28] Using gulpfile /var/www/html/Server/client/gulpfile.js

ERROR: Couldn't initialise service "phantomjs".
Error: Cannot find module 'wdio-phantomjs-service'

...
   at process.<anonymous> (/var/www/html/Server/client/node_modules/webdriverio/build/lib/runner.js:749:22)
...
The command "$TRAVIS_BUILD_DIR/ci-scripts/test_server.sh" exited with 1.

What's on those lines from the build output, it sums up the issue nicely, right?

@amitaibu
Copy link
Member

when chrome driver isn't running, it's falling back to phantomjs

@AronNovak
Copy link
Member

Ok, thanks. Right now I try to see the very same fail at localhost:

 aaron   29-webdriverio-travis  ⋯  drupal-elm-starter  ci-scripts  docker_files  docker build -t "gizra:drupal-elm-starter" .
Sending build context to Docker daemon 14.85 kB
Step 0 : FROM gizra/drupal-lamp
 ---> 0a63954adc6f
Step 1 : ADD $TRAVIS_BUILD_DIR /var/www/html/Server
 ---> Using cache
 ---> 5b663a5c8236
Step 2 : WORKDIR /var/www/html/Server
 ---> Using cache
 ---> 812c0137bbf2
Step 3 : RUN chmod +x /var/www/html/Server/ci-scripts/docker_files/run.sh
 ---> Running in 544d5945b694
chmod: cannot access '/var/www/html/Server/ci-scripts/docker_files/run.sh': No such file or directory
The command '/bin/sh -c chmod +x /var/www/html/Server/ci-scripts/docker_files/run.sh' returned a non-zero code: 1

But it fails to build an image from the Dockerfile. Any hints? Thanks!

@ordavidil
Copy link
Contributor Author

@AronNovak
what's the command you invoke in order to build the image?
and what's the command to run the container ?

@AronNovak
Copy link
Member

I am at the point just to build the image, the command is: docker build -t "gizra:drupal-elm-starter" .
And i am in /home/aaron/gizra/drupal-elm-starter/ci-scripts/docker_files

@ordavidil
Copy link
Contributor Author

ordavidil commented Feb 23, 2017

Build the image:

docker build -t server -f ci-scripts/docker_files/Dockerfile .

Run the container:

docker run -it -p 8080:80 -e BUILD_WEBDRIVERIO=1 server
  • Run from the ROOT directory.

@amitaibu
Copy link
Member

@AronNovak ^^ I think worth adding this info to the README under /ci-scripts

@amitaibu
Copy link
Member

amitaibu commented Mar 6, 2017

Worth contacting them to ask

@AronNovak
Copy link
Member

@amitaibu @ordavidil Thanks for the feedback, I go ahead and I contact Travis about this issue and going to make the other two builds pass in the meantime of course..

@AronNovak
Copy link
Member

Mail sent to Travis support, and other 2 tests were fixed:
fail
On hold until received answer about the cross-container communication issue.

@amitaibu
Copy link
Member

amitaibu commented Mar 6, 2017

On hold until received answer about the cross-container communication issue.

They probably won't know how to answer. The support should be about how to allow us to debug a Travis instance (they have a way of letting you to ssh into the box)

@AronNovak
Copy link
Member

Indeed, thanks for the notice, then I just did a follow-up on the thread mentioning that debugging (SSH, etc) would be sufficient help for us.

@AronNovak
Copy link
Member

The support was swift, they enabled us to debug the build with SSH, so hopefully we will be able to soon solve this, I tested the SSH access, it works like a charm, the only limitation is that only one SSH session is enabled, but there are workarounds for that, for instance tmux, as i will need to issue docker commands while docker-compose up is running.

@AronNovak
Copy link
Member

We're one step further. one of the tests passes at Travis server:
pass-fail

There was a timing issue, at localhost, everything completed faster, at Travis, as we send gulp to the background, we started to test even before the application was up and running via gulp.

@amitaibu
Copy link
Member

amitaibu commented Mar 7, 2017

nice!

Usually, on travis we gulp and then curl the url until we get a 200

@AronNovak
Copy link
Member

Tests are passing, I am doing some improvements like #43 (comment) and so on!

@AronNovak AronNovak changed the title WIP: testing WebDriverIO Testing WebDriverIO Mar 7, 2017
@AronNovak
Copy link
Member

I performed the tweaks I had in mind, any further feedback is highly appreciated!

@amitaibu
Copy link
Member

amitaibu commented Mar 7, 2017

🎉 It's green!

@@ -1,6 +1,7 @@
module Pages.Login.Update exposing (fetchUserFromBackend, update)

import Config.Model exposing (BackendUrl)
import Http exposing (Error(BadStatus))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this change related, or just need a re-roll with master?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's coming from c244a19 , on my side, it's not related. It seems, at a certain point, the Elm app/test itself was modified for some reason, we might revert those commits, if not needed.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rohanorton could you help us about the purpose of the Elm-related commits under this PR? Thank you!

Copy link
Contributor

@rohanorton rohanorton Mar 7, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They're originally from this PR: #51. It was to prevent error messages being shown on invalid session tokens.

@amitaibu
Copy link
Member

amitaibu commented Mar 7, 2017

Sorry, what I meant was that you had to git merge master into the branch. I've done so, and waiting for green to merge.

Amazing work folks!

@amitaibu amitaibu merged commit b90aba6 into master Mar 7, 2017
@amitaibu amitaibu deleted the 29-webdriverio-travis branch March 7, 2017 12:41
@@ -72,10 +72,10 @@ exports.config = {
//
// Set a base URL in order to shorten url command calls. If your url parameter starts
// with "/", then the base url gets prepended.
baseUrl: 'http://localhost:3000',
baseUrl: 'http://server.local:3000',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AronNovak oh, this was changed on the general client/wdio.conf.js. Please create a client/wdio.conf.travis.js and execute it instead, and revert the changes introduced here

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants