Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Fix type definitions for cy.reload() #25779

Merged
merged 15 commits into from
Feb 16, 2023
Merged
1 change: 1 addition & 0 deletions cli/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ _Released 03/1/2023 (PENDING)_
**Bugfixes:**

- Fixed an issue where cookies were being duplicated with the same hostname, but a prepended dot. Fixed an issue where cookies may not be expiring correctly. Fixes [#25174](https://github.com/cypress-io/cypress/issues/25174), [#25205](https://github.com/cypress-io/cypress/issues/25205) and [#25495](https://github.com/cypress-io/cypress/issues/25495).
- Added missing TypeScript type definitions for the [`cy.reload()`](https://docs.cypress.io/api/commands/reload) command. Addressed in [#25779](https://github.com/cypress-io/cypress/pull/25779).

## 12.6.0

Expand Down
26 changes: 25 additions & 1 deletion cli/types/cypress.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1816,9 +1816,21 @@ declare namespace Cypress {
*
* @see https://on.cypress.io/reload
* @example
* cy.visit('http://localhost:3000/admin')
* cy.reload()
*/
reload(options?: Partial<Loggable & Timeoutable>): Chainable<AUTWindow>
reload(): Chainable<AUTWindow>
/**
* Reload the page.
*
* @see https://on.cypress.io/reload
* @param {Partial<Loggable & Timeoutable>} options Pass in an options object to modify the default behavior of cy.reload()
* @example
* // Reload the page, do not log it in the command log and timeout after 15s
* cy.visit('http://localhost:3000/admin')
* cy.reload({log: false, timeout: 15000})
*/
reload(options: Partial<Loggable & Timeoutable>): Chainable<AUTWindow>
/**
* Reload the page without cache
*
Expand All @@ -1830,6 +1842,18 @@ declare namespace Cypress {
* cy.reload(true)
*/
reload(forceReload: boolean): Chainable<AUTWindow>
/**
* Reload the page without cache and with log and timeout options
*
* @see https://on.cypress.io/reload
* @param {Boolean} forceReload Whether to reload the current page without using the cache. true forces the reload without cache.
podlesny-j marked this conversation as resolved.
Show resolved Hide resolved
* @param {Partial<Loggable & Timeoutable>} options Pass in an options object to modify the default behavior of cy.reload()
* @example
* // Reload the page without using the cache, do not log it in the command log and timeout after 15s
* cy.visit('http://localhost:3000/admin')
* cy.reload(true, {log: false, timeout: 15000})
*/
reload(forceReload: boolean, options: Partial<Loggable & Timeoutable>): Chainable<AUTWindow>

/**
* Make an HTTP GET request.
Expand Down