Search code examples
unit-testingfunctional-testingintern

Intern - Create local tunnel to run functional tests


So i'm starting use Intern for functional tests, so far so good I did it all, unit and functional tests.

I followed their intern-tutorial

Whenever you need to run a full test against all platforms, use the test runner. When you are in the process of writing your tests and want to check them for correctness more quickly, you can either use just the Node.js client (for unit tests only) or create an alternate configuration file that only tests against a single local platform, like your local copy of Chrome or Firefox (for all tests, including functional tests).

I searched on their documentation, but I didn't find anything exactly about local "tunnels".

I'm using Intern with Gulp, my localhost is localhost:3000 and I want to test on my Chrome 54 on Mac.

Thank you


Solution

  • I found the answer. I had to change the tunnel to Local Selenium.

    1. Download the latest version of ChromeDriver
    2. Set tunnel to 'NullTunnel'
    3. Run chromedriver --port=4444 --url-base=wd/hub
    4. Set your environments capabilities to [ { browserName: 'chrome' } ]
    5. Run the test runner

    Obs:

    1. Don't forget to copy the chromedriver file to your project root.

    2. I had to run on my project root .\chromedriver --port=4444 --url-base=wd/hub

    3. The test runner has to be run in a new command line/terminal/shell

    Hope to help someone that had the same issue.