npm.io
0.3.1 • Published 8 years ago

tractor-plugin-screen-size

Licence
MIT
Version
0.3.1
Deps
0
Vulns
0
Weekly
0

tractor-plugin-screen-size

Plugin for tractor for running tests at different screen sizes.

Greenkeeper badge npm version bitHound Overall Score Code Climate Test Coverage

How to use:

As config:

You can add a screenSizes property to your "tractor.conf.js" file. Each size given will create a tag, which will resize the browser before your test runs.

module.exports = {
    screenSizes: {
        sm: { width: 360, height: 480 }, // Creates a tag @screen-size:sm, at 360x840
        md: 768 // Creates a tag @screen-size:md, at 768x1000
    }
};
Within a test:

You can also use the ScreenSize.setSize method in a Page Object. It takes a string which should be the name of the size from your config, e.g. 'sm' or 'md' with the config from above.