Skip to content

Commit

Permalink
updated docs to v1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
beatfactor committed Dec 23, 2018
1 parent 92ea22b commit f86bacd
Show file tree
Hide file tree
Showing 23 changed files with 498 additions and 305 deletions.
8 changes: 5 additions & 3 deletions gettingstarted/browser-setup/chromedriver.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ It is available for Chrome on Android and Chrome on Desktop (Mac, Linux, Windows

ChromeDriver can be downloaded from the [ChromeDriver Downloads](http://chromedriver.chromium.org/downloads) page. Or you can use the [chromedriver](https://www.npmjs.com/package/chromedriver) NPM package as a dependency in your project:

<pre>$ npm install chromedriver --save-dev</pre>
<pre>npm install chromedriver --save-dev</pre>

#### Standalone Usage

Nightwatch can manage the ChromeDriver service automatically, as with other WebDriver services, such as GeckoDriver. To use ChromeDriver directly, add this to your `nightwatch.json`:
Nightwatch can manage the ChromeDriver service automatically, as with other WebDriver services, such as GeckoDriver. To use ChromeDriver directly, configure Nightwatch as below:

<pre><code class="language-javascript">{
<strong>"webdriver"</strong>: {
Expand Down Expand Up @@ -51,7 +51,9 @@ If you're using ChromeDriver through Selenium Server, simply set the cli argumen
}
}</code></pre>

##### ChromeOptions
<p></p>

#### ChromeOptions
You can specify Chrome options or switches using the `chromeOptions` dictionary, under the `desiredCapabilities`. Refer to the [ChromeDriver website](https://sites.google.com/a/chromium.org/chromedriver/capabilities#TOC-chromeOptions-object) for a fill list of supported capabilities and options.

##### Example of detailed config
Expand Down
4 changes: 2 additions & 2 deletions gettingstarted/browser-setup/edgedriver.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

WebDriver for Microsoft Edge is now a Windows Feature on Demand. To install run the following in an elevated command prompt:

<pre>$ DISM.exe /Online /Add-Capability /CapabilityName:Microsoft.WebDriver~~~~0.0.1.0</pre>
<pre class="windows-cmd">DISM.exe /Online /Add-Capability /CapabilityName:Microsoft.WebDriver~~~~0.0.1.0</pre>

More details about installation and usage documentation are available on the official [Microsoft WebDriver homepage](https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/).

Expand Down Expand Up @@ -90,4 +90,4 @@ Usage:
MicrosoftWebDriver.exe --host=<HostName> --port=<PortNumber> --package=<Package> --verbose</code></pre>

##### Implementation Status
EdgeDriver is not yet feature complete, which means it does not yet offer full conformance with the WebDriver standard or complete compatibility with Selenium. Implementation status can be tracked on the [Microsoft WebDriver homepage](https://docs.microsoft.com/en-us/microsoft-edge/webdriver).
EdgeDriver is not yet feature complete, which means it does not yet offer full conformance with the WebDriver standard or complete compatibility with Selenium. Implementation status can be tracked on the <a href="https://docs.microsoft.com/en-us/microsoft-edge/webdriver" target="_blank">Microsoft WebDriver homepage</a>.
10 changes: 5 additions & 5 deletions gettingstarted/browser-setup/gecko-driver.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Starting with Firefox 48, GeckoDriver is the only way to automate Firefox, the l

GeckoDriver can be downloaded from the [Releases page](https://github.com/mozilla/geckodriver/releases) on GitHub. Release notes are also available there. Or you can use the [geckodriver](https://www.npmjs.com/package/geckodriver) NPM package as a dependency in your project:

<pre>$ npm install geckodriver --save-dev</pre>
<pre>npm install geckodriver --save-dev</pre>

Selenium 2.x users are advised to use version __v0.9__, whereas Selenium 3 users should use the latest version.

Expand All @@ -20,7 +20,7 @@ Nightwatch can manage the GeckoDriver service automatically, as with other WebDr
<pre><code class="language-javascript">{
<strong>"webdriver"</strong>: {
"start_process" : true,
"server_path": "./bin/geckodriver-0.21",
"server_path": "./bin/geckodriver-0.23",
"cli_args": [
"--log", "debug"
],
Expand Down Expand Up @@ -59,11 +59,11 @@ GeckoDriver can also be used as a standalone application. Usage steps are docume
<br><br>
##### Command line usage

<pre><code>$ ./bin/geckodriver-0.10 -help
geckodriver 0.10.0
<pre><code>$ ./bin/geckodriver-0.23 -help
geckodriver 0.23.0

USAGE:
geckodriver-0.10 [FLAGS] [OPTIONS]
geckodriver-0.23 [FLAGS] [OPTIONS]

FLAGS:
--connect-existing Connect to an existing Firefox instance
Expand Down
132 changes: 115 additions & 17 deletions gettingstarted/configuration/config-basic-settings.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
## Basic Settings
## Base Settings
Below are the default settings that will be passed to the Nightwatch instance.

<table class="table table-bordered table-striped">
<thead>
Expand All @@ -10,91 +11,188 @@
</tr>
</thead>
<tbody>
<tr>
<td>src_folders</td>
<tr>
<td>`webdriver`</td>
<td>object</td>
<td></td>
<td>An object containing **WebDriver** related configuration options. See the next section for details.</td>
</tr>
<tr>
<td>`src_folders` <span class="optional">Optional</span></td>
<td>string|array</td>
<td>none</td>
<td>An array of folders (excluding subfolders) where the tests are located.</td>
</tr>
<td>
An array of folders (excluding subfolders) where the tests are located.
<br><br>
If this is not specified, the test source must be passed inline as the second argument to the [test runner](http://nightwatchjs.org/guide#nightwatch-runner).
</td>
</tr>
<tr>
<td>webdriver</td>
<td>`test_settings`</td>
<td>object</td>
<td></td>
<td>An object containing WebDriver related configuration options. See the next section for details.</td>
<td>This object contains all the test related options and can contain multiple environments. See below for details.</td>
</tr>
<tr>
<td>test_settings</td>

<tr>
<td>`selenium` <span class="optional">Optional</span></td>
<td>object</td>
<td></td>
<td>This object contains all the test related options. See below for details.</td>
<td>
An object containing **Selenium Server** related configuration options. If Selenium is not used, `webdriver` options should be set instead.
<br>
Starting with Nightwatch 1.0, Selenium is only required when testing against a Grid setup or a cloud testing service (such as <a href="https://saucelabs.com/" target="_blank">SauceLabs</a> or <a href="https://www.browserstack.com/" target="_blank">BrowserStack</a>).
</td>
</tr>

<tr>
<td>output_folder <br><span class="optional">Optional</span></td>
<td>string</td>
<td>tests_output</td>
<td>The location where the JUnit XML report files will be saved.</td>
</tr>

<tr>
<td>custom_commands_path <span class="optional">Optional</span></td>
<td>string|array</td>
<td>none</td>
<td>Location(s) where custom commands will be loaded from.</td>
</tr>

<tr>
<td>custom_assertions_path <span class="optional">Optional</span></td>
<td>string|array</td>
<td>none</td>
<td>Location(s) where custom assertions will be loaded from.</td>
</tr>

<tr>
<td>page_objects_path <br><span class="optional">Optional</span></td>
<td>string|array</td>
<td>none</td>
<td>Location(s) where page object files will be loaded from.</td>
</tr>

<tr>
<td>globals_path <br><span class="optional">Optional</span></td>
<td>string</td>
<td>none</td>
<td>Location of an external globals module which will be loaded and made available to the test as a property <code>globals</code> on the main client instance. <br><br>Globals can also be defined/overwritten inside a <code>test_settings</code> environment.</td>
</tr>

<tr>
<td>live_output <br><span class="optional">Optional</span></td>
<td>boolean</td>
<td>false</td>
<td>Whether or not to buffer the output in case of parallel running. See below for details.</td>
</tr>

<tr>
<td>disable_colors <br><span class="optional">Optional</span></td>
<td>boolean</td>
<td>false</td>
<td>Controls whether or not to disable coloring of the cli output globally.</td>
</tr>

<tr>
<td>parallel_process_delay <br><span class="optional">Optional</span></td>
<td>integer</td>
<td>10</td>
<td>Specifies the delay(in milliseconds) between starting the child processes when running in parallel mode.</td>
</tr>

<tr>
<td>test_workers <br><span class="optional">Optional</span></td>
<td>boolean|object</td>
<td>false</td>
<td>Whether or not to run individual test files in parallel. If set to `true`, runs the tests in parallel and determines the number of workers automatically. <br>If set to an object, can specify specify the number of workers as `"auto"` or a `number`.
<br><br>Example: <code>"test_workers" : {"enabled" : true, "workers" : "auto"}</code></td>
</tr>

<tr>
<td>test_runner <br><span class="optional">Optional</span></td>
<td>string|object</td>
<td>"default"</td>
<td>Specifies which test runner to use when running the tests. Values can be either `default` (built-in nightwatch runner) or `mocha`.
<br><br>Example: <code>"test_runner" : {"type" : "mocha", "options" : {"ui" : "tdd"}}</code></td>
</tr>
<tr>
<td>unit_tests_mode <br><span class="optional">Optional</span></td>
<td>boolean</td>
<td>false</td>
<td>Controls whether to run tests in unit testing mode, which means the session will not automatically be created.</td>
</tr>
</tr>

<tr>
<td>unit_tests_mode <br><span class="optional">Optional</span></td>
<td>boolean</td>
<td>false</td>
<td>Controls whether to run tests in unit testing mode, which means the session will not automatically be created.</td>
</tr>
</tbody>
</table>

#### Environment specific settings
It is likely you will run your tests against multiple environments, and so Nightwatch makes it convenient to define environment specific test settings (under the `"test_settings"` dictionary).
You can overwrite any test setting for each environment as needed. More on test environments under the [Nightwatch Runner](http://nightwatchjs.org/guide#test-environments) section.

Nightwatch includes a sample configuration file, which contains multiple environments for various type of requirements. It is located inside the [Github repo](https://github.com/nightwatchjs/nightwatch/blob/master/bin/nightwatch.json):

Here's an extract. By default it is using Firefox as the target browser, but it includes configuration for Chrome and Selenium Server as well:

<pre><code class="language-javascript">
{
"src_folders" : ["./examples/tests", "./examples/mocha", "./examples/unittests"],
"custom_commands_path" : "./examples/custom-commands",
"custom_assertions_path" : "./examples/custom-assertions",
"page_objects_path" : "./examples/pages",
"globals_path" : "./examples/globalsModule.js",

"webdriver" : {
"start_process": true
},

"test_settings" : {
"default" : {
"webdriver": {
"server_path": "./bin/geckodriver-0.23",
"port": 4444,
"cli_args": [
"--log", "debug"
]
},
"filter": ["./examples/tests"],
"desiredCapabilities" : {
"browserName" : "firefox",
"acceptInsecureCerts" : true
}
},

"chrome" : {
"webdriver": {
"port": 9515,
"server_path": "./bin/chromedriver-2.32",
"cli_args": [
"--verbose"
]
},

"desiredCapabilities" : {
"browserName" : "chrome",
"loggingPrefs": {"driver": "INFO", "server": "OFF", "browser": "INFO"}
}
},

"selenium_server" : {
"selenium" : {
"start_process": true,
"host": "localhost",
"server_path": "./bin/selenium-server-standalone-3.10.0.jar",
"cli_args": {
"webdriver.gecko.driver": "./bin/geckodriver-0.23",
"webdriver.chrome.driver": "./bin/chromedriver-2.32"
}
},

"desiredCapabilities" : {
"browserName" : "firefox",
"acceptSslCerts": true
}
}
}
}</code></pre>
Loading

0 comments on commit f86bacd

Please sign in to comment.