GithubHelp home page GithubHelp logo

geekwolverine / throughout Goto Github PK

View Code? Open in Web Editor NEW

This project forked from elliot-evans-95/throughout

0.0 1.0 0.0 96 KB

๐ŸŽช End-to-end testing made simple (using Jest and Puppeteer)

TypeScript 100.00%

throughout's Introduction

Throughout Travis build status

End-to-end testing made simple

Throughout combines Jest and Puppeteer to create a FAST End to End testing environment.

Installation

*Note: Throughout requires at least Node v6.4.0 due to Puppeteer

To install Throughout using NPM:

npm i throughout-chrome

To install Throughout using Yarn:

yarn add throughout-chrome

Note: Puppeteer downloads Chromium.

Usage

To use Throughout please refer to Jest's API and Puppeteer's API.

Here is an example of a test

import * as puppeteer from 'puppeteer';
import { throughoutSettings, throughoutDebug, setViewportAsDesktop } from '../src/browser'; // imported from throughout
import { urlList } from '../testBed/url'; // the url you are testing

describe('Given this is a test', () => {

    let page;
    let browser;
    let debug;

    beforeAll(async () => {
        browser = await puppeteer.launch(throughoutSettings);
        page = await browser.newPage();
        debug = await throughoutDebug('Pokedex PWA Test', page, browser); // throughout will debug for you
        setViewportAsDesktop(page);

        await page.goto(urlList.POKEMON);
    });

    describe('When the user clicks the pokemon link', () => {

        beforeAll(async () => {
            await page.click('#pokemon-link');
        });

        it('Then the pokemon list should be visible', async () => {
            expect(await page.$('#monsters-list')).toBeTruthy();
        });
    });
});

Default settings

  • Uses Headless mode
  • Runs a bundled version of Chromium
  • Runs tests in parallel

Contributors

Throughout was made by Elliot Evans

throughout's People

Contributors

elliot-evans-95 avatar

Watchers

 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.