From baf343b14d6902ab3aa6f8924a1fb6b9f725a899 Mon Sep 17 00:00:00 2001 From: Podles <78863563+podlesny-j@users.noreply.github.com> Date: Sun, 12 Feb 2023 22:21:06 +0100 Subject: [PATCH 01/13] Fix type definitions for cy.reload() cy.reload() cy.reload(forceReload) cy.reload(options) cy.reload(forceReload, options) --- cli/types/cypress.d.ts | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/cli/types/cypress.d.ts b/cli/types/cypress.d.ts index 60ad410061e2..b9d24a33615c 100644 --- a/cli/types/cypress.d.ts +++ b/cli/types/cypress.d.ts @@ -1811,25 +1811,18 @@ declare namespace Cypress { */ readFile(filePath: string, encoding: Encodings, options?: Partial): Chainable - /** - * Reload the page. - * - * @see https://on.cypress.io/reload - * @example - * cy.reload() - */ - reload(options?: Partial): Chainable /** * Reload the page without cache * * @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. + * @param {ReloadOptions} [options] Pass in an options object to modify the default behavior of `cy.reload()` * @example * // Reload the page without using the cache * cy.visit('http://localhost:3000/admin') * cy.reload(true) */ - reload(forceReload: boolean): Chainable + reload(forceReload?: boolean, options?: Partial): Chainable /** * Make an HTTP GET request. @@ -3364,6 +3357,24 @@ declare namespace Cypress { keystrokeDelay: number } + /** + * Reload page options + * + * @see https://on.cypress.io/reload + */ + interface ReloadOptions extends Loggable, Timeoutable { + /** + * Whether or not to display the command in the Command log + * @default true + */ + log?: boolean + /** + * Time to wait for cy.reload() to resolve before timing out + * @default 'pageLoadTimeout' + */ + timeout?: number + } + /** * Full set of possible options for cy.request call */ From 8fdfb6ebbd5de2bdab38979c228a517f52abaf7e Mon Sep 17 00:00:00 2001 From: Podles Date: Sun, 12 Feb 2023 23:35:19 +0100 Subject: [PATCH 02/13] fix types for all argument options --- cli/types/cypress.d.ts | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/cli/types/cypress.d.ts b/cli/types/cypress.d.ts index b9d24a33615c..00b29cd5c901 100644 --- a/cli/types/cypress.d.ts +++ b/cli/types/cypress.d.ts @@ -1811,18 +1811,38 @@ declare namespace Cypress { */ readFile(filePath: string, encoding: Encodings, options?: Partial): Chainable + /** + * Reload the page. + * + * @see https://on.cypress.io/reload + * @param {ReloadOptions} [options] Pass in an options object to modify the default behavior of `cy.reload()` + * @example + * cy.reload({log: false, timeout: 30000}) + */ + reload(options?: Partial): Chainable /** * Reload the page without cache * * @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. - * @param {ReloadOptions} [options] Pass in an options object to modify the default behavior of `cy.reload()` * @example * // Reload the page without using the cache * cy.visit('http://localhost:3000/admin') * cy.reload(true) */ - reload(forceReload?: boolean, options?: Partial): Chainable + reload(forceReload: boolean): Chainable + /** + * Reload the page without cache + * + * @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. + * @param {ReloadOptions} [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 5s + * cy.visit('http://localhost:3000/admin') + * cy.reload(true, {log: false, timeout: 5000}) + */ + reload(forceReload: boolean, options?: Partial): Chainable /** * Make an HTTP GET request. @@ -3374,7 +3394,7 @@ declare namespace Cypress { */ timeout?: number } - + /** * Full set of possible options for cy.request call */ From cd26562d8189ffd5c42854379a293d5af2147190 Mon Sep 17 00:00:00 2001 From: Podles Date: Sun, 12 Feb 2023 23:39:54 +0100 Subject: [PATCH 03/13] fix formatting typo --- cli/types/cypress.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/types/cypress.d.ts b/cli/types/cypress.d.ts index 00b29cd5c901..947045d12c18 100644 --- a/cli/types/cypress.d.ts +++ b/cli/types/cypress.d.ts @@ -1811,7 +1811,7 @@ declare namespace Cypress { */ readFile(filePath: string, encoding: Encodings, options?: Partial): Chainable - /** + /** * Reload the page. * * @see https://on.cypress.io/reload From 55eb108d12031db8b1fd1b375f8d94b0b2f5e915 Mon Sep 17 00:00:00 2001 From: Podles Date: Sun, 12 Feb 2023 23:40:56 +0100 Subject: [PATCH 04/13] improve description --- cli/types/cypress.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/types/cypress.d.ts b/cli/types/cypress.d.ts index 947045d12c18..0902ceca0836 100644 --- a/cli/types/cypress.d.ts +++ b/cli/types/cypress.d.ts @@ -1832,7 +1832,7 @@ declare namespace Cypress { */ reload(forceReload: boolean): Chainable /** - * Reload the page without cache + * 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. From e5d725cc662cb7f3c74546bee23a65d867b41498 Mon Sep 17 00:00:00 2001 From: Podles Date: Sun, 12 Feb 2023 23:47:51 +0100 Subject: [PATCH 05/13] add changelog entry --- cli/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/cli/CHANGELOG.md b/cli/CHANGELOG.md index 4c2141b646f7..c985ad5422b2 100644 --- a/cli/CHANGELOG.md +++ b/cli/CHANGELOG.md @@ -26,6 +26,7 @@ _Released 02/14/2023 (PENDING)_ - Increased maximum number of failing tests to reflect in sidebar badge to 99. Addresses [#25662](https://github.com/cypress-io/cypress/issues/25662). - Improved the layout of the Debug Page empty states on smaller viewports. Addressed in [#25703](https://github.com/cypress-io/cypress/pull/25703). - Increased the spacing between elements and their associated tooltip and added borders around artifact links on the Debug Page. Addresses [#25666](https://github.com/cypress-io/cypress/issues/25666). +- Improved type definitions for cy.reload() command. Addressed in [#25779](https://github.com/cypress-io/cypress/pull/25779). **Dependency Updates:** From 16c5f79b63dfdba304768ba4ba14ae6088c4af8c Mon Sep 17 00:00:00 2001 From: Podles Date: Mon, 13 Feb 2023 00:23:47 +0100 Subject: [PATCH 06/13] fix ReloadOptions interface --- cli/types/cypress.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cli/types/cypress.d.ts b/cli/types/cypress.d.ts index 0902ceca0836..6be206d83f1b 100644 --- a/cli/types/cypress.d.ts +++ b/cli/types/cypress.d.ts @@ -3382,7 +3382,7 @@ declare namespace Cypress { * * @see https://on.cypress.io/reload */ - interface ReloadOptions extends Loggable, Timeoutable { + interface ReloadOptions { /** * Whether or not to display the command in the Command log * @default true @@ -3390,7 +3390,7 @@ declare namespace Cypress { log?: boolean /** * Time to wait for cy.reload() to resolve before timing out - * @default 'pageLoadTimeout' + * @default pageLoadTimeout */ timeout?: number } From bab7c7d48c5d3cb55d07b4d8ca54ce8a7eafb76f Mon Sep 17 00:00:00 2001 From: Podles Date: Mon, 13 Feb 2023 09:09:49 +0100 Subject: [PATCH 07/13] remove useless interface definition --- cli/types/cypress.d.ts | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/cli/types/cypress.d.ts b/cli/types/cypress.d.ts index 6be206d83f1b..fb1202119c82 100644 --- a/cli/types/cypress.d.ts +++ b/cli/types/cypress.d.ts @@ -1819,7 +1819,7 @@ declare namespace Cypress { * @example * cy.reload({log: false, timeout: 30000}) */ - reload(options?: Partial): Chainable + reload(options?: Partial): Chainable /** * Reload the page without cache * @@ -1842,7 +1842,7 @@ declare namespace Cypress { * cy.visit('http://localhost:3000/admin') * cy.reload(true, {log: false, timeout: 5000}) */ - reload(forceReload: boolean, options?: Partial): Chainable + reload(forceReload: boolean, options: Partial): Chainable /** * Make an HTTP GET request. @@ -3377,24 +3377,6 @@ declare namespace Cypress { keystrokeDelay: number } - /** - * Reload page options - * - * @see https://on.cypress.io/reload - */ - interface ReloadOptions { - /** - * Whether or not to display the command in the Command log - * @default true - */ - log?: boolean - /** - * Time to wait for cy.reload() to resolve before timing out - * @default pageLoadTimeout - */ - timeout?: number - } - /** * Full set of possible options for cy.request call */ From 3fbfc758468ff94a8371c80edec24ae698ae719a Mon Sep 17 00:00:00 2001 From: Podles Date: Mon, 13 Feb 2023 11:05:01 +0100 Subject: [PATCH 08/13] remove forgotten param of previously removed type --- cli/types/cypress.d.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/cli/types/cypress.d.ts b/cli/types/cypress.d.ts index fb1202119c82..49ad10470236 100644 --- a/cli/types/cypress.d.ts +++ b/cli/types/cypress.d.ts @@ -1815,7 +1815,6 @@ declare namespace Cypress { * Reload the page. * * @see https://on.cypress.io/reload - * @param {ReloadOptions} [options] Pass in an options object to modify the default behavior of `cy.reload()` * @example * cy.reload({log: false, timeout: 30000}) */ @@ -1836,7 +1835,6 @@ declare namespace Cypress { * * @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. - * @param {ReloadOptions} [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 5s * cy.visit('http://localhost:3000/admin') From 88d61a90be30ea4fcada430586884816a11ce344 Mon Sep 17 00:00:00 2001 From: Podles Date: Tue, 14 Feb 2023 11:40:11 +0100 Subject: [PATCH 09/13] review requests --- cli/types/cypress.d.ts | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/cli/types/cypress.d.ts b/cli/types/cypress.d.ts index 49ad10470236..17a27f2b3eda 100644 --- a/cli/types/cypress.d.ts +++ b/cli/types/cypress.d.ts @@ -1816,9 +1816,21 @@ declare namespace Cypress { * * @see https://on.cypress.io/reload * @example - * cy.reload({log: false, timeout: 30000}) + * cy.visit('http://localhost:3000/admin') + * cy.reload() + */ + reload(): Chainable + /** + * Reload the page. + * + * @see https://on.cypress.io/reload + * @param {Partial} 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): Chainable + reload(options: Partial): Chainable /** * Reload the page without cache * @@ -1835,10 +1847,11 @@ declare namespace Cypress { * * @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. + * @param {Partial} 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 5s + * // 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: 5000}) + * cy.reload(true, {log: false, timeout: 15000}) */ reload(forceReload: boolean, options: Partial): Chainable From 5a1bb4e1550b192034e4a49f7021e1ed4ae2423b Mon Sep 17 00:00:00 2001 From: Podles Date: Wed, 15 Feb 2023 15:43:59 +0100 Subject: [PATCH 10/13] fix changelog entry --- cli/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/CHANGELOG.md b/cli/CHANGELOG.md index c985ad5422b2..bbf03e7f63b4 100644 --- a/cli/CHANGELOG.md +++ b/cli/CHANGELOG.md @@ -17,6 +17,7 @@ _Released 02/14/2023 (PENDING)_ - Fixed an issue that could cause the Debug page to display a different number of specs for in-progress runs than shown in Cypress Cloud. Fixes [#25647](https://github.com/cypress-io/cypress/issues/25647). - Fixed an issue introduced in Cypress 12.3.0 where custom browsers that relied on process environment variables were not found on macOS arm64 architectures. Fixed in [#25753](https://github.com/cypress-io/cypress/pull/25753). - Fixed an issue where Cypress would fail to load any specs if the project `specPattern` included a resource that could not be accessed due to filesystem permissions. Fixes [#24109](https://github.com/cypress-io/cypress/issues/24109). +- 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). **Misc:** @@ -26,7 +27,6 @@ _Released 02/14/2023 (PENDING)_ - Increased maximum number of failing tests to reflect in sidebar badge to 99. Addresses [#25662](https://github.com/cypress-io/cypress/issues/25662). - Improved the layout of the Debug Page empty states on smaller viewports. Addressed in [#25703](https://github.com/cypress-io/cypress/pull/25703). - Increased the spacing between elements and their associated tooltip and added borders around artifact links on the Debug Page. Addresses [#25666](https://github.com/cypress-io/cypress/issues/25666). -- Improved type definitions for cy.reload() command. Addressed in [#25779](https://github.com/cypress-io/cypress/pull/25779). **Dependency Updates:** From 7db5c5c70a2bf37672ceab037f742a68c81febf9 Mon Sep 17 00:00:00 2001 From: Emily Rohrbough Date: Thu, 16 Feb 2023 09:59:42 -0600 Subject: [PATCH 11/13] Update CHANGELOG.md --- cli/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/CHANGELOG.md b/cli/CHANGELOG.md index 76eef6d5587c..4db5e5cee841 100644 --- a/cli/CHANGELOG.md +++ b/cli/CHANGELOG.md @@ -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 @@ -25,7 +26,6 @@ _Released 02/15/2023_ - Fixed an issue where the Debug page would display a different number of specs for in-progress runs than the in-progress specs reported in Cypress Cloud. Fixes [#25647](https://github.com/cypress-io/cypress/issues/25647). - Fixed an issue in middleware where error-handling code could itself generate an error and fail to report the original issue. Fixes [#22825](https://github.com/cypress-io/cypress/issues/22825). - Fixed an regression introduced in Cypress [12.3.0](#12-3-0) where custom browsers that relied on process environment variables were not found on macOS arm64 architectures. Fixed in [#25753](https://github.com/cypress-io/cypress/pull/25753). -- 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). **Misc:** From d11635dbd044ca8a5f9347e59add413891abab00 Mon Sep 17 00:00:00 2001 From: Emily Rohrbough Date: Thu, 16 Feb 2023 11:11:18 -0600 Subject: [PATCH 12/13] Update get-binary-release-data.js --- scripts/semantic-commits/get-binary-release-data.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/scripts/semantic-commits/get-binary-release-data.js b/scripts/semantic-commits/get-binary-release-data.js index 6e5d1f9dcf63..7f3b7bbad85d 100644 --- a/scripts/semantic-commits/get-binary-release-data.js +++ b/scripts/semantic-commits/get-binary-release-data.js @@ -7,12 +7,12 @@ const { getCurrentReleaseData } = require('./get-current-release-data') const { getNextVersionForBinary } = require('../get-next-version') const { getLinkedIssues } = require('./get-linked-issues') -if (process.env.CIRCLECI && !process.env.GH_TOKEN) { - throw new Error('The GITHUB_TOKEN env is not set.') +const ensureAuth = () => { + if (!process.env.GH_TOKEN) { + throw new Error('The GH_TOKEN env is not set.') + } } -const octokit = new Octokit({ auth: process.env.GH_TOKEN }) - /** * Get the list of file names that have been added, deleted or changed since the git * sha associated with the latest tag published on npm. @@ -46,6 +46,9 @@ const getChangedFilesSinceLastRelease = (latestReleaseInfo) => { * @param {string} latestReleaseInfo.buildSha - git commit associated with published content */ const getReleaseData = async (latestReleaseInfo) => { + ensureAuth() + const octokit = new Octokit({ auth: process.env.GH_TOKEN }) + let { nextVersion, commits: semanticCommits, @@ -58,7 +61,7 @@ const getReleaseData = async (latestReleaseInfo) => { const issuesInRelease = [] const prsInRelease = [] const commits = [] - + await Promise.all(semanticCommits.map(async (semanticResult) => { if (!semanticResult) return From 2aef489674549fed3e4d5a003c6fe62dc2107177 Mon Sep 17 00:00:00 2001 From: Emily Rohrbough Date: Thu, 16 Feb 2023 11:11:53 -0600 Subject: [PATCH 13/13] Update get-binary-release-data.js --- scripts/semantic-commits/get-binary-release-data.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/semantic-commits/get-binary-release-data.js b/scripts/semantic-commits/get-binary-release-data.js index 7f3b7bbad85d..a2a4dad8aad5 100644 --- a/scripts/semantic-commits/get-binary-release-data.js +++ b/scripts/semantic-commits/get-binary-release-data.js @@ -61,7 +61,7 @@ const getReleaseData = async (latestReleaseInfo) => { const issuesInRelease = [] const prsInRelease = [] const commits = [] - + await Promise.all(semanticCommits.map(async (semanticResult) => { if (!semanticResult) return