I am working on a web crawler which accesses remote pages by submitting search queries via the remote site's search bar:
class Crawler < PoltergeistDriver def fetch_listing_page(query) ... visit 'whatever.com' fill_in('#seachbar', with: query) find('#searchbar').native.send_key(:return) ... end end
I then use the
page object to search for specific text inside the body like so:
class Crawler < PoltergeistDriver ... def fetch_listing_data ... page.all('some element', ...) ... end ... end
My question is can I mock this
page object in my tests? My guess is that VCR / Webmock would not work as the requests are made from the client side (poltergeist in my case).