| title | reload |
|---|
Reload the page.
cy.reload()
cy.reload(forceReload)
cy.reload(options)
cy.reload(forceReload, options){% fa fa-check-circle green %} Correct Usage
cy.reload(){% fa fa-angle-right %} forceReload (Boolean)
Whether to reload the current page without using the cache. true forces the reload without cache.
{% fa fa-angle-right %} options (Object)
| Option | Default | Description |
|---|---|---|
log |
true |
{% usage_options log %} |
timeout |
{% url pageLoadTimeout configuration#Timeouts %} |
{% usage_options timeout cy.reload %} |
{% yields sets_subject cy.reload 'yields the window object after the page finishes loading' %}
cy.visit('http://localhost:3000/admin')
cy.get('#undo-btn').click().should('not.be.visible')
cy.reload()
cy.get('#undo-btn').click().should('not.be.visible')cy.visit('http://localhost:3000/admin')
cy.reload(true){% requirements page cy.reload %}
{% assertions wait cy.reload %}
{% timeouts page cy.reload %}
Reload the page
cy.reload()The commands above will display in the Command Log as:
{% imgTag /img/api/reload/test-page-after-reload-button.png "Command Log reload" %}
When clicking on reload within the command log, the console outputs the following:
{% imgTag /img/api/reload/command-log-for-reload-cypress.png "Console Log reload" %}
- {% url
cy.go()go %} - {% url
cy.visit()visit %}