diff --git a/cli/schema/cypress.schema.json b/cli/schema/cypress.schema.json index f68a30ee6c18..c3d2ffb22876 100644 --- a/cli/schema/cypress.schema.json +++ b/cli/schema/cypress.schema.json @@ -224,11 +224,6 @@ "default": "bundled", "description": "If set to 'system', Cypress will try to find a Node.js executable on your path to use when executing your plugins. Otherwise, Cypress will use the Node version bundled with Cypress." }, - "experimentalGetCookiesSameSite": { - "type": "boolean", - "default": false, - "description": "If `true`, Cypress will add `sameSite` values to the objects yielded from `cy.setCookie()`, `cy.getCookie()`, and `cy.getCookies()`. This will become the default behavior in Cypress 5.0." - }, "experimentalSourceRewriting": { "type": "boolean", "default": false, diff --git a/cli/types/cypress.d.ts b/cli/types/cypress.d.ts index dde1a928b720..cb4adf2ca055 100644 --- a/cli/types/cypress.d.ts +++ b/cli/types/cypress.d.ts @@ -2442,12 +2442,6 @@ declare namespace Cypress { * @default { runMode: 1, openMode: null } */ firefoxGcInterval: Nullable, openMode: Nullable }> - /** - * If `true`, Cypress will add `sameSite` values to the objects yielded from `cy.setCookie()`, - * `cy.getCookie()`, and `cy.getCookies()`. This will become the default behavior in Cypress 5.0. - * @default false - */ - experimentalGetCookiesSameSite: boolean /** * Enables AST-based JS/HTML rewriting. This may fix issues caused by the existing regex-based JS/HTML replacement * algorithm. diff --git a/packages/driver/cypress/integration/commands/cookies_spec.js b/packages/driver/cypress/integration/commands/cookies_spec.js index 896f1fd5bb2e..6d2092626075 100644 --- a/packages/driver/cypress/integration/commands/cookies_spec.js +++ b/packages/driver/cypress/integration/commands/cookies_spec.js @@ -474,9 +474,7 @@ describe('src/cy/commands/cookies', () => { }) }) - it('can set cookies with sameSite', { - experimentalGetCookiesSameSite: true, - }, () => { + it('can set cookies with sameSite', () => { Cypress.automation.restore() Cypress.utils.addTwentyYears.restore() diff --git a/packages/driver/src/cy/commands/cookies.js b/packages/driver/src/cy/commands/cookies.js index b5fda3ad6ac2..51e6d1f9ee0a 100644 --- a/packages/driver/src/cy/commands/cookies.js +++ b/packages/driver/src/cy/commands/cookies.js @@ -58,12 +58,6 @@ const normalizeSameSite = (sameSite) => { } module.exports = function (Commands, Cypress, cy, state, config) { - const maybeStripSameSiteProp = (cookie) => { - if (cookie && !Cypress.config('experimentalGetCookiesSameSite')) { - delete cookie.sameSite - } - } - const automateCookies = function (event, obj = {}, log, timeout) { const automate = () => { return Cypress.automation(event, mergeDefaults(obj)) @@ -183,8 +177,6 @@ module.exports = function (Commands, Cypress, cy, state, config) { return automateCookies('get:cookie', { name }, options._log, options.timeout) .then((resp) => { - maybeStripSameSiteProp(resp) - options.cookie = resp return resp @@ -222,10 +214,6 @@ module.exports = function (Commands, Cypress, cy, state, config) { return automateCookies('get:cookies', _.pick(options, 'domain'), options._log, options.timeout) .then((resp) => { - if (Array.isArray(resp)) { - resp.forEach(maybeStripSameSiteProp) - } - options.cookies = resp return resp @@ -299,8 +287,6 @@ module.exports = function (Commands, Cypress, cy, state, config) { return automateCookies('set:cookie', cookie, options._log, options.timeout) .then((resp) => { - maybeStripSameSiteProp(resp) - options.cookie = resp return resp diff --git a/packages/server/__snapshots__/2_cookies_spec.js b/packages/server/__snapshots__/2_cookies_spec.js index 39c46f5cdafa..7bc11a5d62cb 100644 --- a/packages/server/__snapshots__/2_cookies_spec.js +++ b/packages/server/__snapshots__/2_cookies_spec.js @@ -5,11 +5,10 @@ exports['e2e cookies with baseurl'] = ` (Run Starting) ┌────────────────────────────────────────────────────────────────────────────────────────────────┐ - │ Cypress: 1.2.3 │ - │ Browser: FooBrowser 88 │ - │ Specs: 1 found (cookies_spec_baseurl.coffee) │ - │ Searched: cypress/integration/cookies_spec_baseurl.coffee │ - │ Experiments: experimentalGetCookiesSameSite=true │ + │ Cypress: 1.2.3 │ + │ Browser: FooBrowser 88 │ + │ Specs: 1 found (cookies_spec_baseurl.coffee) │ + │ Searched: cypress/integration/cookies_spec_baseurl.coffee │ └────────────────────────────────────────────────────────────────────────────────────────────────┘ diff --git a/packages/server/lib/config.js b/packages/server/lib/config.js index 8c674634a796..0fc5f056b8ad 100644 --- a/packages/server/lib/config.js +++ b/packages/server/lib/config.js @@ -105,7 +105,6 @@ browsers\ // each should start with "experimental" and be camel cased // example: experimentalComponentTesting const experimentalConfigKeys = toWords(`\ -experimentalGetCookiesSameSite experimentalSourceRewriting experimentalComponentTesting experimentalShadowDomSupport @@ -174,7 +173,6 @@ const CONFIG_DEFAULTS = { componentFolder: 'cypress/component', // TODO: example for component testing with subkeys // experimentalComponentTesting: { componentFolder: 'cypress/component' } - experimentalGetCookiesSameSite: false, experimentalSourceRewriting: false, experimentalShadowDomSupport: false, experimentalFetchPolyfill: false, @@ -222,7 +220,6 @@ const validationRules = { // validation for component testing experiment componentFolder: v.isStringOrFalse, // experimental flag validation below - experimentalGetCookiesSameSite: v.isBoolean, experimentalSourceRewriting: v.isBoolean, experimentalShadowDomSupport: v.isBoolean, experimentalFetchPolyfill: v.isBoolean, diff --git a/packages/server/lib/experiments.ts b/packages/server/lib/experiments.ts index 610bf5d194e3..e365e019ac56 100644 --- a/packages/server/lib/experiments.ts +++ b/packages/server/lib/experiments.ts @@ -53,7 +53,6 @@ interface StringValues { const _summaries: StringValues = { experimentalComponentTesting: 'Framework-specific component testing, uses `componentFolder` to load component specs', experimentalSourceRewriting: 'Enables AST-based JS/HTML rewriting. This may fix issues caused by the existing regex-based JS/HTML replacement algorithm.', - experimentalGetCookiesSameSite: 'Adds `sameSite` values to the objects yielded from `cy.setCookie()`, `cy.getCookie()`, and `cy.getCookies()`. This will become the default behavior in Cypress 5.0.', experimentalFetchPolyfill: 'Polyfills `window.fetch` to enable Network spying and stubbing', experimentalShadowDomSupport: 'Enables support for shadow DOM traversal, introduces the `shadow()` command and the `includeShadowDom` option to traversal commands.', } @@ -71,7 +70,6 @@ const _summaries: StringValues = { const _names: StringValues = { experimentalComponentTesting: 'Component Testing', experimentalSourceRewriting: 'Improved source rewriting', - experimentalGetCookiesSameSite: 'Set `sameSite` property when retrieving cookies', experimentalShadowDomSupport: 'Shadow DOM Support', experimentalFetchPolyfill: 'Fetch polyfill', } diff --git a/packages/server/test/e2e/2_cookies_spec.js b/packages/server/test/e2e/2_cookies_spec.js index 2b9d06263068..657e0f877f13 100644 --- a/packages/server/test/e2e/2_cookies_spec.js +++ b/packages/server/test/e2e/2_cookies_spec.js @@ -194,7 +194,6 @@ describe('e2e cookies', () => { // we can remove this extra test case e2e.it('with forced SameSite strictness', { config: { - experimentalGetCookiesSameSite: true, baseUrl, env: { baseUrl, @@ -248,7 +247,6 @@ describe('e2e cookies', () => { ) => { e2e.it(`passes with baseurl: ${baseUrl}`, { config: { - experimentalGetCookiesSameSite: true, baseUrl, env: { baseUrl, diff --git a/packages/server/test/unit/config_spec.js b/packages/server/test/unit/config_spec.js index 9c821ccb04d5..b5006c78b27d 100644 --- a/packages/server/test/unit/config_spec.js +++ b/packages/server/test/unit/config_spec.js @@ -1108,7 +1108,6 @@ describe('lib/config', () => { requestTimeout: { value: 5000, from: 'default' }, responseTimeout: { value: 30000, from: 'default' }, execTimeout: { value: 60000, from: 'default' }, - experimentalGetCookiesSameSite: { value: false, from: 'default' }, experimentalSourceRewriting: { value: false, from: 'default' }, taskTimeout: { value: 60000, from: 'default' }, numTestsKeptInMemory: { value: 50, from: 'default' }, @@ -1185,7 +1184,6 @@ describe('lib/config', () => { requestTimeout: { value: 5000, from: 'default' }, responseTimeout: { value: 30000, from: 'default' }, execTimeout: { value: 60000, from: 'default' }, - experimentalGetCookiesSameSite: { value: false, from: 'default' }, experimentalSourceRewriting: { value: false, from: 'default' }, taskTimeout: { value: 60000, from: 'default' }, numTestsKeptInMemory: { value: 50, from: 'default' },