0.2.2 • Published 9 years ago

nemo-mocha-factory v0.2.2

Weekly downloads
3
License
Apache 2.0
Repository
github
Last release
9 years ago

nemo-mocha-factory

Mocha before/after functions for putting nemo into the global namespace

Build Status

Usage

/*global describe:true, it:true, before:true, after:true */
"use strict";

var assert = require('assert'),
	nemoFactory = require('nemo-mocha-factory'),//require the module
	plugins = require('../config/nemo-plugins'),
	setup = require('../data/setup').loginSpec,
	data_driven = require("data-driven");

describe('nemo-user @loginSuite@loginFactory@ci-group2@', function () {
	//call the factory method, optionally with the Object argument seen below
	nemoFactory({"plugins": plugins, "setup": setup});
	data_driven([
		{"user": "nobank"},
		{"user": "nocc"},
		{"user": "ccandbank"}
	], function () {
		it('should create two users and login with user account {user} @P3@', function (ctx, done) {
			//use nemo from the global namespace
			var currentUser = nemo.user.users[ctx.user];
			nemo.driver.get(nemo.targetBaseUrl);
			nemo.view.login.login(currentUser.emailAddress, currentUser.password);
			nemo.view.login.logout().then(function () {
				nemo.screenshot.done("loginFactorySuccess-" + ctx.user, done);
			}, function (err) {
				nemo.screenshot.doneError("loginFactoryError-" + ctx.user, err, done);
			});

		});
	});
});

API

The nemo-mocha-factory module accepts a JSON argument, with the following possible top-level objects

0.2.2

9 years ago

0.3.1

9 years ago

0.3.0-alpha.1

9 years ago

0.2.1

10 years ago

0.2.0

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago