Giter Club home page Giter Club logo

faltest's Introduction

FalTest

Build Status Build status

A different take on WebDriver browser testing

Requirements

Make sure Node.js 8.10+ is installed.

Setup

Run the following command to install FalTest globally.

npm install --global @faltest/cli

Usage

Here are a couple examples of using the FalTest CLI.

  • faltest --tag admin !smoke --filter "^Visit .*"
  • faltest --env dev --tag smoke --share-session --headless

Default Options

(regen using yarn start --help)

  --help               Show help                                       [boolean]
  --version            Show version number                             [boolean]
  --browser            Type of browser to run
                     [string] [choices: "chrome", "firefox"] [default: "chrome"]
  --port               Port for WebDriver                [string] [default: "0"]
  --headless           Run browser in headless mode   [boolean] [default: false]
  --retries            When all else fails, try again!              [default: 0]
  --target             Run against a different UI server/URL
                              [string] [choices: "default"] [default: "default"]
  --env                Run against a different data source
                              [string] [choices: "default"] [default: "default"]
  --share-webdriver    Keep the WebDriver process open between test runs
                                                       [boolean] [default: true]
  --keep-browser-open  Keep the browser open between test runs (sets
                       --share-webdriver)             [boolean] [default: false]
  --share-session      Keep the session (login, etc.) between test runs (sets
                       --share-webdriver and --keep-browser-open)
                                                      [boolean] [default: false]
  --size               Override the browser size. ex. "--size 1024 768"
  --throttle-network   Slow down the network so you can see the loading states
                       better                         [boolean] [default: false]
  --tag                Filter groups of tests using the #hash tagging system
                       (hashes are optional). Prefix with ! to negate.
                                               [array] [choices: ] [default: []]
  --filter             Filter the tests by name using a pattern
                                                        [string] [default: ".*"]
  --random             Randomise test order           [boolean] [default: false]
  --seed               Set the random seed to reproduce test order      [string]
  --timeouts-override  Override all Mocha timeouts for debugging purposes
  --disable-timeouts   Disable all Mocha timeouts for debugging purposes
                                                      [boolean] [default: false]
  --reporter           Change the Mocha reporter                        [string]
  --reporter-options   Supply Mocha reporter options                    [string]

Filtering

There are a couple ways to filter tests, --tag and --filter. Tags are predefined categories you can add to narrow down your test run. This includes filtering by roles. You can also prefix a ! to a tag (ex. --tag !smoke) if you want to exclude it. If you are using Bash, you may need to escape the exclamation mark (ex. --tag \!smoke). The filter is a regular expression that can match test names. You can combine both these options.

Filtering by tags is a little different between roles and other tags. Since a test only ever has one role at a time attached to it, --tag role1 role2 would never match any tests, since tags function as a logical AND and not an OR. On the other hand, tests can be attached to more than one tag. In this case, --tag tag1 tag2 would target those tests only, and exclude the tests focusing on either tag exclusively.

Logging

Logging can be accomplished via the DEBUG environment variable (https://github.com/visionmedia/debug). Supported variables are:

  • faltest - basic logging
  • faltest:verbose - verbose logging only
  • faltest* - all logging

An example use would be DEBUG=faltest* faltest --tag smoke.

Browser Versions

To override the ChromeDriver version to match your Chrome version, follow the guide here. For example:

CHROMEDRIVER_VERSION=75.0.3770.140 npm install

Real-world Examples

Contributing

If you need to change FalTest, see Contributing Guide.

faltest's People

Contributors

renovate-bot avatar

Watchers

 avatar  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.