@expressen/tallahassee
Expressen client testing framework
Last updated 4 days ago by captainjinx .
BSD-3-Clause · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @expressen/tallahassee 
SYNC missed versions from official npm registry.

Tallahassee

Utilities

Build Statusdependencies Status

Test your client scripts in a headless browser.

Introduction

Supports just about everything except querySelectorAll() which we donĀ“t want developers to use.

  • IntersectionObserver? Yes, check here

Example:

"use strict";

const app = require("../app/app");
const Browser = require("@expressen/tallahassee");
const Script = require("@bonniernews/wichita");

describe("Tallahassee", () => {
  describe("navigateTo()", () => {
    it("navigates to url", async () => {
      await Browser(app).navigateTo("/");
    });

    it("throws if not 200", async () => {
      try {
        await Browser(app).navigateTo("/404");
      } catch (e) {
        var err = e; // eslint-disable-line no-var
      }
      expect(err).to.be.ok;
    });

    it("unless you override status code", async () => {
      const browser = await Browser(app).navigateTo("/404", null, 404);
      expect(browser.document.getElementsByTagName("h1")[0].innerText).to.equal("Apocalyptic");
    });
  });

  describe("run script", () => {
    it("run es6 script sources with @bonniernews/wichita", async () => {
      const browser = await Browser(app).navigateTo("/", {
        Cookie: "_ga=1"
      });

      await Script("../app/assets/scripts/main").run(browser.window);

      expect(browser.document.cookie).to.equal("_ga=1");
      expect(browser.document.getElementsByClassName("set-by-js")).to.have.length(1);
    });

    it("again", async () => {
      const browser = await Browser(app).navigateTo("/");

      await Script("../app/assets/scripts/main").run(browser.window);

      expect(browser.document.cookie).to.equal("");
      expect(browser.document.getElementsByClassName("set-by-js")).to.have.length(0);
    });
  });
});

External scripts

May we suggest you to use Wichita, the Tallahassee sidekick. It can be found here https://www.npmjs.com/package/@bonniernews/wichita

Timers

If overriding timers on window, e.g. setTimeout it can be a good idea to make them asynchronous since they tend to be recurring.

Example:

browser.window.setTimeout = function mySetTimeout(fn, ms, ...args) {
  process.nextTick(fn, ...args);
};

Current Tags

  • 9.2.2                                ...           beta (3 months ago)
  • 9.10.0                                ...           latest (4 days ago)

110 Versions

  • 9.10.0                                ...           4 days ago
  • 9.9.1                                ...           11 days ago
  • 9.9.0                                ...           a month ago
  • 9.8.1                                ...           2 months ago
  • 9.8.0                                ...           2 months ago
  • 9.7.0                                ...           2 months ago
  • 9.6.0                                ...           2 months ago
  • 9.5.1                                ...           2 months ago
  • 9.5.0                                ...           2 months ago
  • 9.4.0                                ...           3 months ago
  • 9.3.0                                ...           3 months ago
  • 9.2.2                                ...           3 months ago
  • 8.2.2                                ...           3 months ago
  • 8.2.1                                ...           3 months ago
  • 9.2.0                                ...           3 months ago
  • 8.2.0                                ...           3 months ago
  • 9.1.0                                ...           4 months ago
  • 8.1.0                                ...           4 months ago
  • 9.0.3                                ...           4 months ago
  • 8.0.2                                ...           4 months ago
  • 9.0.2                                ...           4 months ago
  • 9.0.1                                ...           4 months ago
  • 9.0.0                                ...           4 months ago
  • 8.0.1                                ...           4 months ago
  • 8.0.0                                ...           5 months ago
  • 7.5.0                                ...           6 months ago
  • 7.4.4                                ...           6 months ago
  • 7.4.3                                ...           6 months ago
  • 7.4.2                                ...           6 months ago
  • 7.4.1                                ...           6 months ago
  • 7.4.0                                ...           6 months ago
  • 7.3.0                                ...           6 months ago
  • 7.2.1                                ...           6 months ago
  • 7.2.0                                ...           6 months ago
  • 7.1.0                                ...           6 months ago
  • 7.0.0                                ...           6 months ago
  • 6.5.0                                ...           6 months ago
  • 6.4.0                                ...           7 months ago
  • 6.3.0                                ...           7 months ago
  • 6.2.0                                ...           7 months ago
  • 6.1.3                                ...           7 months ago
  • 6.1.2                                ...           7 months ago
  • 6.1.1                                ...           7 months ago
  • 6.1.0                                ...           7 months ago
  • 6.0.0                                ...           8 months ago
  • 5.3.0                                ...           8 months ago
  • 5.2.0                                ...           8 months ago
  • 5.1.0                                ...           8 months ago
  • 5.0.0                                ...           8 months ago
  • 4.13.0                                ...           10 months ago
  • 4.12.1                                ...           a year ago
  • 4.12.0                                ...           a year ago
  • 4.10.0                                ...           a year ago
  • 4.9.0                                ...           a year ago
  • 4.8.1                                ...           a year ago
  • 4.8.0                                ...           a year ago
  • 4.7.0                                ...           a year ago
  • 4.6.0                                ...           a year ago
  • 4.5.0                                ...           a year ago
  • 4.4.0                                ...           a year ago
  • 4.3.0                                ...           a year ago
  • 4.2.0                                ...           a year ago
  • 4.1.1                                ...           a year ago
  • 4.1.0                                ...           a year ago
  • 4.0.0                                ...           a year ago
  • 3.2.0                                ...           a year ago
  • 3.1.0                                ...           a year ago
  • 3.0.0                                ...           a year ago
  • 2.17.0                                ...           a year ago
  • 2.16.0                                ...           a year ago
  • 2.15.0                                ...           a year ago
  • 2.14.0                                ...           a year ago
  • 2.13.0                                ...           a year ago
  • 2.12.0                                ...           a year ago
  • 2.11.0                                ...           a year ago
  • 2.10.0                                ...           a year ago
  • 2.9.0                                ...           a year ago
  • 2.8.3                                ...           a year ago
  • 2.8.2                                ...           a year ago
  • 2.8.1                                ...           a year ago
  • 2.8.0                                ...           a year ago
  • 2.7.0                                ...           a year ago
  • 2.6.1                                ...           a year ago
  • 2.6.0                                ...           a year ago
  • 2.5.1                                ...           a year ago
  • 2.5.0                                ...           a year ago
  • 2.4.0                                ...           a year ago
  • 2.3.0                                ...           a year ago
  • 2.2.0                                ...           a year ago
  • 2.1.1                                ...           a year ago
  • 2.1.0                                ...           a year ago
  • 2.0.0                                ...           a year ago
  • 1.0.2                                ...           a year ago
  • 1.0.0                                ...           a year ago
  • 0.7.0                                ...           a year ago
  • 0.6.4                                ...           a year ago
  • 0.6.3                                ...           a year ago
  • 0.6.2                                ...           a year ago
  • 0.6.1                                ...           a year ago
  • 0.6.0                                ...           a year ago
  • 0.5.0                                ...           a year ago
  • 0.4.2                                ...           a year ago
  • 0.4.1                                ...           a year ago
  • 0.4.0                                ...           a year ago
  • 0.3.0                                ...           a year ago
  • 0.2.0                                ...           a year ago
  • 0.1.1                                ...           a year ago
  • 0.1.0                                ...           a year ago
  • 0.0.2                                ...           a year ago
  • 0.0.1                                ...           a year ago
Downloads
Today 0
This Week 129
This Month 371
Last Day 110
Last Week 242
Last Month 59
Dependencies (5)
Dev Dependencies (8)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |