module Stoertebeker::DSL
Included Modules
Direct including types
Defined in:
stoertebeker/dsl.crInstance Method Summary
-
#click(selector)
Simulates a click on an element identified by the passed selector.
-
#current_path
Returns the path of the currently displayed website.
-
#current_url
Returns the url of the currently displayed website.
-
#evaluate(script)
Executes javascript and returns the resulting value (JSON).
-
#execute(*args)
Runs javascript without returning a value.
-
#execute(*args, &block : JSON::Any -> )
Runs the passed javascript and invokes the block with the output of the javascript (JSON).
-
#exists?(selector)
Returns true if the selector matches anything on the currently displayed website.
-
#inner_html(selector)
Returns the innerHTML of an element matched by the selector.
-
#page_title
Returns the title of the DOM of the currently displayed website.
-
#ping
Used to check whether the server responds
-
#quit(*args)
Terminates the electron server.
-
#request(*args)
Instructs electron to load a website:
-
#screenshot(*args)
Saves a screenshot of the currently displayed website.
-
#set_value(selector, value)
Sets the value of an input element, e.g.
-
#wait_for(*args, **kwargs)
Waits for an element to be present.#
-
#window(**args)
Sets the window width and height
Instance Method Detail
Simulates a click on an element identified by the passed selector. If the selector matches multiple elements, an error is raised.
Runs the passed javascript and invokes the block with the output of the javascript (JSON).
Returns true if the selector matches anything on the currently displayed website. The call does not wait for the element to show up, it checks the DOM immediately.
Instructs electron to load a website:
request("http://localhost:3001/example.html")
Saves a screenshot of the currently displayed website.
screenshot("./temp/example2.png")
Sets the value of an input element, e.g. a text field.
set_value(".textfield", "somevalue")
Waits for an element to be present.#
tries: the number of times the selector will be queried for (default 10) delay: the delay between each try in ms (default 20)
wait_for("h1#example1", tries: 5, delay: 20)