@bbc/nightwatch-commands
Advanced tools
{ | ||
"name": "@bbc/nightwatch-commands", | ||
"version": "1.0.9", | ||
"version": "1.0.10", | ||
"description": "Basic Nightwatch Commands", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -5,2 +5,3 @@ # Keywords | ||
* [getVersionNumbers](#getversionnumbers) | ||
* [hideElement](#hideElement) | ||
* [screenSize](#screensize) | ||
@@ -41,7 +42,7 @@ * [setCheckbox](#setcheckbox) | ||
The ```getVersionNumber(['productName'])``` keyword accepts an array of productNames such as ```orbit``` or ```searchbox-app```. | ||
The ```getVersionNumber(['name'])``` keyword accepts an array of names. | ||
### How it works | ||
It reads in the HTML source of a page and then parses it to look for the ```productName``` which is of the format ```productName/xx.yy.zz```. Where ```xx.yy.zz``` are the version numbers. | ||
It reads in the HTML source of a page and then parses it to look for the ```name``` which is of the format ```name/xx.yy.zz```. Where ```xx.yy.zz``` are the version numbers. | ||
@@ -51,5 +52,25 @@ ### Example | ||
``` | ||
browser.page.<page>.getVersionNumbers(['productName']); | ||
browser.page.<page>.getVersionNumbers(['name']); | ||
``` | ||
## hideElement | ||
### Purpose | ||
This can hide an element from the page and is useful for when performing screen comparisons and ignoring certain sections of the page | ||
### Parameters | ||
The ```hideElement(elementId)``` keyword accepts an element ID. | ||
### How it works | ||
It edits the styling of the HTML in question to turn the opacity to full, so it is transparent. | ||
### Example | ||
``` | ||
browser.page.<page>.hideElement(elementId); | ||
``` | ||
## screenSize | ||
@@ -99,3 +120,3 @@ | ||
``` | ||
browser.page.object.setCheckbox('css selector', '[name="fig_uk"]', true) | ||
browser.page.object.setCheckbox('css selector', '<checkbox selector>', true) | ||
``` | ||
@@ -102,0 +123,0 @@ |
7257
17.24%8
14.29%77
20.31%140
17.65%