8000 Use em dash ( — ) where it is needed by Yeti-or · Pull Request #401 · gemini-testing/gemini · GitHub
[go: up one dir, main page]

Skip to content
This repository was archived by the owner on Sep 21, 2022. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,8 @@ We are creating a new test suite `yandex-search`, assuming that we will capture
`.main-table` element from the root URL `http://yandex.com`. We know that the
block has two states:

* `plain` – right after the page is loaded
* `with text` – with the `hello gemini` text inserted into `.input__control`
* `plain` — right after the page is loaded
* `with text` — with the `hello gemini` text inserted into `.input__control`

States are executed one after another in the order in which they are defined, without the browser
reloading in between.
Expand Down
14 changes: 7 additions & 7 deletions doc/commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ By default, this command will do two things:

Also, you can run this command with options:

* `--diff` - update only existing images, states with no reference images will be ignored;
* `--new` - generate only missing images.
* `--diff` — update only existing images, states with no reference images will be ignored;
* `--new` — generate only missing images.

If no paths are specified, each `.js` file from `gemini` directory will be
processed. By default, configuration will be loaded from `.gemini.yml` in the
Expand Down Expand Up @@ -83,21 +83,21 @@ report), partially (yellow) or was not captured at all (red).

## Common CLI options

* `--config`, `-c` – specify config file to use.
* `--config`, `-c` — specify config file to use.

* `--grep PATTERN` – execute only suites with names that match the regular
* `--grep PATTERN` — execute only suites with names that match the regular
expression pattern.

* `--browser ID` — execute suite only for specified browser id. Can be used
multiple times. Can be also specified with `GEMINI_BROWSERS` and `GEMINI_SKIP_BROWSERS`
environment variables (browsers should be separated by a coma). If both CLI option
and env variable are set, CLI has precedence.

* `--set`, `-s` - specify set to run
* `--set`, `-s` — specify set to run

* `--help` – display help message.
* `--help` — display help message.

* `--version` – display version.
* `--version` — display version.

## Overriding config options

Expand Down
68 changes: 34 additions & 34 deletions doc/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,22 +72,22 @@ system:
There is a `system` section in the config file, which contains global `gemini`
settings. These settings can not be set per-browser.

* `projectRoot` – root directory of a project. All relative paths in config or
* `projectRoot` — root directory of a project. All relative paths in config or
options will be resolved relatively to it. By default it is the directory
config file is placed in.

* `sourceRoot` – directory which contains the source files. Local sources
* `sourceRoot` — directory which contains the source files. Local sources
will be used in the coverage report when the source map is available, but
the sources can not be downloaded via URLs from the test pages. By default,
it is equal to `projectRoot`.

* `tempDir` – directory to save temporary images (current states) to. This
* `tempDir` — directory to save temporary images (current states) to. This
directory should exist. Gemini will create own temp directory in it with name
starting with `.gemini.tmp.` where all temporary images will be saved.
After run created directory will be removed. If not set system temp
directory will be used.

* `exclude` - array of glob patterns to exclude paths from the test search. For example:
* `exclude` — array of glob patterns to exclude paths from the test search. For example:

```yaml
exclude:
Expand All @@ -96,7 +96,7 @@ exclude:
- foo/{bar,baz}/*.js
```

* `plugins` - list of plugins to enable. Should have form of `pluginName:
* `plugins` — list of plugins to enable. Should have form of `pluginName:
settings`. For example:

```yaml
Expand All @@ -109,32 +109,32 @@ exclude:

Each plugin should be an installed npm package named `gemini-<pluginName>`.

* `debug` – turn on debug logging to the terminal.
* `debug` — turn on debug logging to the terminal.

* `parallelLimit` – by default, `gemini` will run all browsers simultaneously.
* `parallelLimit` — by default, `gemini` will run all browsers simultaneously.
Sometimes (i.e. when using cloud services, such as SauceLabs) you have
a limit of a number of browser that can be run once at a time. Use this
option to limit the number of browsers that `gemini` will try to run in
parallel.

* `diffColor` – specifies color which will be used to highlight differences
* `diffColor` — specifies color which will be used to highlight differences
between images. Specified in hexadecimal RGB (`#RRGGBB`). Magenta by default
(`#FF00FF`).

* `coverage` - `gemini` can gather and report CSS tests coverage. It supports
* `coverage` — `gemini` can gather and report CSS tests coverage. It supports
source maps, so you can get the report even if you are using preprocessor or
minifier. The JSON and html reports are saved to `gemini-coverage`
directory. There are many settings under this section:

- `enabled` – set to `true` to enable coverage reporting.
- `enabled` — set to `true` to enable coverage reporting.

- `map` - function which can be used for overriding default logic of source root path resolving.
- `map` — function which can be used for overriding default logic of source root path resolving.
By default it returns path to CSS file relative to the source root.
This function accepts 2 arguments:
* `url` - full url of source file which coverage should be obtained
* `rootUrl` - root url specified in the config for current browser
* `url` — full url of source file which coverage should be obtained
* `rootUrl` — root url specified in the config for current browser

- `exclude` – array of file paths or glob patterns to exclude from coverage
- `exclude` — array of file paths or glob patterns to exclude from coverage
report. For example:

```yaml
Expand All @@ -145,9 +145,9 @@ exclude:
- path/to/some.css
```

- `html` - set to false to disable html report and save only JSON.
- `html` — set to false to disable html report and save only JSON.

* `ctx` – a context which will be available in tests via method `gemini.ctx`.
* `ctx` — a context which will be available in tests via method `gemini.ctx`.

## Browsers settings

Expand All @@ -172,65 +172,65 @@ for constructing screens file names.

Settings list:

* `rootUrl` (required) – the root URL of your website. Target URLs of your
* `rootUrl` (required) — the root URL of your website. Target URLs of your
test suites will be resolved relatively to it. If top level `rootUrl` value is set
and browser `rootUrl` - is relative url, then resolved `rootUrl` will be result of
and browser `rootUrl` — is relative url, then resolved `rootUrl` will be result of
concatenation of top level `rootUrl` and individual browser `rootUrl`.

* `desiredCapabilities` (required) - WebDriver
* `desiredCapabilities` (required) — WebDriver
[DesiredCapabilites](https://github.com/SeleniumHQ/selenium/wiki/DesiredCapabilities)
for the browser. Per-browser value will be merged with top-level value
instead of overriding it.

* `gridUrl` – WebDriver URL to use for taking screenshots. By default is
* `gridUrl` — WebDriver URL to use for taking screenshots. By default is
http://localhost:4444/wd/hub

* `calibrate` - does this browser need to perform the calibration procedure.
* `calibrate` — does this browser need to perform the calibration procedure.
This procedure allows to correctly capture the image in case the particular
WebDriver implementation captures browser UI along with web page. Enabled by
default. If you are sure this is not the case for your WebDriver, you can
disable it by setting this option to `false`.

* `httpTimeout` - timeout for HTTP requests to WebDriver, milliseconds. By
* `httpTimeout` — timeout for HTTP requests to WebDriver, milliseconds. By
default the server timeout is used.

* `sessionRequestTimeout` - timeout for getting of browser sessions, milliseconds. By default the value of option `httpTimeout` is used.
* `sessionRequestTimeout` — timeout for getting of browser sessions, milliseconds. By default the value of option `httpTimeout` is used.

* `sessionQuitTimeout` - timeout for closing browser sessions, milliseconds. By default the value of option `httpTimeout` is used.
* `sessionQuitTimeout` — timeout for closing browser sessions, milliseconds. By default the value of option `httpTimeout` is used.

* `screenshotsDir` – directory to save reference screenshots to.
* `screenshotsDir` — directory to save reference screenshots to.
`<projectRoot>/gemini/screens` by default.

* `tolerance` - indicates maximum allowed
* `tolerance` — indicates maximum allowed
[CIEDE2000](http://en.wikipedia.org/wiki/Color_difference#CIEDE2000)
difference between colors. Used only in non-strict mode. By default it's 2.3
which should be enough for the most cases. Increasing global default is not
recommended, prefer changing tolerance for particular suites or states
instead.

* `windowSize` – specify browser window dimensions (i.e. `1600x1200`). If not
* `windowSize` — specify browser window dimensions (i.e. `1600x1200`). If not
specified, the size of the window depends on WebDriver. :warning: You can't set specific resolutions for browser Opera or mobile platforms. They use only full-screen resolution.

* `sessionsPerBrowser` - how many WebDriver sessions can be launched
* `sessionsPerBrowser` — how many WebDriver sessions can be launched
simultaneously for this browser. Default is 1. Increase the value if you
want to speed up your tests.

* `suitesPerSession` - maximum amount of test suites to run in each web driver
* `suitesPerSession` — maximum amount of test suites to run in each web driver
session. After limit is reached, session gets closed and new session gets
started. By default is `.inf` (no limit). Set to smaller number if you are
experiencing stability problems.

* `retry` – maximum amount of relaunch fallen tests with a critical error. If not
* `retry` — maximum amount of relaunch fallen tests with a critical error. If not
specified, the fallen tests will not be relaunched (by default it's 0).

Note that the same test never be performed in the same browser session.

* `screenshotMode` - image capture mode. There are 3 allowed values for this option:
* `screenshotMode` — image capture mode. There are 3 allowed values for this option:
* `auto` (default). Mode will be obtained automatically.
* `fullpage`. Gemini will deal with screenshot of full page.
* `viewport`. Only viewport area will be used.

* `compositeImage` – allows testing of regions which bottom bounds are outside of a viewport height (default: `false`).
* `compositeImage` — allows testing of regions which bottom bounds are outside of a viewport height (default: `false`).
In the resulting screenshot the area which fits the viewport bounds will be **joined** with the area which is outside
of the viewport height.

Expand All @@ -252,9 +252,9 @@ sets:
...
```

* `files` - list of test files or directories with test files. Should be relative to project root directory. Also, you can use masks for this property. For example: `gemini/test-suites/*.gemini.js`. Can be a string if you want to specify just one file or directory.
* `files` — list of test files or directories with test files. Should be relative to project root directory. Also, you can use masks for this property. For example: `gemini/test-suites/*.gemini.js`. Can be a string if you want to specify just one file or directory.

* `browsers` - list of browser ids to run tests specified in `files`. All browsers by default.
* `browsers` — list of browser ids to run tests specified in `files`. All browsers by default.

If sets are not specified in config, all files from `gemini` directory will be launched in all browsers specified in a config.

Expand Down
34 changes: 17 additions & 17 deletions doc/events.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
# Gemini events

* `UPDATE_RESULT` - emitted always during update. The event is emitted with 1 argument `result`:
* `result.imagePath` - absolute path to the reference image
* `result.updated` - boolean value which is `true` when reference image have been changed and `false` when not
* `UPDATE_RESULT` — emitted always during update. The event is emitted with 1 argument `result`:
* `result.imagePath` — absolute path to the reference image
* `result.updated` — boolean value which is `true` when reference image have been changed and `false` when not

* `TEST_RESULT` - emitted always after the test is completed. The event is emitted with 1 argument `result`:
* `result.referencePath` - absolute path to the reference image
* `result.currentPath` - absolute path to the current image on your disk
* `result.equal` - boolean value which is `true` when images are equal and `false` when aren't
* `result.saveDiffTo` - function is responsible for building diff and present in the `result` only if images aren't equal
* `TEST_RESULT` — emitted always after the test is completed. The event is emitted with 1 argument `result`:
* `result.referencePath` — absolute path to the reference image
* `result.currentPath` — absolute path to the current image on your disk
* `result.equal` — boolean value which is `true` when images are equal and `false` when aren't
* `result.saveDiffTo` — function is responsible for building diff and present in the `result` only if images aren't equal

* `INTERRUPT` - emitted on signal events `SIGHUP`, `SIGINT` or `SIGTERM`. The event is emitted with 1 argument `data`:
* `data.exitCode` - exit code with which gemini will be interrupted
* `INTERRUPT` — emitted on signal events `SIGHUP`, `SIGINT` or `SIGTERM`. The event is emitted with 1 argument `data`:
* `data.exitCode` — exit code with which gemini will be interrupted

* `START_BROWSER` - emitted on browser session start. Emitted with [browser instance](../lib/browser/new-browser.js). If handler returns a promise tests will be executed in this session only after the promise is resolved.
* `START_BROWSER` — emitted on browser session start. Emitted with [browser instance](../lib/browser/new-browser.js). If handler returns a promise tests will be executed in this session only after the promise is resolved.

* `STOP_BROWSER` - emitted right before browser session end. Emitted with [browser instance](../lib/browser/new-browser.js). If handler returns a promise quit will be performed only after the promise is resolved.
* `STOP_BROWSER` — emitted right before browser session end. Emitted with [browser instance](../lib/browser/new-browser.js). If handler returns a promise quit will be performed only after the promise is resolved.

* `BEGIN` - runner event. Emitted on runner start with 1 argument `data`:
* `data.suiteCollection` - suite collection which will be run
* `data.config` - gemini config
* `data.totalStates` - number of states in collection
* `data.browserIds` - all browser ids from config
* `BEGIN` — runner event. Emitted on runner start with 1 argument `data`:
* `data.suiteCollection` — suite collection which will be run
* `data.config` — gemini config
* `data.totalStates` — number of states in collection
* `data.browserIds` — all browser ids from config
4 changes: 2 additions & 2 deletions doc/plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ Gemini plugin is just an npm package with a `gemini-<plugin name>` name.
Module should export a single function which receives `Gemini` class instance
and user-specified options.
`Gemini` instance contains two fields:
* `config` - current config with specified options
* `events` - all emitted events, which can be used by plugins
* `config` — current config with specified options
* `events` — all emitted events, which can be used by plugins

For example:
```js
Expand Down
Loading
0