Giter VIP home page Giter VIP logo

boilerplate-nightwatch's Introduction

Testarmada magellan and nightwatch-extra Example Project

Build Status License: MIT

This is an example project demonstrating how to run magellan with various executors to trigger test run using nightwatch-extra.

The contents of this project's root directory should become the root directory of your Magellan test suite folder (for example a ./automation folder in your project).

------------------BREAKING CHANGE in [email protected]

If you recently bump magellan to 10.0.0, please follow the Migration Guide here.

What's in the Box

Included in this boilerplate:

  • Example base class for tests (lib/example-base-test-class.js)
  • Example tests which use the example base class (tests/*)
  • A .gitignore file which ignores Magellan-generated artifacts (logs, etc)
  • Stock configuration (conf/nightwatch.json)
  • A place to put custom commands (lib/custom_commands)
  • A place to put custom page objects (lib/pages)

In order to speed up the execution of this boilerplate, all tests are mocked with Drydock.

Prerequisites

Check that you have at least npm version 3 or above (required by [email protected]):

npm --version

If not, run:

npm install -g npm@3

Also please map travis.dev to 127.0.0.1 in your host file.

Install and Run

Installation

1. Clone boilerplate-nightwatch into an isolated place outside of your project:

cd ~
git clone [email protected]:TestArmada/boilerplate-nightwatch.git

2. Install npm modules

npm install

Run with npm

npm test

Run with more options

Local

This is to run magellan with Magellan-local-executor (which is already configured in magellan.json)

  1. Chrome
DPRO=local ./node_modules/.bin/magellan --local_browser chrome --test tests/demo-first.js --serial
  1. Firefox
DPRO=local ./node_modules/.bin/magellan --local_browser firefox --test tests/demo-page-object.js --serial
  1. Appium

iOS

PLEASE NOTE To run test with iOS, Xcode and correct version of iOS simulator have to be installed.

DPRO=local ./node_modules/.bin/magellan --local_browser appiummweb --test tests/demo-page-object.js --serial

Android

PLEASE NOTE To run test with Android, Android SDK, AVD and currect version of emulator have to be installed and created.

ANDROID_OPEN_URL=http://10.0.2.2 DPRO=local ./node_modules/.bin/magellan --local_browser appiumandroidmweb --test tests/demo-first.js --serial

Saucelabs

This is to run magellan with Magellan-saucelabs-executor (which is already configured in magellan.json).

All tests have to run with Sauce Connect.

  1. Chrome and IE11
DPRO=local ./node_modules/.bin/magellan --sauce_browsers chrome_latest_Windows_10_Desktop,IE_11_Windows_10_Desktop --sauce_create_tunnels --test tests/demo-page-object.js --serial
  1. iOS simulator with iphone6 and [email protected]
DPRO=local ./node_modules/.bin/magellan --sauce_browser iphone_10_0_iOS_iPhone_6_Simulator --sauce_create_tunnels --test tests/demo-page-object.js --serial
  1. Android emulator with Google Nexus 7 HD Emulator and [email protected]

You need to disable SSL bumping for [email protected] or higher, please refer to here for explanation.

[email protected] supports customized sauce connect flags, please see tunnel.json for reference.

DPRO=local ./node_modules/.bin/magellan --sauce_browsers android_4_4_Android_Google_Nexus_7_HD_Emulator --sauce_tunnel_id ${SAUCE_TUNNEL_ID} --sauce_tunnel_config ./tunnel.json --test tests/demo-page-object.js --serial

Browserstack

This is to run magellan with Magellan-browserstack-executor

Please Note: Browserstack executor is still in early beta. We'll add the content when it is ready.

Help

1. Magellan help

All magellan command line arguments, together with its plugin's and executors', can be found by.

./node_modules/.bin/magellan --help

2. Plugin help

Command line arguments for plugin could be found by scanning Framework-specific keyward in magellan help output.

Help from testarmada-magellan-nightwatch-plugin

Framework-specific (testarmada-magellan-nightwatch-plugin)
   --tags=tag1,tag2                     Run all tests that match a list of comma-delimited tags (eg: tag1,tag2)
   --group=prefix/path                  Run all tests that match a path prefix like ./tests/smoke
   --test=path/to/test.js               Run one test with a path like ./tests/smoke/test2.js
   --nightwatch_config=path             Specify nightwatch.json location (magellan-nightwatch)
   --sync_browsers=safari:10,chrome:54  Specify which browser will run in sync mode for javascript execution

You can also implement your own plugin in order to make magellan talk to more test frameworks. Find more here to implement your own magellan plugin

3. Executor help

Command line arguments for executor could be found by scanning Executor-specific keyward in magellan help output.

Help from testarmada-magellan-sauce-executor

Executor-specific (testarmada-magellan-sauce-executor)
   --sauce_browser=browsername          Run tests in chrome, firefox, etc (default: phantomjs).
   --sauce_browsers=b1,b2,..            Run multiple browsers in parallel.
   --sauce_list_browsers                List the available browsers configured (Guacamole integrated).

You can also implement your own executor in order to execute magellan test in more environment. Find more here to implement your own magellan executor.

Configuration

Magellan reads from both command line arguments and magellan.json. Please refer to help section to get the full list of magellan command line arguments.

Please use ./magellan.json as example to customize your magellan.json.

boilerplate-nightwatch's People

Contributors

archlichking avatar maciek416 avatar geekdave avatar abhagupta avatar greenkeeper[bot] avatar

Watchers

Praneeth Tatineni avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.