browser-monkey
reliable dom testing
Last updated a year ago by refractalize .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install browser-monkey 
SYNC missed versions from official npm registry.

browser monkey npm version npm CircleCI Gitter chat

Reliable DOM testing

npm install browser-monkey

Browser Monkey is a DOM assertion library. It helps you write framework agnostic browser tests that are reliable in the face of asynchronous behaviours like animations, AJAX and delayed rendering. It also helps you to write tests that exhibit the semantic meaning of the page, as opposed to a jumble of CSS selectors.

  • automatically waits for commands and assertions.
  • create rich DSLs for your page structure.
  • framework agnostic: works with React, Angular, jQuery, Hyperdom and many many more.
  • can simulate text entry and clicks.
  • returns promises that resolve when the elements are found.

Here is an example project that demonstrates how to use browser-monkey with Karma.

@dereke has made an excellent video of a TDD session using browser-monkey.

Docs

Docs Website

example

import createMonkey from "browser-monkey/create";
import createTestDiv from "browser-monkey/lib/createTestDiv";
import hyperdom from "hyperdom";
import App from "./app";

describe("beer app", () => {
  let page;

  beforeEach(() => {
    const $testContainer = createTestDiv();
    hyperdom.append($testContainer, new App());
    page = createMonkey($testContainer);
  });

  it("greets me", async () => {
    await page.find("h1").shouldHave({ text: "Hello Lubbers" });
  });

  it("shows me beer", async () => {
    await page.click("Beer");
    await page.shouldHave({ text: "Punk IPA" });
  });
});

Run this example

We're hiring!

Join our remote team and help us build amazing software. Check out our career opportunities.

Current Tags

  • 3.0.0-beta.6                                ...           beta (2 months ago)
  • 2.11.0                                ...           latest (a year ago)

80 Versions

  • 3.0.0-beta.6                                ...           2 months ago
  • 3.0.0-beta.4                                ...           5 months ago
  • 3.0.0-beta.3                                ...           8 months ago
  • 3.0.0-beta.2                                ...           8 months ago
  • 3.0.0-beta.1                                ...           8 months ago
  • 2.11.0                                ...           a year ago
  • 2.9.0                                ...           a year ago
  • 2.7.2                                ...           3 years ago
  • 2.7.1                                ...           3 years ago
  • 2.7.0                                ...           3 years ago
  • 2.6.0                                ...           3 years ago
  • 2.5.0                                ...           4 years ago
  • 2.4.1                                ...           4 years ago
  • 2.4.0                                ...           4 years ago
  • 2.3.0                                ...           4 years ago
  • 2.2.1                                ...           4 years ago
  • 2.2.0                                ...           4 years ago
  • 2.0.0                                ...           4 years ago
  • 1.29.2                                ...           5 years ago
  • 1.29.1                                ...           5 years ago
  • 1.29.0                                ...           5 years ago
  • 1.28.2                                ...           5 years ago
  • 1.27.1                                ...           5 years ago
  • 1.26.5                                ...           5 years ago
  • 1.27.0                                ...           5 years ago
  • 1.26.4                                ...           5 years ago
  • 1.26.3                                ...           5 years ago
  • 1.26.2                                ...           5 years ago
  • 1.26.1                                ...           5 years ago
  • 1.26.0                                ...           5 years ago
  • 1.25.0                                ...           5 years ago
  • 1.24.0                                ...           5 years ago
  • 1.23.2                                ...           5 years ago
  • 1.23.1                                ...           5 years ago
  • 1.23.0                                ...           5 years ago
  • 1.22.0                                ...           5 years ago
  • 1.21.0                                ...           5 years ago
  • 1.20.0                                ...           5 years ago
  • 1.19.0                                ...           5 years ago
  • 1.18.0                                ...           5 years ago
  • 1.17.1                                ...           5 years ago
  • 1.17.0                                ...           5 years ago
  • 1.16.0                                ...           5 years ago
  • 1.15.13                                ...           5 years ago
  • 1.15.12                                ...           5 years ago
  • 1.15.11                                ...           5 years ago
  • 1.15.10                                ...           5 years ago
  • 1.15.9                                ...           5 years ago
  • 1.15.8                                ...           5 years ago
  • 1.15.7                                ...           5 years ago
  • 1.15.6                                ...           5 years ago
  • 1.15.5                                ...           5 years ago
  • 1.15.4                                ...           5 years ago
  • 1.15.3                                ...           5 years ago
  • 1.15.2                                ...           5 years ago
  • 1.15.1                                ...           5 years ago
  • 1.15.0                                ...           5 years ago
  • 1.14.0                                ...           5 years ago
  • 1.13.0                                ...           5 years ago
  • 1.12.1                                ...           5 years ago
  • 1.12.0                                ...           5 years ago
  • 1.11.1                                ...           5 years ago
  • 1.11.0                                ...           5 years ago
  • 1.10.0                                ...           5 years ago
  • 1.9.3                                ...           5 years ago
  • 1.9.2                                ...           5 years ago
  • 1.9.1                                ...           5 years ago
  • 1.9.0                                ...           5 years ago
  • 1.8.0                                ...           5 years ago
  • 1.7.0                                ...           5 years ago
  • 1.6.0                                ...           5 years ago
  • 1.5.1                                ...           5 years ago
  • 1.5.0                                ...           5 years ago
  • 1.4.0                                ...           5 years ago
  • 1.3.2                                ...           5 years ago
  • 1.3.1                                ...           5 years ago
  • 1.3.0                                ...           5 years ago
  • 1.2.0                                ...           5 years ago
  • 1.1.0                                ...           5 years ago
  • 1.0.0                                ...           5 years ago
Downloads
Today 0
This Week 0
This Month 1
Last Day 0
Last Week 0
Last Month 17
Dependencies (10)
Dev Dependencies (36)

Copyright 2014 - 2016 © taobao.org |