Sitelet https://github.com/ontas/koding/tree/master/client/test
Skip to content

Latest commit

 

History

History
 
 

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Readme.md

test

this folder contains browser automated tests that run on selenium server.

quick start

Go to client folder and run:

λ koding/client make test

This will configure your nightwatch environment, transpile coffee-scripts under test/lib directory into test/build, start selenium-server, and run your tests in the correct order that they need to be run.

configuration

In order to run tests written with Nightwatch.js framework, you need to generate a configuration script.

This file can be automatically generated with:

λ client/test make configure

or you can directly run the configuration tool itself:

λ client/test ./bin/cmd.coffee browser

Running any of those will write two files in client directory:

client/.nightwatch.json

This is the configuration file expected by nightwatch and it is generated specifically for the platform (os) you are on.

By default configuration tool, uses a blueprint file for the defaults.

But you can overwrite any key from cli using dot notation:

λ client/test ./bin/cmd.coffee browser --selenium.port 5555

client/.config.json

This file is also extended with a test.url key that you have specified.

Following is the help output of the configuration tool:

usage: coffee bin/cmd.coffee <command> [options]

Commands:
  browser    configure browser tests

Options:
  --help, -h        show this message
  --url             specify a url that koding webserver is running on
  --nightwatch      specify a nightwatch config blueprint file.
                    actual config file will be written to client/.nightwatch.json
  --start-selenium  if enabled starts a selenium server process [default: true]

running tests

There is a handful of Makefile targets defined to make life easier:

Configure and write client/.nightwatch.json file:

λ client/test make configure

You can pass additional args that is expected by configuration tool (bin/cmd.coffee):

λ client/test TEST_EXTRAS=--no-start-selenium make configure

Transpile coffee files under test/lib into test/build:

λ client/test make compile

A complete build with configuration and transpilation:

λ client/test make build

Run tests in the correct order that they need to be run:

λ client/test make run

Build and run:

λ client/test make all

running tests individually

You can run tests individually using either test or run.sh scripts, these scripts are same except that test retranspiles coffees before running:

Run activity suite tests:

λ client/test ./test activity

Run activity/likeunlike suite

λ client/test ./test activity likeunlike

Gravatar:

username: kodingtestuser1 / kodingtestuser@koding.com password: passfortestuser

license

2015 Koding, Inc