Options

You don't need any of these. Elsetest works out of the box: start it and give it your site's address. The options are for when you want more control over a test (and, admittedly, for search engines 😊).

Every option works both on the command line and in a config file (--config <file>), under the same name: --headless or "headless": true, --delay 20 or "delay": 20. The command line overrides the file. The plugins have options of their own, given with --plugin: see the plugins.

Selectors

Many options take a selector: it says which elements of the page the option is about. It's a CSS selector, as in a stylesheet or document.querySelectorAll(), e.g.:

Your browser's developer tools show an element's id and classes: right-click it and choose Inspect. Where an option says so, it also takes XPath, prefixed with xpath:, which can find an element by its text: xpath://button[contains(., "Accept")]. More on CSS selectors: MDN's guide.

Instead of setting a selector, a site can mark its elements in its HTML: each selector option has a data-elsetest- attribute of its own, named below.

What to test

url

--url <url> or in a config file "url": "<url>"

The web site URL; https:// is added when no scheme is given. For HTTP basic authentication, include the credentials: https://username:password@example.com (percent-encode special characters, e.g. @ as %40).

scope

--scope <url or path> or in a config file "scope": "<url or path>"

Only test the pages under this URL or path, e.g. /shop (with /shop/cart, not /shopping): links elsewhere are left alone, and any other page restarts from the start URL. A login page outside it is fine.

Default: the whole site.

duration

--duration <time> or in a config file "duration": "<time>"

Quit the test after running for this long, in minutes or hours, e.g. 30m or 4h.

Default: run forever.

The site

ignoreSelector

--ignoreSelector <selector> or in a config file "ignoreSelector": "<selector>"

Elements no plugin acts on, nor on anything inside them (a plugin's own ignoreSelector wins). The checks still look at them: to leave part of the page out of one (CheckAccessibility, ValidateHTML, CheckOverlap, CheckSpelling, CheckBrokenText), use its own ignoreSelector. The site can also mark the elements in its HTML with the attribute data-elsetest-ignore.

Default: common logout/sign-out controls.

ignoreText

--ignoreText <regex> or in a config file "ignoreText": "<regex>"

No plugin acts on a control whose text or label matches this case-insensitive regular expression; "" to act on anything (a plugin's own ignoreText wins).

Default: log out/sign out, in a few languages.

errorSelector

--errorSelector <selector> or in a config file "errorSelector": "<selector>"

Log an error whenever an element matching this selector is on the page. The site can also mark the elements in its HTML with the attribute data-elsetest-error.

Default: none.

messageSelector

--messageSelector <css selector> or in a config file "messageSelector": "<css selector>"

The site's messages (toasts, notices, a form's errors) that aren't marked up for screen readers, so the log shows what the site answers the test's actions ("Page says"). Marked messages and new text in a form just sent are found anyway. The site can also mark the elements in its HTML with the attribute data-elsetest-message.

Default: none.

cookies

--cookies <name=value;...> or in a config file "cookies": "<name=value;...>"

Cookies to set for the site's hostname before it loads, e.g. the one a site sets when its cookie banner is dismissed, so it isn't shown.

Default: none.

localStorage

--localStorage <key=value;...> or in a config file "localStorage": "<key=value;...>"

localStorage entries to set before the site loads, e.g. the one a site stores when its welcome dialog or cookie banner is dismissed, so it isn't shown.

Default: none.

delay

--delay <ms> or in a config file "delay": 10

Pause after each action (a click, typing, a key...), in milliseconds. Raise it if the test acts faster than the site can keep up with.

Default: 10.

blockRequests

--blockRequests <methods> or in a config file "blockRequests": "<methods>"

Block the browser's requests with these HTTP methods, separated by commas, e.g. POST,PUT,PATCH,DELETE to test a live site without sending it data: forms aren't sent, nor what the page's scripts send, except while the Login plugin logs in. Each address blocked is logged once. A link that changes data (GET) still does, and the Type plugins are pointless then, so turn them off too (--setup does both when told the site is live).

Any of POST, PUT, PATCH and DELETE. Default: none.

Results

highlight

--highlight <level> or in a config file "highlight": "<level>"

Outline things for a moment (problems in red, what the test acts on in blue), so the video shows them: error for the errors found (server errors, JS injection), warn for the other problems found too, info for what the test acts on too, none for nothing.

One of info, warn, error, none. Default: info.

highlightExplain

--highlightExplain <level> or in a config file "highlightExplain": "<level>"

Which of the outlines highlight shows also get a short caption saying what is outlined, by the same levels.

One of info, warn, error, none. Default: warn.

logLevel

--logLevel <level> or in a config file "logLevel": "<level>"

Log file (elsetest.log) verbosity; none writes no log file.

One of trace, debug, info, warn, error, fatal, none. Default: info.

ignoreLogs

--ignoreLogs <texts> or in a config file "ignoreLogs": "<texts>"

Drop log messages containing any of these ;-separated texts (not case-sensitive).

Default: none.

failOn

--failOn <level> or in a config file "failOn": "<level>"

Exit with code 3 when the test has logged a message at this level or above (error: the errors found, e.g. server errors; warn: the other problems too), so a CI pipeline fails on problems found. Messages ignoreLogs drops don't count. Exit code 1 (the test couldn't go on) and the others win over it.

One of error, warn, none. Default: none.

dir

--dir <path> or in a config file "dir": "<path>"

Directory for the output. Each run writes elsetest.log/elsetest.mp4 into its own subdirectory there, named after the url.

Default: Elsetest in your Documents folder.

video

--video [true|false] or in a config file "video": false

Record the run to elsetest.mp4.

Default: true.

UI

gui

--gui [true|false] or in a config file "gui": false

Show the test in a window of its own: its progress, then its video and log, and asks for the site to test there if no url is given. With false, it's shown in the terminal instead. Without a terminal (e.g. in CI), it's false unless set.

Default: true.

headless

--headless [true|false] or in a config file "headless": true

Run the browser headless.

Default: false.

windowSize

--windowSize <width>x<height> or in a config file "windowSize": "<width>x<height>"

The size of the browser window's page area, which the video shows, in CSS pixels, e.g. 1280x720: smaller than a screen makes the video's text larger. A visible window is at least 500 wide, and its video is in the screen's pixels (e.g. 1600x900 at 125% display scaling).

Default: a 1920x1080 window, or the screen when smaller.

chrome

--chrome <path> or in a config file "chrome": "<path>"

Test with this installed Chrome or Chromium instead of the Chrome for Testing that Elsetest downloads on its first run.

Default: the downloaded Chrome for Testing.

This page is generated from the help texts of Elsetest 0.9.8. The same help is in the program: elsetest --help.