Skip to content

Instantly share code, notes, and snippets.

@mangreen
Created February 7, 2015 10:01
Show Gist options
  • Save mangreen/64cb5c0aa1ea6ced808b to your computer and use it in GitHub Desktop.
Save mangreen/64cb5c0aa1ea6ced808b to your computer and use it in GitHub Desktop.
BDD Test
Web AdPlay Test
===============
This project is a collection of functional tests (integration tests) of AdPlay HTML5 product series.
Environment are assume to be under control, which means:
- you're under good network environment
- cloud are ready and we wouldn't run out of VM
- your computer are not busy with other CPU bound tasks
## Setup
npm install
npm install -g appium cucumber.js selenium-standalone
start-selenium &
appium &
extra work is required if you want to run test on real device. here is the [reference](http://appium.io/slate/en/master/?ruby#android-setup)
## Worlds
cucumber has the concept of World, which stands for a environment that tests run against to.
to know what worlds you can live, check out `product/features/support/`. several `<world_type>_world.js` are there.
for example, if there is `android_device_world.js`, you can explicitly specify it as environment variable:
WORLD_TYPE=android_device cucumber.js
by default it run on chrome desktop, which maps to `chrome_world.js`
## Usage Example
before run test command, you need to `cd` into the target product folder. ex: `cd top10v1.1-landscape`
run all top10 tests and pretty print to console
# make sure selenium server is running
sudo cucumber.js -f pretty
run all top10 tests on android device and print json result
# 1. connect Android 4.4 device to computer
# 2. make sure selenium server and appium server are running
cd top10v1.1-landscape
sudo WORLD_TYPE=android_device cucumber.js -f json
run all top10 tests but badnet (thus we don't need sudo)
cucumber.js -t ~@badnet
## TODO
1. use CoffeeScript, or patch cucumber.js so that we can use livescript or ES6
2. run on iPhone
3. run on ubuntu (xvfb)
4. adapting to MozTrap
5. adapting to Google Sheet
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment