diff --git a/cli/__snapshots__/cache_spec.js b/cli/__snapshots__/cache_spec.js index 30e570b2f5..ed11617967 100644 --- a/cli/__snapshots__/cache_spec.js +++ b/cli/__snapshots__/cache_spec.js @@ -76,4 +76,4 @@ exports['lib/tasks/cache .list shows sizes 1'] = ` ├─────────┼──────────────┼───────┤ │ 2.3.4 │ unknown │ 0.2MB │ └─────────┴──────────────┴───────┘ -` \ No newline at end of file +` diff --git a/cli/__snapshots__/errors_spec.js b/cli/__snapshots__/errors_spec.js index f97265efbf..c1e7e58db1 100644 --- a/cli/__snapshots__/errors_spec.js +++ b/cli/__snapshots__/errors_spec.js @@ -42,7 +42,6 @@ exports['errors individual has the following errors 1'] = [ "missingXvfb", "nonZeroExitCodeXvfb", "notInstalledCI", - "removed", "smokeTestFailure", "unexpected", "unknownError", diff --git a/cli/__snapshots__/install_spec.js b/cli/__snapshots__/install_spec.js index 91f6438d3e..dd5f05a5f7 100644 --- a/cli/__snapshots__/install_spec.js +++ b/cli/__snapshots__/install_spec.js @@ -10,18 +10,6 @@ You can now open Cypress by running: node_modules/.bin/cypress open https://on.cypress.io/installing-cypress -` - -exports['error for removed CYPRESS_BINARY_VERSION 1'] = ` -Error: The environment variable CYPRESS_BINARY_VERSION has been renamed to CYPRESS_INSTALL_BINARY as of version 3.0.0 - -You should set CYPRESS_INSTALL_BINARY instead. - ----------- - -Platform: darwin (Foo-OsVersion) -Cypress Version: 1.2.3 - ` exports['forcing true always installs 1'] = ` diff --git a/cli/lib/errors.js b/cli/lib/errors.js index 1a226ff7d4..bc2cad3a3f 100644 --- a/cli/lib/errors.js +++ b/cli/lib/errors.js @@ -231,29 +231,6 @@ const childProcessKilled = (eventName, signal) => { } } -const removed = { - CYPRESS_BINARY_VERSION: { - description: stripIndent` - The environment variable CYPRESS_BINARY_VERSION has been renamed to CYPRESS_INSTALL_BINARY as of version ${chalk.green( - '3.0.0', - )} - `, - solution: stripIndent` - You should set CYPRESS_INSTALL_BINARY instead. - `, - }, - CYPRESS_SKIP_BINARY_INSTALL: { - description: stripIndent` - The environment variable CYPRESS_SKIP_BINARY_INSTALL has been removed as of version ${chalk.green( - '3.0.0', - )} - `, - solution: stripIndent` - To skip the binary install, set CYPRESS_INSTALL_BINARY=0 - `, - }, -} - const CYPRESS_RUN_BINARY = { notValid: (value) => { const properFormat = `**/${state.getPlatformExecutable()}` @@ -425,7 +402,6 @@ module.exports = { failedUnzip, invalidCypressEnv, invalidCacheDirectory, - removed, CYPRESS_RUN_BINARY, smokeTestFailure, childProcessKilled, diff --git a/cli/lib/exec/run.js b/cli/lib/exec/run.js index f173465c3f..30fcd0cbf2 100644 --- a/cli/lib/exec/run.js +++ b/cli/lib/exec/run.js @@ -66,14 +66,6 @@ const processRunOptions = (options = {}) => { args.push('--browser', options.browser) } - if (options.ci) { - // push to display the deprecation message - args.push('--ci') - - // also automatically record - args.push('--record', true) - } - if (options.ciBuildId) { args.push('--ci-build-id', options.ciBuildId) } @@ -113,7 +105,7 @@ const processRunOptions = (options = {}) => { // if key is set use that - else attempt to find it by environment variable if (options.key == null) { debug('--key is not set, looking up environment variable CYPRESS_RECORD_KEY') - options.key = util.getEnv('CYPRESS_RECORD_KEY') || util.getEnv('CYPRESS_CI_KEY') + options.key = util.getEnv('CYPRESS_RECORD_KEY') } // if we have a key assume we're in record mode @@ -139,7 +131,7 @@ const processRunOptions = (options = {}) => { // if record is defined and we're not // already in ci mode, then send it up - if (options.record != null && !options.ci) { + if (options.record != null) { args.push('--record', options.record) } diff --git a/cli/lib/tasks/install.js b/cli/lib/tasks/install.js index 366e4b69fb..c4a0479a98 100644 --- a/cli/lib/tasks/install.js +++ b/cli/lib/tasks/install.js @@ -217,15 +217,6 @@ const downloadAndUnzip = ({ version, installDir, downloadDir }) => { } const start = (options = {}) => { - // handle deprecated / removed - if (util.getEnv('CYPRESS_BINARY_VERSION')) { - return throwFormErrorText(errors.removed.CYPRESS_BINARY_VERSION)() - } - - if (util.getEnv('CYPRESS_SKIP_BINARY_INSTALL')) { - return throwFormErrorText(errors.removed.CYPRESS_SKIP_BINARY_INSTALL)() - } - debug('installing with options %j', options) _.defaults(options, { diff --git a/cli/test/lib/tasks/install_spec.js b/cli/test/lib/tasks/install_spec.js index 34714aeb35..0724bbf5c3 100644 --- a/cli/test/lib/tasks/install_spec.js +++ b/cli/test/lib/tasks/install_spec.js @@ -429,25 +429,6 @@ describe('/lib/tasks/install', function () { }) }) }) - - describe('CYPRESS_BINARY_VERSION', function () { - it('throws when env var CYPRESS_BINARY_VERSION', function () { - process.env.CYPRESS_BINARY_VERSION = '/asf/asf' - - return install.start() - .then(() => { - throw new Error('should have thrown') - }) - .catch((err) => { - logger.error(err) - - snapshot( - 'error for removed CYPRESS_BINARY_VERSION 1', - normalize(this.stdout.toString()), - ) - }) - }) - }) }) it('is silent when log level is silent', function () { diff --git a/cli/test/spec_helper.js b/cli/test/spec_helper.js index a5df843f79..783fd00833 100644 --- a/cli/test/spec_helper.js +++ b/cli/test/spec_helper.js @@ -32,8 +32,6 @@ sinon.usingPromise(Promise) delete process.env.CYPRESS_RUN_BINARY delete process.env.CYPRESS_INSTALL_BINARY delete process.env.CYPRESS_CACHE_FOLDER -delete process.env.CYPRESS_BINARY_VERSION -delete process.env.CYPRESS_SKIP_BINARY_INSTALL delete process.env.CYPRESS_DOWNLOAD_MIRROR delete process.env.DISPLAY diff --git a/packages/driver/cypress/integration/commands/agents_spec.js b/packages/driver/cypress/integration/commands/agents_spec.js index bff2ae3ea0..d5558bbcbe 100644 --- a/packages/driver/cypress/integration/commands/agents_spec.js +++ b/packages/driver/cypress/integration/commands/agents_spec.js @@ -705,22 +705,4 @@ describe('src/cy/commands/agents', () => { }) }) }) - - context('.agents', () => { - beforeEach(function () { - cy.spy(top.console, 'warn') - this.agents = cy.agents() - }) - - it('logs deprecation warning', () => { - expect(top.console.warn).to.be.calledWith('Cypress Warning: `cy.agents()` is deprecated. Use `cy.stub()` and `cy.spy()` instead.') - }) - - it('synchronously returns #spy and #stub methods', function () { - expect(this.agents.spy).to.be.a('function') - expect(this.agents.spy().callCount).to.be.a('number') - expect(this.agents.stub).to.be.a('function') - expect(this.agents.stub().returns).to.be.a('function') - }) - }) }) diff --git a/packages/driver/cypress/integration/commands/assertions_spec.js b/packages/driver/cypress/integration/commands/assertions_spec.js index ec791794d6..7eee94946a 100644 --- a/packages/driver/cypress/integration/commands/assertions_spec.js +++ b/packages/driver/cypress/integration/commands/assertions_spec.js @@ -572,25 +572,6 @@ describe('src/cy/commands/assertions', () => { cy.get('button').should('have.length', 'foo') }) - it('eventually.have.length is deprecated', function (done) { - cy.on('fail', (err) => { - const { lastLog } = this - - expect(this.logs.length).to.eq(2) - expect(err.message).to.eq('The `eventually` assertion chainer has been deprecated. This is now the default behavior so you can safely remove this word and everything should work as before.') - expect(lastLog.get('name')).to.eq('should') - expect(lastLog.get('error')).to.eq(err) - expect(lastLog.get('state')).to.eq('failed') - expect(lastLog.get('snapshots').length).to.eq(1) - expect(lastLog.get('snapshots')[0]).to.be.an('object') - expect(lastLog.get('message')).to.eq('eventually.have.length, 1') - - done() - }) - - cy.get('div:first').should('eventually.have.length', 1) - }) - it('does not additionally log when .should is the current command', function (done) { cy.on('fail', (err) => { const { lastLog } = this diff --git a/packages/driver/cypress/integration/commands/request_spec.js b/packages/driver/cypress/integration/commands/request_spec.js index fcd8b0399e..2de953809a 100644 --- a/packages/driver/cypress/integration/commands/request_spec.js +++ b/packages/driver/cypress/integration/commands/request_spec.js @@ -430,26 +430,6 @@ describe('src/cy/commands/request', () => { }) }) - describe('failOnStatus', () => { - it('is deprecated but does not fail even on 500 when failOnStatus=false', () => { - const warning = cy.spy(Cypress.utils, 'warning') - - Cypress.backend - .withArgs('http:request') - .resolves({ isOkStatusCode: false, status: 500 }) - - cy.request({ - url: 'http://localhost:1234/foo', - failOnStatus: false, - }) - .then((resp) => { - // make sure it really was 500! - expect(resp.status).to.eq(500) - expect(warning.lastCall.args[0]).to.include('The `cy.request()` `failOnStatus` option has been renamed to `failOnStatusCode`. Please update your code. This option will be removed at a later time.') - }) - }) - }) - describe('failOnStatusCode', () => { it('does not fail on status 401', () => { Cypress.backend diff --git a/packages/driver/cypress/integration/commands/waiting_spec.js b/packages/driver/cypress/integration/commands/waiting_spec.js index 4546664cac..6bd43e744b 100644 --- a/packages/driver/cypress/integration/commands/waiting_spec.js +++ b/packages/driver/cypress/integration/commands/waiting_spec.js @@ -51,22 +51,6 @@ describe('src/cy/commands/waiting', () => { }) }) - describe('function argument', () => { - describe('errors thrown', () => { - it('is deprecated', (done) => { - cy.on('fail', (err) => { - expect(err.message).to.eq('`cy.wait(fn)` has been deprecated. Change this command to be `cy.should(fn)`.') - - done() - }) - - cy.get('body').wait(($body) => { - expect($body).to.match('body') - }) - }) - }) - }) - describe('alias argument', () => { before(() => { cy.visit('/fixtures/jquery.html') @@ -852,6 +836,7 @@ describe('src/cy/commands/waiting', () => { { type: 'Boolean', val: true }, { type: 'Object', val: {} }, { type: 'Symbol', val: Symbol.iterator, errVal: 'Symbol(Symbol.iterator)' }, + { type: 'Function', val: () => {}, errVal: 'undefined' }, ], (attrs) => { it(`throws when 1st arg is ${attrs.type}`, (done) => { cy.on('fail', (err) => { diff --git a/packages/driver/cypress/integration/commands/xhr_spec.js b/packages/driver/cypress/integration/commands/xhr_spec.js index 5535dd5e61..f4afa38d57 100644 --- a/packages/driver/cypress/integration/commands/xhr_spec.js +++ b/packages/driver/cypress/integration/commands/xhr_spec.js @@ -1659,26 +1659,12 @@ describe('src/cy/commands/xhr', () => { this.warn = cy.spy(window.top.console, 'warn') }) - it('logs on {force404: false}', () => { - cy.server({ force404: false }) - .then(function () { - expect(this.warn).to.be.calledWith('Cypress Warning: Passing `cy.server({force404: false})` is now the default behavior of `cy.server()`. You can safely remove this option.') - }) - }) - it('does not log on {force404: true}', () => { cy.server({ force404: true }) .then(function () { expect(this.warn).not.to.be.called }) }) - - it('logs on {stub: false}', () => { - cy.server({ stub: false }) - .then(function () { - expect(this.warn).to.be.calledWithMatch('Cypress Warning: Passing `cy.server({stub: false})` is now deprecated. You can safely remove: `{stub: false}`.\n\nhttps://on.cypress.io/deprecated-stub-false-on-server') - }) - }) }) describe('request response alias', () => { diff --git a/packages/driver/cypress/integration/cypress/cy_spec.js b/packages/driver/cypress/integration/cypress/cy_spec.js index 431ad00bb8..2d9460d41a 100644 --- a/packages/driver/cypress/integration/cypress/cy_spec.js +++ b/packages/driver/cypress/integration/cypress/cy_spec.js @@ -38,26 +38,6 @@ describe('driver/src/cypress/cy', () => { }) }) - context('hard deprecated private props', () => { - it('throws on accessing props', () => { - const fn = () => { - cy.props.foo - } - - expect(fn).to.throw('You are accessing a private property') - expect(fn).to.throw('function: `cy.state\(\.\.\.\)`') - }) - - it('throws on accessing privates', () => { - const fn = () => { - cy.privates.foo - } - - expect(fn).to.throw('You are accessing a private property') - expect(fn).to.throw('function: `cy.state\(\.\.\.\)`') - }) - }) - context('internals of custom commands', () => { let setup diff --git a/packages/driver/cypress/integration/cypress/cypress_spec.js b/packages/driver/cypress/integration/cypress/cypress_spec.js index 761c25f7dc..a7ed3dd017 100644 --- a/packages/driver/cypress/integration/cypress/cypress_spec.js +++ b/packages/driver/cypress/integration/cypress/cypress_spec.js @@ -105,14 +105,6 @@ describe('driver/src/cypress/index', () => { }) context('.Log', () => { - it('throws when using Cypress.Log.command()', () => { - const fn = () => { - Cypress.Log.command({}) - } - - expect(fn).to.throw('has been renamed to `Cypress.log()`') - }) - it('throws when passing non-object to Cypress.log()', () => { const fn = () => { Cypress.log('My Log') @@ -134,41 +126,6 @@ describe('driver/src/cypress/index', () => { }) }) - context('deprecated custom command methods', () => { - it('throws when using Cypress.addParentCommand', () => { - const addParentCommand = () => Cypress.addParentCommand() - - expect(addParentCommand).to.throw().and.satisfy((err) => { - expect(err.message).to.include('Cypress.addParentCommand(...) has been removed and replaced') - expect(err.docsUrl).to.equal('https://on.cypress.io/custom-command-interface-changed') - - return true - }) - }) - - it('throws when using Cypress.addChildCommand', () => { - const addChildCommand = () => Cypress.addChildCommand() - - expect(addChildCommand).to.throw().and.satisfy((err) => { - expect(err.message).to.include('Cypress.addChildCommand(...) has been removed and replaced') - expect(err.docsUrl).to.equal('https://on.cypress.io/custom-command-interface-changed') - - return true - }) - }) - - it('throws when using Cypress.addDualCommand', () => { - const addDualCommand = () => Cypress.addDualCommand() - - expect(addDualCommand).to.throw().and.satisfy((err) => { - expect(err.message).to.include('Cypress.addDualCommand(...) has been removed and replaced') - expect(err.docsUrl).to.equal('https://on.cypress.io/custom-command-interface-changed') - - return true - }) - }) - }) - context('private command methods', () => { it('throws when using Cypress.addAssertionCommand', () => { const addAssertionCommand = () => Cypress.addAssertionCommand() diff --git a/packages/driver/src/cy/commands/agents.js b/packages/driver/src/cy/commands/agents.js index 3ac6e55614..d1e44700f9 100644 --- a/packages/driver/src/cy/commands/agents.js +++ b/packages/driver/src/cy/commands/agents.js @@ -281,11 +281,5 @@ module.exports = function (Commands, Cypress, cy, state) { spy, stub, - - agents () { - $errUtils.warnByPath('agents.deprecated_warning') - - return { stub, spy } - }, }) } diff --git a/packages/driver/src/cy/commands/asserting.js b/packages/driver/src/cy/commands/asserting.js index 40afef6963..44596d1c97 100644 --- a/packages/driver/src/cy/commands/asserting.js +++ b/packages/driver/src/cy/commands/asserting.js @@ -5,7 +5,6 @@ const $dom = require('../../dom') const $errUtils = require('../../cypress/error_utils') const reExistence = /exist/ -const reEventually = /^eventually/ const reHaveLength = /length/ module.exports = function (Commands, Cypress, cy, state) { @@ -55,12 +54,6 @@ module.exports = function (Commands, Cypress, cy, state) { const originalObj = exp._obj let err - if (reEventually.test(chainers)) { - err = $errUtils.cypressErrByPath('should.eventually_deprecated') - err.retry = false - throwAndLogErr(err) - } - const isCheckingExistence = reExistence.test(chainers) const isCheckingLengthOrExistence = isCheckingExistence || reHaveLength.test(chainers) diff --git a/packages/driver/src/cy/commands/request.js b/packages/driver/src/cy/commands/request.js index ee760723b0..5b235ef609 100644 --- a/packages/driver/src/cy/commands/request.js +++ b/packages/driver/src/cy/commands/request.js @@ -103,11 +103,6 @@ module.exports = (Commands, Cypress, cy, state, config) => { $errUtils.throwErrByPath('request.status_code_flags_invalid') } - if (_.has(options, 'failOnStatus')) { - $errUtils.warnByPath('request.failonstatus_deprecated_warning') - options.failOnStatusCode = options.failOnStatus - } - // normalize followRedirects -> followRedirect // because we are nice if (_.has(options, 'followRedirects')) { diff --git a/packages/driver/src/cy/commands/waiting.js b/packages/driver/src/cy/commands/waiting.js index 037108aead..1997a8a046 100644 --- a/packages/driver/src/cy/commands/waiting.js +++ b/packages/driver/src/cy/commands/waiting.js @@ -24,10 +24,6 @@ const throwErr = (arg) => { } module.exports = (Commands, Cypress, cy, state) => { - const waitFunction = () => { - $errUtils.throwErrByPath('wait.fn_deprecated') - } - let userOptions = null const waitNumber = (subject, ms, options) => { @@ -219,7 +215,7 @@ module.exports = (Commands, Cypress, cy, state) => { } Commands.addAll({ prevSubject: 'optional' }, { - wait (subject, msOrFnOrAlias, options = {}) { + wait (subject, msOrAlias, options = {}) { userOptions = options // check to ensure options is an object @@ -231,42 +227,38 @@ module.exports = (Commands, Cypress, cy, state) => { } options = _.defaults({}, userOptions, { log: true }) - const args = [subject, msOrFnOrAlias, options] + const args = [subject, msOrAlias, options] try { - if (_.isFinite(msOrFnOrAlias)) { + if (_.isFinite(msOrAlias)) { return waitNumber.apply(window, args) } - if (_.isFunction(msOrFnOrAlias)) { - return waitFunction() - } - - if (_.isString(msOrFnOrAlias)) { + if (_.isString(msOrAlias)) { return waitString.apply(window, args) } - if (_.isArray(msOrFnOrAlias) && !_.isEmpty(msOrFnOrAlias)) { + if (_.isArray(msOrAlias) && !_.isEmpty(msOrAlias)) { return waitString.apply(window, args) } // figure out why this error failed - if (_.isNaN(msOrFnOrAlias)) { + if (_.isNaN(msOrAlias)) { throwErr('NaN') } - if (msOrFnOrAlias === Infinity) { + if (msOrAlias === Infinity) { throwErr('Infinity') } - if (_.isSymbol(msOrFnOrAlias)) { - throwErr(msOrFnOrAlias.toString()) + if (_.isSymbol(msOrAlias)) { + throwErr(msOrAlias.toString()) } let arg try { - arg = JSON.stringify(msOrFnOrAlias) + arg = JSON.stringify(msOrAlias) } catch (error) { arg = 'an invalid argument' } diff --git a/packages/driver/src/cypress.js b/packages/driver/src/cypress.js index 4447933e5a..b7e7683cb1 100644 --- a/packages/driver/src/cypress.js +++ b/packages/driver/src/cypress.js @@ -42,34 +42,6 @@ const jqueryProxyFn = function (...args) { return this.cy.$$.apply(this.cy, args) } -// provide the old interface and -// throw a deprecation message -$Log.command = () => { - return $errUtils.throwErrByPath('miscellaneous.command_log_renamed') -} - -const throwDeprecatedCommandInterface = (key = 'commandName', method) => { - let signature = '' - - switch (method) { - case 'addParentCommand': - signature = `'${key}', function(){...}` - break - case 'addChildCommand': - signature = `'${key}', { prevSubject: true }, function(){...}` - break - case 'addDualCommand': - signature = `'${key}', { prevSubject: 'optional' }, function(){...}` - break - default: - break - } - - $errUtils.throwErrByPath('miscellaneous.custom_command_interface_changed', { - args: { method, signature }, - }) -} - const throwPrivateCommandInterface = (method) => { $errUtils.throwErrByPath('miscellaneous.private_custom_command_interface', { args: { method }, @@ -578,18 +550,6 @@ class $Cypress { return this.action('cypress:stop') } - addChildCommand (key) { - return throwDeprecatedCommandInterface(key, 'addChildCommand') - } - - addParentCommand (key) { - return throwDeprecatedCommandInterface(key, 'addParentCommand') - } - - addDualCommand (key) { - return throwDeprecatedCommandInterface(key, 'addDualCommand') - } - addAssertionCommand () { return throwPrivateCommandInterface('addAssertionCommand') } diff --git a/packages/driver/src/cypress/cookies.js b/packages/driver/src/cypress/cookies.js index 76d83d4fa1..49b1f984cb 100644 --- a/packages/driver/src/cypress/cookies.js +++ b/packages/driver/src/cypress/cookies.js @@ -146,14 +146,6 @@ const $Cookies = (namespace, domain) => { } - _.each(['get', 'set', 'remove', 'getAllCookies', 'clearCookies'], (method) => { - return API[method] = () => { - return $errUtils.throwErrByPath('cookies.removed_method', { - args: { method }, - }) - } - }) - return API } diff --git a/packages/driver/src/cypress/cy.js b/packages/driver/src/cypress/cy.js index 4f4c73b7fa..cfcc7b3fdf 100644 --- a/packages/driver/src/cypress/cy.js +++ b/packages/driver/src/cypress/cy.js @@ -33,11 +33,6 @@ const $TestConfigOverrides = require('../cy/testConfigOverrides') const { registerFetch } = require('unfetch') -const privateProps = { - props: { name: 'state', url: true }, - privates: { name: 'state', url: false }, -} - const noArgsAreAFunction = (args) => { return !_.some(args, _.isFunction) } @@ -1411,16 +1406,6 @@ const create = function (specWindow, Cypress, Cookies, state, config, log) { }, }) - _.each(privateProps, (obj, key) => { - return Object.defineProperty(cy, key, { - get () { - return $errUtils.throwErrByPath('miscellaneous.private_property', { - args: obj, - }) - }, - }) - }) - setTopOnError(cy) // make cy global in the specWindow diff --git a/packages/driver/src/cypress/error_messages.js b/packages/driver/src/cypress/error_messages.js index 39ab21809e..e01b45ee77 100644 --- a/packages/driver/src/cypress/error_messages.js +++ b/packages/driver/src/cypress/error_messages.js @@ -106,10 +106,6 @@ module.exports = { type_missing: '`Cypress.add(key, fn, type)` must include a type!', }, - agents: { - deprecated_warning: `${cmd('agents')} is deprecated. Use ${cmd('stub')} and ${cmd('spy')} instead.`, - }, - alias: { invalid: 'Invalid alias: `{{name}}`.\nYou forgot the `@`. It should be written as: `@{{displayName}}`.', not_registered_with_available: `${cmd('{{cmd}}')} could not find a registered alias for: \`@{{displayName}}\`.\nAvailable aliases are: \`{{availableAliases}}\`.`, @@ -289,19 +285,6 @@ module.exports = { docsUrl: `https://on.cypress.io/${_.toLower(obj.cmd)}`, } }, - removed_method: { - message: stripIndent`\ - The \`Cypress.Cookies.{{method}}()\` method has been removed. - - Setting, getting, and clearing cookies is now an asynchronous operation. - - Replace this call with the appropriate command such as: - - \`cy.getCookie()\` - - \`cy.getCookies()\` - - \`cy.setCookie()\` - - \`cy.clearCookie()\` - - \`cy.clearCookies()\``, - }, whitelist_renamed (obj) { return { message: `\`${obj.type}\` \`whitelist\` option has been renamed to \`preserve\`. Please rename \`whitelist\` to \`preserve\`.`, @@ -694,23 +677,6 @@ module.exports = { }, miscellaneous: { - custom_command_interface_changed (obj) { - return { - message: stripIndent`\ - Cypress.${obj.method}(...) has been removed and replaced by: - - \`Cypress.Commands.add(...)\` - - Instead of indicating \`parent\`, \`child\`, or \`dual\` commands, you pass an \`options\` object - to describe the requirements around the previous subject. You can also enforce specific - subject types such as requiring the subject to be a DOM element. - - To rewrite this custom command you'd likely write: - - \`Cypress.Commands.add(${obj.signature})\``, - docsUrl: 'https://on.cypress.io/custom-command-interface-changed', - } - }, returned_value_and_commands_from_custom_command (obj) { return { message: stripIndent`\ @@ -789,10 +755,6 @@ module.exports = { docsUrl: 'https://on.cypress.io/returning-promise-and-commands-in-test', } }, - command_log_renamed: stripIndent`\ - \`Cypress.Log.command()\` has been renamed to \`Cypress.log()\` - - Please update your code. You should be able to safely do a find/replace.`, dangling_commands: { message: stripIndent`\ Oops, Cypress detected something wrong with your test code. @@ -858,12 +820,6 @@ module.exports = { docsUrl: 'https://on.cypress.io/cannot-execute-commands-outside-test', }, private_custom_command_interface: 'You cannot use the undocumented private command interface: `{{method}}`', - private_property: stripIndent`\ - You are accessing a private property directly on \`cy\` which has been renamed. - - This was never documented nor supported. - - Please go through the public function: ${cmd('state', '...')}`, retry_timed_out: 'Timed out retrying: ', }, @@ -1129,10 +1085,6 @@ module.exports = { message: `${cmd('request')} was called with an invalid method: \`{{method}}\`. Method can be: \`GET\`, \`POST\`, \`PUT\`, \`DELETE\`, \`PATCH\`, \`HEAD\`, \`OPTIONS\`, or any other method supported by Node's HTTP parser.`, docsUrl: 'https://on.cypress.io/request', }, - failonstatus_deprecated_warning: { - message: `The ${cmd('request')} \`failOnStatus\` option has been renamed to \`failOnStatusCode\`. Please update your code. This option will be removed at a later time.`, - docsUrl: 'https://on.cypress.io/request', - }, form_invalid: { message: stripIndent`\ ${cmd('request')} requires the \`form\` option to be a boolean. @@ -1438,15 +1390,10 @@ module.exports = { }, server: { - force404_deprecated: 'Passing `cy.server({force404: false})` is now the default behavior of `cy.server()`. You can safely remove this option.', invalid_argument: { message: `${cmd('server')} accepts only an object literal as its argument.`, docsUrl: 'https://on.cypress.io/server', }, - stub_deprecated: { - message: 'Passing `cy.server({stub: false})` is now deprecated. You can safely remove: `{stub: false}`.', - docsUrl: 'https://on.cypress.io/deprecated-stub-false-on-{{type}}', - }, xhrurl_not_set: '`Server.options.xhrUrl` has not been set', unavailable: 'The XHR server is unavailable or missing. This should never happen and likely is a bug. Open an issue if you see this message.', whitelist_renamed: `The ${cmd('server')} \`whitelist\` option has been renamed to \`ignore\`. Please rename \`whitelist\` to \`ignore\`.`, @@ -1503,7 +1450,6 @@ module.exports = { message: 'The chainer `{{originalChainers}}` is a language chainer provided to improve the readability of your assertions, not an actual assertion. Please provide a valid assertion.', docsUrl: 'https://on.cypress.io/assertions', }, - eventually_deprecated: 'The `eventually` assertion chainer has been deprecated. This is now the default behavior so you can safely remove this word and everything should work as before.', }, spread: { @@ -1955,10 +1901,6 @@ module.exports = { message: '`{{prop}}` is not a valid alias property. Are you trying to ask for the first request? If so write `@{{str}}.request`', docsUrl: 'https://on.cypress.io/wait', }, - fn_deprecated: { - message: `${cmd('wait', 'fn')} has been deprecated. Change this command to be ${cmd('should', 'fn')}.`, - docsUrl: 'https://on.cypress.io/wait', - }, invalid_1st_arg: { message: `${cmd('wait')} only accepts a number, an alias of a route, or an array of aliases of routes. You passed: \`{{arg}}\``, docsUrl: 'https://on.cypress.io/wait', @@ -2006,7 +1948,5 @@ module.exports = { aborted: 'This XHR was aborted by your code -- check this stack trace below.', missing: '`XMLHttpRequest#xhr` is missing.', network_error: 'The network request for this XHR could not be made. Check your console for the reason.', - requestjson_deprecated: '`requestJSON` is now deprecated and will be removed in the next version. Update this to `requestBody` or `request.body`.', - responsejson_deprecated: '`responseJSON` is now deprecated and will be removed in the next version. Update this to `responseBody` or `response.body`.', }, } diff --git a/packages/driver/src/cypress/server.js b/packages/driver/src/cypress/server.js index 097336edb0..7620974540 100644 --- a/packages/driver/src/cypress/server.js +++ b/packages/driver/src/cypress/server.js @@ -53,18 +53,6 @@ const isAbortedThroughUnload = (xhr) => { xhr.responseText === '' } -const warnOnStubDeprecation = (obj, type) => { - if (_.has(obj, 'stub')) { - return $errUtils.warnByPath('server.stub_deprecated', { args: { type } }) - } -} - -const warnOnForce404Default = (obj) => { - if (obj.force404 === false) { - return $errUtils.warnByPath('server.force404_deprecated') - } -} - const warnOnWhitelistRenamed = (obj, type) => { if (obj.whitelist) { return $errUtils.throwErrByPath('server.whitelist_renamed', { args: { type } }) @@ -240,8 +228,6 @@ const create = (options = {}) => { }, route (attrs = {}) { - warnOnStubDeprecation(attrs, 'route') - // merge attrs with the server's defaults // so we preserve the state of the attrs // at the time they're created since we @@ -418,8 +404,6 @@ const create = (options = {}) => { }, set (obj) { - warnOnStubDeprecation(obj, 'server') - warnOnForce404Default(obj) warnOnWhitelistRenamed(obj, 'server') // handle enable=true|false diff --git a/packages/driver/src/cypress/xml_http_request.js b/packages/driver/src/cypress/xml_http_request.js index bd9ea5e0c4..b3c97a6922 100644 --- a/packages/driver/src/cypress/xml_http_request.js +++ b/packages/driver/src/cypress/xml_http_request.js @@ -161,22 +161,6 @@ Object.defineProperties(XMLHttpRequest.prototype, { return this.response?.body }, }, - - requestJSON: { - get () { - $errUtils.warnByPath('xhr.requestjson_deprecated') - - return this.requestBody - }, - }, - - responseJSON: { - get () { - $errUtils.warnByPath('xhr.responsejson_deprecated') - - return this.responseBody - }, - }, }) const create = (xhr) => { diff --git a/packages/server/lib/config.js b/packages/server/lib/config.js index bc117af32f..8ab3a5a181 100644 --- a/packages/server/lib/config.js +++ b/packages/server/lib/config.js @@ -23,7 +23,6 @@ const CYPRESS_RESERVED_ENV_VARS = [ 'CYPRESS_INTERNAL_ENV', ] const CYPRESS_SPECIAL_ENV_VARS = [ - 'CI_KEY', 'RECORD_KEY', ] diff --git a/packages/server/lib/config_options.ts b/packages/server/lib/config_options.ts index 013e157988..4887a40958 100644 --- a/packages/server/lib/config_options.ts +++ b/packages/server/lib/config_options.ts @@ -289,16 +289,5 @@ export const breakingOptions = [ name: 'experimentalShadowDomSupport', errorKey: 'EXPERIMENTAL_SHADOW_DOM_REMOVED', isWarning: true, - }, { - name: 'screenshotOnHeadlessFailure', - errorKey: 'SCREENSHOT_ON_HEADLESS_FAILURE_REMOVED', - }, { - name: 'trashAssetsBeforeHeadlessRuns', - errorKey: 'RENAMED_CONFIG_OPTION', - newName: 'trashAssetsBeforeRuns', - }, { - name: 'videoRecording', - errorKey: 'RENAMED_CONFIG_OPTION', - newName: 'video', }, ] diff --git a/packages/server/lib/errors.js b/packages/server/lib/errors.js index db315dc996..8aee69e7a0 100644 --- a/packages/server/lib/errors.js +++ b/packages/server/lib/errors.js @@ -396,24 +396,6 @@ const getMsgByType = function (type, arg1 = {}, arg2, arg3) { ${chalk.yellow('cypress run --record false')} https://on.cypress.io/recording-project-runs` - case 'CYPRESS_CI_DEPRECATED': - return stripIndent`\ - You are using the deprecated command: ${chalk.yellow('cypress ci ')} - - Please switch and use: ${chalk.blue('cypress run --record --key ')} - - https://on.cypress.io/cypress-ci-deprecated` - case 'CYPRESS_CI_DEPRECATED_ENV_VAR': - return stripIndent`\ - 1. You are using the deprecated command: ${chalk.yellow('cypress ci')} - - Please switch and use: ${chalk.blue('cypress run --record')} - - 2. You are also using the environment variable: ${chalk.yellow('CYPRESS_CI_KEY')} - - Please rename this environment variable to: ${chalk.blue('CYPRESS_RECORD_KEY')} - - https://on.cypress.io/cypress-ci-deprecated` case 'DASHBOARD_INVALID_RUN_REQUEST': return stripIndent`\ Recording this run failed because the request was invalid. @@ -646,22 +628,6 @@ const getMsgByType = function (type, arg1 = {}, arg2, arg3) { We found an invalid configuration value: ${chalk.yellow(arg1)}` - case 'SCREENSHOT_ON_HEADLESS_FAILURE_REMOVED': - return stripIndent`\ - In Cypress version 3.0.0 we removed the configuration option ${chalk.yellow('\`screenshotOnHeadlessFailure\`')} - - You now configure this behavior in your test code. - - Example: - - \`\`\` - // cypress/support/index.js - Cypress.Screenshot.defaults({ - screenshotOnRunFailure: false - }) - \`\`\` - - Learn more at https://on.cypress.io/screenshot-api` case 'RENAMED_CONFIG_OPTION': return stripIndent`\ The ${chalk.yellow(arg1)} configuration option you have supplied has been renamed. diff --git a/packages/server/lib/modes/record.js b/packages/server/lib/modes/record.js index 0798a14537..9442fdf938 100644 --- a/packages/server/lib/modes/record.js +++ b/packages/server/lib/modes/record.js @@ -42,29 +42,11 @@ const runningInternalTests = () => { return env.get('CYPRESS_INTERNAL_E2E_TESTS') === '1' } -const warnIfCiFlag = (ci) => { - // if we are using the ci flag that means - // we have an old version of the CLI tools installed - // and that we need to warn the user what to update - if (ci) { - const type = (() => { - if (env.get('CYPRESS_CI_KEY')) { - return 'CYPRESS_CI_DEPRECATED_ENV_VAR' - } - - return 'CYPRESS_CI_DEPRECATED' - })() - - return errors.warning(type) - } -} - const haveProjectIdAndKeyButNoRecordOption = (projectId, options) => { - // if we have a project id - // and we have a key - // and (record or ci) hasn't been set to true or false + // if we have a project id and we have a key + // and record hasn't been set to true or false return (projectId && options.key) && ( - _.isUndefined(options.record) && _.isUndefined(options.ci) + _.isUndefined(options.record) ) } @@ -307,7 +289,7 @@ const createRun = Promise.method((options = {}) => { let { projectId, recordKey, platform, git, specPattern, specs, parallel, ciBuildId, group, tags } = options if (recordKey == null) { - recordKey = env.get('CYPRESS_RECORD_KEY') || env.get('CYPRESS_CI_KEY') + recordKey = env.get('CYPRESS_RECORD_KEY') } if (!recordKey) { @@ -753,8 +735,6 @@ module.exports = { uploadArtifacts, - warnIfCiFlag, - throwIfNoProjectId, throwIfIndeterminateCiBuildId, diff --git a/packages/server/lib/modes/run.js b/packages/server/lib/modes/run.js index a4f6303adc..36a1c02dce 100644 --- a/packages/server/lib/modes/run.js +++ b/packages/server/lib/modes/run.js @@ -1404,9 +1404,6 @@ module.exports = { // alias and coerce to null let specPattern = options.spec || null - // warn if we're using deprecated --ci flag - recordMode.warnIfCiFlag(options.ci) - // ensure the project exists // and open up the project return browserUtils.getAllBrowsersWith() diff --git a/packages/server/test/integration/cypress_spec.js b/packages/server/test/integration/cypress_spec.js index 762541c514..5d69dcbf46 100644 --- a/packages/server/test/integration/cypress_spec.js +++ b/packages/server/test/integration/cypress_spec.js @@ -890,14 +890,6 @@ describe('lib/cypress', () => { }) const renamedConfigs = [ - { - old: 'trashAssetsBeforeHeadlessRuns', - new: 'trashAssetsBeforeRuns', - }, - { - old: 'videoRecording', - new: 'video', - }, { old: 'blacklistHosts', new: 'blockHosts', @@ -917,17 +909,6 @@ describe('lib/cypress', () => { }) }) - it('logs error and exits when using screenshotOnHeadlessFailure', function () { - return cypress.start([ - `--run-project=${this.todosPath}`, - '--config=screenshotOnHeadlessFailure=false', - ]) - .then(() => { - this.expectExitWithErr('SCREENSHOT_ON_HEADLESS_FAILURE_REMOVED', 'screenshotOnHeadlessFailure') - this.expectExitWithErr('SCREENSHOT_ON_HEADLESS_FAILURE_REMOVED', 'You now configure this behavior in your test code') - }) - }) - // TODO: make sure we have integration tests around this // for headed projects! // also make sure we test the rest of the integration functionality @@ -1297,7 +1278,7 @@ describe('lib/cypress', () => { // most record mode logic is covered in e2e tests. // we only need to cover the edge cases / warnings - context('--record or --ci', () => { + context('--record', () => { beforeEach(function () { sinon.stub(api, 'createRun').resolves() sinon.stub(electron.app, 'on').withArgs('ready').yieldsAsync() @@ -1369,40 +1350,6 @@ describe('lib/cypress', () => { }) }) - it('logs warning when using deprecated --ci arg and no env var', function () { - return cypress.start([ - `--run-project=${this.recordPath}`, - '--key=token-123', - '--ci', - ]) - .then(() => { - expect(errors.warning).to.be.calledWith('CYPRESS_CI_DEPRECATED') - expect(console.log).to.be.calledWithMatch('You are using the deprecated command:') - expect(console.log).to.be.calledWithMatch('cypress run --record --key ') - expect(errors.warning).not.to.be.calledWith('PROJECT_ID_AND_KEY_BUT_MISSING_RECORD_OPTION') - this.expectExitWith(3) - }) - }) - - it('logs warning when using deprecated --ci arg and env var', function () { - sinon.stub(env, 'get') - .withArgs('CYPRESS_CI_KEY') - .returns('asdf123foobarbaz') - - return cypress.start([ - `--run-project=${this.recordPath}`, - '--key=token-123', - '--ci', - ]) - .then(() => { - expect(errors.warning).to.be.calledWith('CYPRESS_CI_DEPRECATED_ENV_VAR') - expect(console.log).to.be.calledWithMatch('You are using the deprecated command:') - expect(console.log).to.be.calledWithMatch('cypress ci') - expect(console.log).to.be.calledWithMatch('cypress run --record') - this.expectExitWith(3) - }) - }) - it('errors and exits when using --group but ciBuildId could not be generated', function () { sinon.stub(ciProvider, 'provider').returns(null) diff --git a/packages/server/test/unit/config_spec.js b/packages/server/test/unit/config_spec.js index add0013ced..a8f782b8ab 100644 --- a/packages/server/test/unit/config_spec.js +++ b/packages/server/test/unit/config_spec.js @@ -1211,7 +1211,6 @@ describe('lib/config', () => { sinon.stub(config, 'getProcessEnvVars').returns({ quux: 'quux', RECORD_KEY: 'foobarbazquux', - CI_KEY: 'justanothercikey', PROJECT_ID: 'projectId123', }) @@ -1269,10 +1268,6 @@ describe('lib/config', () => { value: 'fooba...zquux', from: 'env', }, - CI_KEY: { - value: 'justa...cikey', - from: 'env', - }, }, fileServerFolder: { value: '', from: 'default' }, firefoxGcInterval: { value: { openMode: null, runMode: 1 }, from: 'default' },