Click overlay marker in Google Maps with capybara-webkit
To test that there are n markers on the page: expect(find(‘.gmap_container’)[‘data-markers’].split(‘},{‘).count).to eq(n)
To test that there are n markers on the page: expect(find(‘.gmap_container’)[‘data-markers’].split(‘},{‘).count).to eq(n)
To find a link based on just its href using capybara you could do link = page.find(:css, ‘a[href=”actual link”]’) or if you’re looking to assert that the element exists page.assert_selector(:css, ‘a[href=”actual link”]’) or – if using RSpec expect(page).to have_selector(:css, ‘a[href=”actual link”]’) Since have link by default searches for substrings in the link text you can … Read more
Probably too late. But I also had the same problem and found the solution. It might help someone else. page.find(‘div#drawer a’)[:href]
You can interact with hidden elements using the visible: false property in Capybara. If you want to click on hidden element use: find(“#photos”, visible: false).click Don’t use click_button(‘#photo’) directly
You can use using_wait_time(seconds) method like: using_wait_time 3 do expect(page).to have_text ‘Lorem ipsum’ end or :wait option (that appeared in Capybara 2.1). Note that :wait option was supported only by find method in Capybara 2.1. Support for :wait option in matchers (i.e. has_x? and have_x methods) has been added in Capybara 2.2: expect(page).to have_text(‘Lorem ipsum’, … Read more