Browser actions
Instruction | Description |
---|---|
browser.get("https://minium.vilt.io/"); |
Navigates to an URL |
browser.configure().window().maximize(); |
Maximizes the browser window |
browser.navigate().refresh(); |
Refreshes the page |
Element selection
Instruction | Description |
---|---|
$("#id"); |
Selects the element with ID id |
$(".className"); |
Selects the elements with class className |
$("input, select"); |
Select the elements of type input and select |
$("button").withText("text"); |
Selects the button elements with text text |
$(":input").withLabel("label"); |
Selects the input elements with label label |
$("span").withAttr("attrName", "attrValue"); |
Selects the span elements whose attribute attrName is attrValue |
$("td").below($("th").withText("header")); |
Selects the td elements below the table header with text header |
$("button").rightOf($(":password")); |
Selects the buttons at the right of password fields |
$("span").above(elem); |
Selects the span elements above elem |
$("span").leftOf(elem); |
Selects the span elements at the left of elem |
Interaction with elements
Instruction | Description |
---|---|
elem.fill("text"); |
Fills the text input field elem with text |
elem.click(); |
Clicks on elem |
elem.select("value"); |
Selects the option with value value from the drop-down list elem |
elem.sendKeys("C:/report.pdf"); |
Uploads the file C:/report.pdf to the file input element elem |
elem.scrollIntoView(); |
Scrolls to elem |
Assertions
Instruction | Description |
---|---|
expect(elem).to.exist(); |
Asserts that elem exists |
expect(elem).to.not.exist(); |
Asserts that elem does not exist |
expect(elem).to.have.text("text"); |
Asserts that elem has text text |
expect(value).to.be(expectedValue); |
Asserts that value equals expectedValue |
expect(elems).to.have.size(n); |
Asserts that elems matches n elements |
expect(elem).to.have.css("property", "value"); |
Asserts that elem has the CSS property property with value value |