Class: Chop::Form
- Inherits:
-
Struct
- Object
- Struct
- Chop::Form
- Defined in:
- lib/chop/form.rb
Defined Under Namespace
Classes: Checkbox, Default, Field, FieldFinder, MultipleCheckbox, MultipleFile, MultipleSelect, Radio, Select, SingleFile, Textarea, ViaJavascript
Instance Attribute Summary collapse
-
#path ⇒ Object
Returns the value of attribute path.
-
#session ⇒ Object
Returns the value of attribute session.
-
#table ⇒ Object
Returns the value of attribute table.
Class Method Summary collapse
-
.diff!(selector, table, session: Capybara.current_session, timeout: nil, &block) ⇒ Object
Capybara's #synchronize is not re-entrant, so the finds below get a single attempt each and have to retry out here instead — hence ElementNotFound in the error list.
- .fill_in!(table, session: Capybara.current_session, path: "features/support/fixtures") ⇒ Object
Instance Method Summary collapse
Instance Attribute Details
#path ⇒ Object
Returns the value of attribute path
5 6 7 |
# File 'lib/chop/form.rb', line 5 def path @path end |
#session ⇒ Object
Returns the value of attribute session
5 6 7 |
# File 'lib/chop/form.rb', line 5 def session @session end |
#table ⇒ Object
Returns the value of attribute table
5 6 7 |
# File 'lib/chop/form.rb', line 5 def table @table end |
Class Method Details
.diff!(selector, table, session: Capybara.current_session, timeout: nil, &block) ⇒ Object
Capybara's #synchronize is not re-entrant, so the finds below get a single
attempt each and have to retry out here instead — hence ElementNotFound in
the error list. A block that post-processes actual should raise
Capybara::ElementNotFound to ask for a re-read of a half-rendered form.
14 15 16 17 18 19 20 21 22 |
# File 'lib/chop/form.rb', line 14 def self.diff! selector, table, session: Capybara.current_session, timeout: nil, &block errors = session.driver.invalid_element_errors + [ Cucumber::MultilineArgument::DataTable::Different, Capybara::ElementNotFound, ] session.document.synchronize timeout || Capybara.default_max_wait_time, errors: errors do diff_once! selector, table, session: session, &block end end |
.fill_in!(table, session: Capybara.current_session, path: "features/support/fixtures") ⇒ Object
6 7 8 |
# File 'lib/chop/form.rb', line 6 def self.fill_in! table, session: Capybara.current_session, path: "features/support/fixtures" new(table, session, path).fill_in! end |