class

Capybara::Session

Inherits Reference < Object

Constructors

new(driver : ChromiumDriver, base_url : String = "")

Class methods

click_and_settle(driver : ChromiumDriver, click_js : String) : Nil

Click via JS, then wait a bounded moment for a navigation to start (path change) and for the document to settle. Buttons that only run JS (no navigation) fall through after the settle window.

Instance methods

all(selector : String) : Array(Node)
base_url

Capybara.app_host analog: visit("/foo") resolves against it.

base_url=(base_url : String)

Capybara.app_host analog: visit("/foo") resolves against it.

click_button(locator : String) : Nil
count(selector : String) : Int32
current_path
current_url
driver
evaluate_script(script : String) : JSON::Any | Nil
execute_script(script : String) : Nil
fill_in(locator : String, with value : String) : Nil

fill_in "Name", with: "Crystal" — by label text (label[for]), field id, name or placeholder, like the gem's field selector.

find(selector : String, wait : Time::Span = Capybara.default_wait_time) : Node
go_back(wait : Time::Span = Capybara.default_wait_time) : Nil
go_forward(wait : Time::Span = Capybara.default_wait_time) : Nil
has_content?(text : String, wait : Time::Span = Capybara.default_wait_time) : Bool
has_no_content?(text : String, wait : Time::Span = Capybara.default_wait_time) : Bool
has_selector?(selector : String, wait : Time::Span = Capybara.default_wait_time) : Bool
save_screenshot(path : String) : Nil
title
visit(path : String) : Nil
wait_until(wait : Time::Span = Capybara.default_wait_time, &block : -> Bool) : Bool