cortado
cortado =======
Last updated 7 years ago by architectd .
BSD · Repository · Original npm · Tarball · package.json
$ cnpm install cortado 
SYNC missed versions from official npm registry.

Usage

Below is a boilerplate config file - place it in [project_path]/.cortado.js:

module.exports = {

  //url to proxy when running tests - important to prevent cross-site security
  //issues
  proxy: "http://localhost:8080",

  //tests to run - these are actually loaded in the browser
  scripts: [
    __dirname + "/test/**.js"
  ],

  //data-types to cache
  cache: {
    types: ["json", "png"],
    directory: __dirname + "/test2/cache"
  },

  //files to watch, then reload
  watch: [
    __dirname + "/public/**",
    __dirname + "/test/**"
  ],

  //port to run tests on - open in http://localhost:8083/test
  port: 8083,

  //full integration 
  full: true,

  //keep the tests alive for dev mode
  keepAlive: true,

  //called each time browsers are reloaded to run tests

  events: {
    init: function() {
      exec("open http://student.classdojo.dev:8083/test?run");
    }
  }
} 

Next, you can start writing tests using mocha. Here's an example test from [project_path]/tests/login-test.js:

var assert = require("./helpers/assert"),
xpaths     = require("./helpers/xpaths"),
config     = require("./helpers/config"),
utils      = require("./helpers/utils"),
logout     = require("./helpers/logout");

describe("login#", function() {


  before(function(next) {
    actions.
    wait(logout()).
    then(next);
  }); 

  var p = {},
  app = xpaths.app,
  user = config.users.withoutPoints.username,
  pass = config.users.withoutPoints.password;

  /** 
   */

  it("login button toggles properly depending on input data", function(next) {

    actions.

    //test incomplete
    type(p.un = xpaths.login.usernameInput, "craigers").
    type(p.pn = xpaths.login.passwordInput, "").

    wait(assert.enabled(p.sub = app.find().eq("@type", "submit"))).

    then(next);
  }); 
  
  /**
   */
   
  it("shows a not found error", function(next) {
    actions.
    type(p.un, String(Date.now())).
    type(p.pn, "password").
    click(p.sub).
    wait(assert.textPresent("Couldn't find a user with that username.")).
    then(next);
  });
});

Finally, go ahead and run cortado:

cortado start

Current Tags

  • 0.0.47                                ...           latest (7 years ago)

38 Versions

  • 0.0.47                                ...           7 years ago
  • 0.0.46                                ...           7 years ago
  • 0.0.45                                ...           7 years ago
  • 0.0.44                                ...           7 years ago
  • 0.0.43                                ...           7 years ago
  • 0.0.41                                ...           7 years ago
  • 0.0.40                                ...           7 years ago
  • 0.0.39                                ...           7 years ago
  • 0.0.38                                ...           7 years ago
  • 0.0.37                                ...           7 years ago
  • 0.0.36                                ...           7 years ago
  • 0.0.34                                ...           7 years ago
  • 0.0.33                                ...           7 years ago
  • 0.0.32                                ...           7 years ago
  • 0.0.31                                ...           7 years ago
  • 0.0.30                                ...           7 years ago
  • 0.0.29                                ...           7 years ago
  • 0.0.28                                ...           7 years ago
  • 0.0.26                                ...           7 years ago
  • 0.0.25                                ...           7 years ago
  • 0.0.23                                ...           7 years ago
  • 0.0.22                                ...           7 years ago
  • 0.0.21                                ...           7 years ago
  • 0.0.20                                ...           7 years ago
  • 0.0.19                                ...           7 years ago
  • 0.0.18                                ...           7 years ago
  • 0.0.17                                ...           7 years ago
  • 0.0.16                                ...           7 years ago
  • 0.0.13                                ...           7 years ago
  • 0.0.12                                ...           7 years ago
  • 0.0.11                                ...           7 years ago
  • 0.0.10                                ...           7 years ago
  • 0.0.9                                ...           7 years ago
  • 0.0.7                                ...           7 years ago
  • 0.0.6                                ...           7 years ago
  • 0.0.3                                ...           7 years ago
  • 0.0.2                                ...           7 years ago
  • 0.0.0                                ...           7 years ago
Maintainers (2)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 3
Dependencies (3)
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |