npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

grunt-testcafe

v0.23.0

Published

Grunt testcafe plugin

Downloads

45

Readme

grunt-testcafe

Build Status

Tests runner

Getting Started

This plugin requires Grunt 0.4 - 1.

npm install grunt-testcafe --save-dev

One the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:

grunt.loadNpmTasks("grunt-testcafe")

The "testcafe" task

Overview

In your project's Gruntfile, add a section named testcafe to the data object passed into grunt.initConfig().

grunt.initConfig({
    testcafe: {
        test: {
            options: {
                files: ["tests/*.test.js"],
                browsers: ["chrome"]
            }
        }
    }
})

Advanced example:

grunt.initConfig({
    testcafe: {
        test: {
            options: {
                files: ["tests/*.test.js"],
                browsers: ["firefox", "chrome"],
                takeScreenshotsOnFail: true,
                screenshotsPath: "tests/screenshots",
                filter: (testName, fixtureName, fixturePath) => {
                    const testNameFilter = testName.match(
                        new RegExp(grunt.option("testName"))
                    )
                    const fixtureNameFilter = fixtureName.match(
                        new RegExp(grunt.option("fixtureName"))
                    )
                    const fixturePathFilter = fixturePath.match(
                        new RegExp(grunt.option("fixturePath"))
                    )
                    return (
                        testNameFilter && fixtureNameFilter && fixturePathFilter
                    )
                }
            }
        }
    }
})

Options

files

Type: Array

Default: []

Details: Configures the test runner to run tests from the specified files.

browsers

Type: Array

Default: []

Details: Specifying Browsers for Test Task

Configures the test runner to run tests in the specified browsers.

Required

concurrency

Type: Number

Default: 1

Details: Specifies that tests should run concurrently.

reporters

Type: Array

Default: ['spec']

Details: Reporters

Specifies the reporter. Output file can be passed along with reporter name by colon (:) separator. Example
reporters: ['json:report.json', 'xunit:report.xml']

filter

Type: function(testName, fixtureName, fixturePath)

Default: null

Details: runner.filter

Allows you to manually select which tests should be run.

screenshotsPath

Type: String

Default: null

Details: Screenshots path

The path to which the screenshots will be saved. Enables the test runner to take screenshots of the tested webpages.

screenshotsPathPattern

Type: String

Default: null

Details: Screenshots path pattern

Specifies a custom pattern to compose screenshot files' relative path and name. This pattern overrides the default path pattern.

takeScreenshotsOnFail

Type: Boolean

Default: false

Details: Take screenshots on fail

Specifies if screenshots should be taken automatically whenever a test fails. Requires that the screenshotsPath is set.

skipJsErrors

Type: Boolean

Default: false

Details: Skip JS errors

Defines whether to continue running a test after a JavaScript error occurs on a page (true), or consider such a test failed (false).

quarantineMode

Type: Boolean

Default: false

Defines whether to enable the quarantine mode.

selectorTimeout

Type: Number

Default: 10000

Details: Selector timeout

Specifies the amount of time, in milliseconds, within which selectors make attempts to obtain a node to be returned.

assertionTimeout

Type: Number

Default: 3000

Details: Assertion options

Specifies the amount of time, in milliseconds, within which TestCafe makes attempts to successfully execute an assertion if a selector property or a client function was passed as an actual value.

speed

Type: Number

Default: 1

Details : Speed factor

Specifies the speed of test execution. Should be a number between 1 (the fastest) and 0.01 (the slowest).

startApp

Type: Object { command, initDelay }

Default: { initDelay: 1000 }

Details : startApp

Specifies a shell command that will be executed before running tests. Use it to launch or deploy the application that will be tested.

proxyHost

Type: String

Default: null

Details : proxy

Specifies the proxy server used in your local network to access the Internet. You can also specify authentication credentials with the proxy host.

License

The MIT License