Updated UI testing (markdown)

Kazuki Nakanishi 2018-11-20 11:40:42 +09:00
parent 0af72103cc
commit fb13764c5b
1 changed files with 58 additions and 3 deletions

@ -71,10 +71,15 @@ Provides the functionality that operates on a workspace.
| Function | Description |
| -------- | ----------- |
| addNode(type, x, y) | Adds a new node on workspace and return its object. `type` is the type of nodes which is defined in palette_page.js. `x` and `y` is a coordinate of node from the top-left of workspace. |
| deleteAllNodes() | Deletes all nodes on a workspace. This function is basically called before each test case. |
| addNode(type, x, y) | Adds a new node on workspace and return its object. `type` is the type of nodes which is defined in palette_page.js. `x` and `y` are the coordinate of node from the top-left of workspace. `x` and `y` can be omitted. |
| init(width, height) | Deletes all nodes on a workspace. `width` and `height` affects automatic node deployment. `width` and `height` can be omitted. This function should be basically called before each test case. |
| deploy() | Hits a deploy button. |
If you add several nodes calling `addNode` without specifying `x` and `y`, those nodes are automatically deployed in line.
The parameters of `flowLayout` will be used for this deployment.
`widthInterval` is the interval between nodes. If the left end of a node is over `flowRightEnd`, the node will be deployed on the next line. `heightInterval` is the interval between the lines.
These parameters are adjusted based on the display resolution of 1366 x 768.
### Debug tab
* test/editor/pageobjects/editor/debugTab_page.js
@ -82,7 +87,7 @@ Provides the functionality that operates on a debug tab.
| Function | Description |
| -------- | ----------- |
| open() | Opens a debug tab. |
| open(retainMessage) | Opens a debug tab. When called, debug message will be cleared as a default behavior. If you do not want to delete the existing message, set `true` to `retainMessage`. |
| getMessage(index) | Returns an `index`-th message on the debug window. If `index` is omitted, returns the first message. |
| clearMessage() | Clears all messages on debug tab. |
@ -108,6 +113,7 @@ Provides the functionality that contains the common operation among all nodes.
| edit() | Opens an edit window. |
| clickOk() | Hits a Done button on edit tab. |
| connect(targetNode) | Connects a wire to a `targetNode`. `targetNode` is the object that `Workspace.addNode` returns. |
| clickLeftButton() | Click a left button of a node. |
### Inject node
* test/editor/pageobjects/nodes/core/core/20-inject_page.js
@ -151,6 +157,37 @@ Provides the functionality that operates a template node.
| setFormat(format) | Sets a syntax type (not format!). |
| setTemplate(template) | Sets a template text. |
### Mqttin node
* test/editor/pageobjects/nodes/core/io/10-mqttin_page.js
Provides the functionality that operates an mqtt-in node.
| Function | Description |
| -------- | ----------- |
| setTopic(topic) | Sets a Topic. |
| setQoS(qos) | Sets a QoS. |
### Mqttout node
* test/editor/pageobjects/nodes/core/io/10-mqttout_page.js
Provides the functionality that operates an mqtt-out node.
| Function | Description |
| -------- | ----------- |
| setTopic(topic) | Sets a Topic. |
| setRetain(retain) | Sets a flag of whether to retain the message. |
### Mqtt-broker node (Configuration node)
* test/editor/pageobjects/nodes/core/io/10-mqttconfig_page.js
Provides the functionality of configuration node for mqtt nodes.
| Function | Description |
| -------- | ----------- |
| setServer(broker, port) | Sets a MQTT broker. |
| clickOk() | Closes a configuration window. |
| edit() | Opens a configuration window. |
### Httpin node
* test/editor/pageobjects/nodes/core/io/21-httpin_page.js
@ -172,6 +209,12 @@ Provides the functionality that operates an httprequest node.
| setUrl(url) | Sets a Url. |
| setReturn(ret) | Sets a return type of response. |
### Httpresponse node
* test/editor/pageobjects/nodes/core/io/21-httpresponse_page.js
Provides the functionality that operates an httpresponse node.
There are no API for this node so far.
### Change node
* test/editor/pageobjects/nodes/core/logic/15-change_page.js
@ -179,6 +222,7 @@ Provides the functionality that operates a change node.
| Function | Description |
| -------- | ----------- |
| setT(t, index) | Sets a type. |
| ruleSet(p, pt, to, tot, index) | Sets a rule of change node. You can see the first four arguments in the `rules` object on the information tab. `index` indicates the order of rules. If `index` is omitted, the first rule is operated. |
| ruleDelete(index) | Deletes a rule. |
| ruleMove(p, to, index) | Moves or rename a `index`-th rule. |
@ -203,6 +247,16 @@ Provides the functionality that operates an html node.
| -------- | ----------- |
| setSelector(tag) | Sets a selector to extract a specific element. |
### JSON node
* test/editor/pageobjects/nodes/core/parsers/70-JSON_page.js
Provides the functionality that operates an json node.
| Function | Description |
| -------- | ----------- |
| setAction(action) | Sets an action. |
| setProperty(property) | Sets a property. |
### Filein node
* test/editor/pageobjects/nodes/core/storage/50-filein_page.js
@ -301,3 +355,4 @@ To check the CSS selector or XPath of the target element that you want to manipu
# Tips
* When running UI test with --non-headless option, if you move your mouse on the on-going testing window, it may affect the test and will be failed.
* When an error occurred, Webdriver IO takes a snapshot and stores it under test/errorShots directory. This may be useful for investigating the error result. You can also call [browser.saveScreenshot](http://webdriver.io/api/utility/saveScreenshot.html) API to take a snapshot by yourself.