Giter VIP home page Giter VIP logo

backstop-retry-failed-scenarios's Introduction

backstop-retry-failed-scenarios

A wrapper command to retry failed scenario for BackstopJS.
It parses report.json, extract failed tests, and rerun with --filter option, and rewrite result file.
This is useful when your tests are unstable.

FEATURES

  • Invoke specified test command
  • Generate filter option from failed tests
  • Reorganize each failed reports to latest one status
    • Supports HTML report, JSON report, CI report.

EXAMPLE

This endpoint returns random emoji from three emojis(๐Ÿ˜€, ๐Ÿ˜‡, ๐Ÿ˜).
Each try may fail, but retrying failed tests will pass all test.

$ cd examples/retry
$ backstop reference
$ npx backstop-retry-failed-scenarios

examples/retry/images/try.gif

HOW TO RUN

Instead of backstop test, run backstop-retry-failed-scenarios and set command, retry count, config path.

$ npm install -g backstop backstop-retry-failed-scenarios
$ backstop init
$ backstop reference
$ backstop-retry-failed-scenarios --retry 5 --command 'backstop test' --config backstop.js

Instead of npm install, you can pull hitode909/backstop-retry-failed-scenarios from DockerHub.
Its image is based on backstopjs/backstopjs, so you can execute backstop directly from docker run hitode909/backstop-retry-failed-scenarios.

$ docker pull hitode909/backstop-retry-failed-scenarios
$ docker run --rm -v $(pwd):/src hitode909/backstop-retry-failed-scenarios backstop init
$ docker run --rm -v $(pwd):/src hitode909/backstop-retry-failed-scenarios backstop reference
$ docker run --rm -v $(pwd):/src hitode909/backstop-retry-failed-scenarios backstop-retry-failed-scenarios

If you want to recreate references every time, Please set --reference-command option. This will do like this.

  1. create all references
  2. run all tests
  3. create references for failed tests on 2.
  4. run tests for failed tests on 2.

This is useful when your reference refers to production instead static file, and test refers to staging environment.

$ backstop init
$ backstop-retry-failed-scenarios --reference-command 'backstop reference' --command 'backstop test' --config backstop.js

OPTIONS

  --retry             number Retry count. default: 3
  --config            string Path to config file. default: backstop.json
  --command           string Command to run test. default: backstop test
  --reference-command string Command to create reference before testing. Default: null (Do not create reference before test).

backstop-retry-failed-scenarios's People

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.