ElectronTests.query_testidMethod
query_testid(testsession::TestSession, id::String)

Returns a JSObject representing the object found for id.

ElectronTests.testsessionMethod
    testsession(f, handler; url="0.0.0.0", port=8081, timeout=300)

testsession(handler; url="0.0.0.0", port=8081, timeout=300)) do testsession
    # test code using testsession
end

This function will ensure proper setup and teardown once done with the tests or whenever an error occurs. The testsession object passed to f allows to communicate with the browser session, run javascript and get values from the html dom!

ElectronTests.trigger_keyboard_pressFunction
trigger_keyboard_press(testsession::TestSession, code::String, element=nothing)

Triggers a keyboard press on element! If element is nothing, the event will be triggered for the whole document! Find out the key code string to pass at http://keycode.info/

ElectronTests.trigger_mouse_moveFunction
trigger_mouse_move(testsession::TestSession, code::String, position::Tuple{Int, Int}, element=nothing)

Triggers a MouseMove event! If element == nothing, it will try to trigger on any canvas element found in the DOM.

JSServe.evaljsMethod
evaljs(testsession::TestSession, js::JSCode)

Runs javascript code js in testsession. Will return the return value of js. Might return garbage data, if return value isn't json serializable.

Example:

evaljs(testsession, js"document.getElementById('the-id')")
ElectronTests.@wait_forMacro
wait_test(condition)

Waits for condition expression to become true and then tests it!

ElectronTests.TestSessionType
TestSession(handler)

Main construct, which will lunch an electron browser session, serving the application created by handler(testsession)::DOM.div. Can be used via the testsession function:

testsession(handler; url="0.0.0.0", port=8081, timeout=300)) do testsession
    # test code using testsession
end

This will ensure proper setup and teardown once done with the tests. The testsession object allows to communicate with the browser session, run javascript and get values from the html dom!

Base.closeMethod
close(testsession::TestSession)

Close the testsession and clean up the state!

ElectronTests.reload!Method
reload!(testsession::TestSession)

Reloads the served application and waits untill all state is initialized.

ElectronTests.waitMethod
wait(testsession::TestSession; timeout=300)

Wait for testsession to be fully loaded! Note, if you call wait on a fully loaded test

JSServe.startMethod
start(testsession::TestSession)

Start the testsession and make sure everything is loaded correctly. Will close all connections, if any error occurs!