Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into retry-flake
Browse files Browse the repository at this point in the history
  • Loading branch information
flotwig committed Dec 9, 2022
2 parents 9c27197 + fdd04c3 commit 46f562b
Show file tree
Hide file tree
Showing 37 changed files with 1,901 additions and 130 deletions.
2 changes: 2 additions & 0 deletions cli/lib/cypress.js
Expand Up @@ -31,6 +31,8 @@ const cypressModuleApi = {

options = util.normalizeModuleOptions(options)

tmp.setGracefulCleanup()

return tmp.fileAsync()
.then((outputPath) => {
options.outputPath = outputPath
Expand Down
52 changes: 43 additions & 9 deletions cli/types/cypress.d.ts
Expand Up @@ -896,21 +896,41 @@ declare namespace Cypress {
clear(options?: Partial<ClearOptions>): Chainable<Subject>

/**
* Clear a specific browser cookie for the current hostname or for the domain specified.
* Cypress automatically clears all cookies before each test to prevent state from being shared across tests. You shouldn't need to use this command unless you're using it to clear a specific cookie inside a single test.
* Clear a specific browser cookie for a domain.
*
* Cypress automatically clears all cookies _before_ each test to prevent
* state from being shared across tests when test isolation is enabled.
* You shouldn't need to use this command unless you're using it to clear
* a specific cookie inside a single test or test isolation is disabled.
*
* @see https://on.cypress.io/clearcookie
*/
clearCookie(name: string, options?: CookieOptions): Chainable<null>

/**
* Clear all browser cookies for the current hostname or for the domain specified.
* Cypress automatically clears all cookies before each test to prevent state from being shared across tests. You shouldn't need to use this command unless you're using it to clear all cookies or specific cookies inside a single test.
* Clear browser cookies for a domain.
*
* Cypress automatically clears all cookies _before_ each test to prevent
* state from being shared across tests when test isolation is enabled.
* You shouldn't need to use this command unless you're using it to clear
* specific cookies inside a single test or test isolation is disabled.
*
* @see https://on.cypress.io/clearcookies
*/
clearCookies(options?: CookieOptions): Chainable<null>

/**
* Clear all browser cookies.
*
* Cypress automatically clears all cookies _before_ each test to prevent
* state from being shared across tests when test isolation is enabled.
* You shouldn't need to use this command unless you're using it to clear
* all cookie inside a single test or test isolation is disabled.
*
* @see https://on.cypress.io/clearallcookies
*/
clearAllCookies(options?: Partial<Loggable & Timeoutable>): Chainable<null>

/**
* Get local storage for all origins.
*
Expand All @@ -921,6 +941,11 @@ declare namespace Cypress {
/**
* Clear local storage for all origins.
*
* Cypress automatically clears all local storage _before_ each test to
* prevent state from being shared across tests when test isolation
* is enabled. You shouldn't need to use this command unless you're using it
* to clear localStorage inside a single test or test isolation is disabled.
*
* @see https://on.cypress.io/clearalllocalstorage
*/
clearAllLocalStorage(options?: Partial<Loggable>): Chainable<null>
Expand All @@ -941,9 +966,11 @@ declare namespace Cypress {

/**
* Clear data in local storage for the current origin.
* Cypress automatically runs this command before each test to prevent state from being
* shared across tests. You shouldn't need to use this command unless you're using it
* to clear localStorage inside a single test. Yields `localStorage` object.
*
* Cypress automatically clears all local storage _before_ each test to
* prevent state from being shared across tests when test isolation
* is enabled. You shouldn't need to use this command unless you're using it
* to clear localStorage inside a single test or test isolation is disabled.
*
* @see https://on.cypress.io/clearlocalstorage
* @param {string} [key] - name of a particular item to remove (optional).
Expand Down Expand Up @@ -1395,19 +1422,26 @@ declare namespace Cypress {
get<S = any>(alias: string, options?: Partial<Loggable & Timeoutable & Withinable & Shadow>): Chainable<S>

/**
* Get a browser cookie by its name for the current hostname or for the domain specified.
* Get a browser cookie by its name.
*
* @see https://on.cypress.io/getcookie
*/
getCookie(name: string, options?: CookieOptions): Chainable<Cookie | null>

/**
* Get all of the browser cookies for the current hostname or for the domain specified.
* Get browser cookies for a domain.
*
* @see https://on.cypress.io/getcookies
*/
getCookies(options?: CookieOptions): Chainable<Cookie[]>

/**
* Get all browser cookies.
*
* @see https://on.cypress.io/getallcookies
*/
getAllCookies(options?: Partial<Loggable & Timeoutable>): Chainable<Cookie[]>

/**
* Navigate back or forward to the previous or next URL in the browser's history.
*
Expand Down
26 changes: 26 additions & 0 deletions cli/types/tests/cypress-tests.ts
Expand Up @@ -1020,6 +1020,19 @@ namespace CypressGetCookiesTests {
cy.getCookies({ domain: false }) // $ExpectError
}

namespace CypressGetAllCookiesTests {
cy.getAllCookies().then((cookies) => {
cookies // $ExpectType Cookie[]
})
cy.getAllCookies({ log: true })
cy.getAllCookies({ timeout: 10 })
cy.getAllCookies({ log: true, timeout: 10 })

cy.getAllCookies({ log: 'true' }) // $ExpectError
cy.getAllCookies({ timeout: '10' }) // $ExpectError
cy.getAllCookies({ other: true }) // $ExpectError
}

namespace CypressGetCookieTests {
cy.getCookie('name').then((cookie) => {
cookie // $ExpectType Cookie | null
Expand Down Expand Up @@ -1085,6 +1098,19 @@ namespace CypressClearCookiesTests {
cy.clearCookies({ domain: false }) // $ExpectError
}

namespace CypressClearAllCookiesTests {
cy.clearAllCookies().then((cookies) => {
cookies // $ExpectType null
})
cy.clearAllCookies({ log: true })
cy.clearAllCookies({ timeout: 10 })
cy.clearAllCookies({ log: true, timeout: 10 })

cy.clearAllCookies({ log: 'true' }) // $ExpectError
cy.clearAllCookies({ timeout: '10' }) // $ExpectError
cy.clearAllCookies({ other: true }) // $ExpectError
}

namespace CypressLocalStorageTests {
cy.getAllLocalStorage().then((result) => {
result // $ExpectType StorageByOrigin
Expand Down
7 changes: 7 additions & 0 deletions npm/grep/CHANGELOG.md
@@ -1,3 +1,10 @@
# [@cypress/grep-v3.1.1](https://github.com/cypress-io/cypress/compare/@cypress/grep-v3.1.0...@cypress/grep-v3.1.1) (2022-12-08)


### Bug Fixes

* fix behavior when only using inverted tags ([#24413](https://github.com/cypress-io/cypress/issues/24413)) ([b2a2e50](https://github.com/cypress-io/cypress/commit/b2a2e508638d5132fc30e01d707de81d22fde359))

# [@cypress/grep-v3.1.0](https://github.com/cypress-io/cypress/compare/@cypress/grep-v3.0.3...@cypress/grep-v3.1.0) (2022-10-21)


Expand Down

0 comments on commit 46f562b

Please sign in to comment.