teampoltergeist / poltergeist

A PhantomJS driver for Capybara

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

There's no API for page refresh/reload

vemv opened this issue · comments

commented

Hi!

There's no API for refreshing the current page. PhantomJs seems to support it.

Can we have it?

Cheers - Victor

@twalpole hm don't remember if we have it in capybara, is it worth adding?

It's not in Capybara, and I'm not really convinced it is worth adding. When testing an app, needing to refresh the page would generally be a sign of a bad UI. I'm open to being convinced otherwise with a decent use case, but I can't think of one right now. If one does really need to reload the page it's as easy as visit(current_url) currently.

commented

it's not built-in in the Capybara, but e.g. selenium-webdriver has it. Also, seemingly Phantom has it, so it might be a cheap addition.

Reloading can be useful in integration tests as it can assert certain bugs don't happen ("when I reload, state xyz is lost"). Obviusly I don't expect my users to use the refresh button as part of the UX

I'm using Capybara to scrape another site, so refreshing is useful for that.