How long are you spending in Capybara?

> bundle exec rspec --profile -- spec/features/admin/refunds_invoices_spec.rb    63.36 seconds ./spec/features/admin/refunds_invoices_spec.rb:45
14.9 seconds ./spec/features/admin/refunds_invoices_spec.rb:642
9.39 seconds ./spec/features/admin/refunds_invoices_spec.rb:372
...
> CAPYBARA_TIMERS=1 bundle exec rspec spec/features/admin/refunds_invoices_spec.rb:45
Run options: include {:locations=>{"./spec/features/admin/refunds_invoices_spec.rb"=>[45]}}
3.64s spec/support/features/session_helpers.rb:8 visit "/administration"
0.73s spec/features/admin/refunds_invoices_spec.rb:46 visit "/administration/refund_invoices"
0.02s spec/features/admin/refunds_invoices_spec.rb:48 assert_text "Refunds"
0.06s spec/features/admin/refunds_invoices_spec.rb:48 within_element "h1.MPanelGroup-heading"
0.11s spec/features/admin/refunds_invoices_spec.rb:50 fill_in "Invoice ID"
...
CAPYBARA TOTAL 45.24sFinished in 52.38 seconds (files took 3.14 seconds to load)
...
0.04s spec/support/integration_helpers.rb:61 find "thead th"
0.24s spec/support/integration_helpers.rb:36 path Array
0.16s spec/support/integration_helpers.rb:63 path Array
0.03s spec/support/integration_helpers.rb:63 find Array
0.02s spec/features/admin/refunds_invoices_spec.rb:346 assert_text "2018-03-19"
0.05s spec/support/integration_helpers.rb:61 find "thead th"
0.16s spec/support/integration_helpers.rb:36 path Array
0.15s spec/support/integration_helpers.rb:63 path Array
0.02s spec/support/integration_helpers.rb:63 find Array
0.02s spec/features/admin/refunds_invoices_spec.rb:347 assert_text "awaiting"
...
def cell_for_column(text, row: 1)
th = find('thead th', text: text, match: :prefer_exact)
column = element_index(th)
find(:xpath, "#{th.path}/ancestor::table").find(:css, "tbody tr:nth-of-type(#{row}) > :nth-child(#{column})")
end
def cell_for_column(text, row: 1)
th = find('thead th', text: text, match: :prefer_exact)
column = th.find(:xpath, '..').all('th').index(th) + 1
table = th.find(:xpath, 'ancestor::table')
table.find(:css, "tbody tr:nth-of-type(#{row}) > :nth-child(#{column})")
end
...0.04s spec/support/integration_helpers.rb:61 find "thead th"
0.01s spec/features/admin/refunds_invoices_spec.rb:346 assert_text "2018-03-19"
0.05s spec/support/integration_helpers.rb:61 find "thead th"
0.01s spec/features/admin/refunds_invoices_spec.rb:347 assert_text "awaiting"
...
CAPYBARA TOTAL 26.72sFinished in 36.31 seconds (files took 3.21 seconds to load)

--

--

String Concatenator

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store