Open

To open a page use browser.open . Browser will load a page only if the current url doesn't match the passed one. search.submit('query') browser.open("/search") // page is not be ing refreshed search.searchMessage.should == 'searching for query' Note: relative url will be automatically expanded to the full url based on the browser/basic-configuration configuration

Reopen

Use brower.reopen to force open the page even if the page url already matches the passed one. search.submit('name') browser.reopen("/search") // page is going to be refreshed search.searchMessage.should == ''

Refresh

Use browser.refresh to refresh current page. search.submit('name') browser.reopen("/search") // page is going to be refreshed search.searchMessage.should == ''

Restart

Use browser.restart to restart a browser and open last opened url. browser.open('/local-storage') browser.localStorage.setItem('favoriteColor', 'pretty') browser.refresh() $('#favorite-color').should == 'pretty' browser.restart() $('#favorite-color').should == '' Note: restarting creates a clean instance of a browser. Local storage is going to be reset.

Assert URL

Use browser.url to assert on or wait for url changes. http://example.com/resource/id?type=full&debug=true#subId browser.url.path.should == '/resource/id' browser.url.query.should == 'type=full&debug=true' browser.url.ref.should == 'subId' browser.url.should == 'http://example.com/resource/id?type=full&debug=true#subId' browser.url.path.waitTo == '/resource/id' browser.url.query.waitTo == 'type=full&debug=true' browser.url.ref.waitTo == 'subId'

Persist URL

Use browser.saveCurrentUrl to save url in a local cache and browser.openSavedUrl to open a page later.It can be handy in multipart tests where first part creates an entity and the second part updates the created entity. browser.open('/resource-creation') $('#new').click() browser.saveCurrentUrl() In order to simplify tests development of a second part you can run first part once, save URL, and iterate on a second part by opening a page using saved URL. browser.openSavedUrl() // continue resource related manipulations Note: url is stored in a local cache file and will survive tests restart.