Releases: mojotech/pioneer
v0.8.0 - wow
Breaking Changes
- Removed global variables (
$
,Driver
,_
,argv
) read
no longer supports multiple arguments. Changed to hash-style argumentsfindByText
removed. To find by text use the optional “text” key on thefind
methodfill
no longer supports multiple arguments. Changed to hash-style argumentsgetValue
no longer supports multiple arguments. Changed to hash-style argumentsclickAt
no longer supports multiple arguments. Changed to hash-style argumentsreadAt
no longer supports multiple arguments. Changed to hash-style arguments
Widget
- New shorthand declaration via
this.W
fromthis.Widget
- Methods now support hash-style arguments for instance…..
return new this.Widget({
root: "div"
})
.fill({
selector: "input",
value: ["Pioneer" Driver.Key.SPACE, "is", Driver.Key.SPACE, "awesome!"]
});
Helpers
addClass
,removeClass
,toggleClass
now accepts an optional selector to allow scoping within the widgetgetAttribute
- now accepts an optional selector to allow scoping within the widgetisVisible
- will first check to see if an element is present and return false if it is not.hover
- theHover
method on a widget takes the same params as find to locate the DOM node to be hovered. It returns a promise that is resolved with the widget after the mouse has been moved over the target element. If you do not pass anything to hover it will hover over the widgets root node.doubleClick
- thedoubleClick
method on a widget takes the same params as find to locate the DOM node to be doubleClicked. It returns a promise that is resolved with the widget after the mouse has been doubleClicked on the target element. If you do not pass anything to doubleClick it will double click the root node of the widget.
Widget.Fields
Fields Is now removed as being a base class. Its methods have been moved within Widget.Form
Widget.List
select
can be used to select an option from a dropdown menu. It takes a hash with an optional<selector>
in which you can specifiy either<text>
or<value>
to select by. Specifiying both text and a value will result in an error. It returns a promise that will resolve with null.
<div class=”form2”>
<select>
<option value="one">Option Number 1</option>
<option value="two">Option Number 2</option>
<option value="three">Option Number 3</option>
</select>
</div>
return new this.Widget.Form({
root: "form2"
})
.select({
selector: "select",
value: "three"
})
//Result of selecting “Option Number 3”
invoke
- arguments to pass to the invoking method can now be passed using an object
Scaffolding
Pioneer can generate a scaffold for you to build your suite on via the newly added--scaffold
command line flag.
Scaffold generates a tests/ directory, with features/, steps/ and widgets/. It creates simple.feature and simple.js files that include your first Pioneer test! It also creates a .pioneer.json file in your current working directory.
The option to generate a scaffold is also presented if Pioneer is called without specifying a feature file.
Configuration
- Pioneer no longer has a default configuration. A similar goal can be accomplished via a
.pioneer.json
within the directory that you run your tests from.
v0.7.0
0.7 changelog
Widget
Accessors
- getValue - The
getValue
method lets you get the current value of a given input node. It returns a promise that resolves with the value of the node. - read - No longer to be used with input fields (was extracted to
getValue
) - getInnerHTML - Returns a promise that resolves with the innerHTML of the selector element.
- getOuterHTML - Returns a promise that resolves with the outerHTML of the selector element.
Helpers
- addClass
- removeClass
- toggleClass
Widget.List
Helpers
- clickAt -
clickAt
is a combination of the at method that allows clicking on a certain index of list. The optional<selector>
parameter allows for scoping within index. It returns a promise that is resolved when the index has been clicked. - readAt -
readAt
is a combination of the at method and the read method and allows for scoping within an el at the given index. The optional<selector>
parameter allows for scoping within index. There is also an optional transformer argument that mirrors the default read implementation. Read at
returns a promise that resolves with the value of read - each - Returns a promise that resolves with the list items after each item in the list has been iterated over. The iterator method receives two arguments, the widget instance and the index of the item being iterated over.
- invoke - Returns a promise that resolves when the specified method has been invoked on all children.
Docs
- Added missing documentation for forms and fields
Configuration
Configuring pioneer options can now be done using a JSON file. If no configuration path is passed in using --configPath=
, then pioneer uses the default configuration settings.
Pioneer will also look for a .pioneer.json file in the directory that you invoke the command from.
The --prevent-browser-reload
flag is no longer valid, it has been changed to --preventReload=true
. From configuration it can be specified as { “preventReload”: true }
Cleanup
- Remove Pioneer.Iframe from core - https://github.com/mojotech/pioneer.iframe
- Remove Pioneer.View from core - https://github.com/mojotech/pioneer.marionette
- Integration features/steps separated out to several files
Formatting
Pioneer now has its own format type that is uses by default. This formatter changed the way in which the test summary is displayed. Failing steps will now be accompanied by the feature file and line number that they correspond with.
v0.6.0
- Features
- Forms now default to
form
for their root selector. getText
is now available on Widgets.sendKeys
is now available on Widgets.- The
fill
method now takes one or two arguments. When only passed a single argument will default to filling the widgets root node with the passed argument.
- Forms now default to
- Refactors
- Invoke cucumber programmatically vs via an exec.
- General Doc improvements
v0.5.0
- Features
isVisible
is now available on a widget.findByText
is now available on a widget to enable you to lookup children of a widget based on arbitrary text content.getAttribute
is now available on a widget, for reading a single attribute of a node.findWhere
is now available on aDill.List
widget for finding a singlewebElement
based on a filter method.Iframe
Widget was added for interacting with iframes and switching focus in and out of them.- You can now disable the reloading of the browser instance between tests via the
--prevent-browser-reload
CLI flag. - Error stacktraces are now limited to 5 lines.
- A
freeze
utility method and step definition were added for aiding debugging. The freeze method prevents the steps from continuing until the user presses a key in the terminal.
- Fixes
- Widget.list children lookup no longer uses the broken
nth
child based selector.
- Widget.list children lookup no longer uses the broken