diff --git a/.gitignore b/.gitignore index ad824269bdff..dc6c36d4e187 100644 --- a/.gitignore +++ b/.gitignore @@ -52,6 +52,7 @@ packages/example/cypress/integration # from frontend-shared packages/frontend-shared/cypress/e2e/.projects +packages/frontend-shared/src/public/shiki/themes/cypress.theme.json # from server packages/server/.cy diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 4431772b6d2d..2f8687bfb2f7 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -573,6 +573,8 @@ Independent packages are automatically released when code is merged into `master ![Select release for PR](https://user-images.githubusercontent.com/1271364/135139641-657015d6-2dca-42d4-a4fb-16478f61d63f.png) - Please check the "Allow edits from maintainers" checkbox when submitting your PR. This will make it easier for the maintainers to make minor adjustments, to help with tests or any other changes we may need. ![Allow edits from maintainers checkbox](https://user-images.githubusercontent.com/1271181/31393427-b3105d44-ada9-11e7-80f2-0dac51e3919e.png) +- After the PR is approved, the original contributor can merge the PR (if the original contributor has access). +- When you merge a PR into `develop`, select [**Squash and merge**](https://docs.github.com/en/github/collaborating-with-pull-requests/incorporating-changes-from-a-pull-request/about-pull-request-merges#squash-and-merge-your-pull-request-commits). This will squash all commits into a single commit. *The only exception to squashing is when converting files to another language and there is a clear commit history needed to maintain from the file conversion.* ### Dependencies diff --git a/browser-versions.json b/browser-versions.json index c471c41893d8..bf7bd2e449e1 100644 --- a/browser-versions.json +++ b/browser-versions.json @@ -1,4 +1,4 @@ { - "chrome:beta": "95.0.4638.54", - "chrome:stable": "95.0.4638.54" + "chrome:beta": "96.0.4664.27", + "chrome:stable": "95.0.4638.69" } diff --git a/circle.yml b/circle.yml index 05941114e508..f4a62125dce6 100644 --- a/circle.yml +++ b/circle.yml @@ -1020,7 +1020,7 @@ jobs: fi - wait-on-circle-jobs: job-names: > - desktop-gui-integration-tests-2x, + desktop-gui-integration-tests-7x, desktop-gui-component-tests, cli-visual-tests, runner-integration-tests-chrome, @@ -1298,9 +1298,9 @@ jobs: - run-driver-integration-tests: browser: electron - desktop-gui-integration-tests-2x: + desktop-gui-integration-tests-7x: <<: *defaults - parallelism: 2 + parallelism: 7 steps: - restore_cached_workspace - run: @@ -2208,7 +2208,7 @@ linux-workflow: &linux-workflow # context: test-runner:launchpad-tests # requires: # - build - - desktop-gui-integration-tests-2x: + - desktop-gui-integration-tests-7x: requires: - build - desktop-gui-component-tests: @@ -2279,7 +2279,7 @@ linux-workflow: &linux-workflow - reporter-integration-tests - Linux lint - desktop-gui-component-tests - - desktop-gui-integration-tests-2x + - desktop-gui-integration-tests-7x - runner-ct-integration-tests-chrome - runner-integration-tests-firefox - runner-integration-tests-chrome diff --git a/cli/lib/cli.js b/cli/lib/cli.js index 83ed03901c21..9da52b40ae53 100644 --- a/cli/lib/cli.js +++ b/cli/lib/cli.js @@ -1,6 +1,5 @@ // @ts-check const _ = require('lodash') -const R = require('ramda') const commander = require('commander') const { stripIndent } = require('common-tags') const logSymbols = require('log-symbols') @@ -283,12 +282,17 @@ const castCypressRunOptions = (opts) => { // only properties that have type "string | false" in our TS definition // require special handling, because CLI parsing takes care of purely // boolean arguments - const result = R.evolve({ - port: coerceAnyStringToInt, - configFile: coerceFalseOrString, - })(opts) + const castOpts = { ...opts } - return result + if (_.has(opts, 'port')) { + castOpts.port = coerceAnyStringToInt(opts.port) + } + + if (_.has(opts, 'configFile')) { + castOpts.configFile = coerceFalseOrString(opts.configFile) + } + + return castOpts } module.exports = { diff --git a/cli/lib/errors.js b/cli/lib/errors.js index aced13a48292..cedc7cb899dd 100644 --- a/cli/lib/errors.js +++ b/cli/lib/errors.js @@ -1,6 +1,5 @@ const chalk = require('chalk') const { stripIndent, stripIndents } = require('common-tags') -const { merge } = require('ramda') const la = require('lazy-ass') const is = require('check-more-types') @@ -241,7 +240,7 @@ const CYPRESS_RUN_BINARY = { function addPlatformInformation (info) { return util.getPlatformInfo().then((platform) => { - return merge(info, { platform }) + return { ...info, platform } }) } diff --git a/cli/lib/exec/info.js b/cli/lib/exec/info.js index 415d276f1cbf..cd21138029c8 100644 --- a/cli/lib/exec/info.js +++ b/cli/lib/exec/info.js @@ -6,7 +6,6 @@ const os = require('os') const chalk = require('chalk') const prettyBytes = require('pretty-bytes') const _ = require('lodash') -const R = require('ramda') // color for numbers and show values const g = chalk.green @@ -22,14 +21,20 @@ methods.findProxyEnvironmentVariables = () => { return _.pick(process.env, ['HTTP_PROXY', 'HTTPS_PROXY', 'NO_PROXY']) } -const maskSensitiveVariables = R.evolve({ - CYPRESS_RECORD_KEY: R.always(''), -}) +const maskSensitiveVariables = (obj) => { + const masked = { ...obj } + + if (masked.CYPRESS_RECORD_KEY) { + masked.CYPRESS_RECORD_KEY = '' + } + + return masked +} methods.findCypressEnvironmentVariables = () => { const isCyVariable = (val, key) => key.startsWith('CYPRESS_') - return R.pickBy(isCyVariable)(process.env) + return _.pickBy(process.env, isCyVariable) } const formatCypressVariables = () => { diff --git a/cli/lib/logger.js b/cli/lib/logger.js index 679aeb52f517..088c07e058f8 100644 --- a/cli/lib/logger.js +++ b/cli/lib/logger.js @@ -1,4 +1,3 @@ -const R = require('ramda') const chalk = require('chalk') let logs = [] @@ -36,7 +35,9 @@ const always = (...messages) => { const logLines = (text) => { const lines = text.split('\n') - R.forEach(log, lines) + for (const line of lines) { + log(line) + } } const print = () => { diff --git a/cli/lib/tasks/state.js b/cli/lib/tasks/state.js index 6f92a752f760..475dfaeb94f3 100644 --- a/cli/lib/tasks/state.js +++ b/cli/lib/tasks/state.js @@ -2,7 +2,6 @@ const _ = require('lodash') const os = require('os') const path = require('path') const untildify = require('untildify') -const R = require('ramda') const debug = require('debug')('cypress:cli') const fs = require('../fs') @@ -179,9 +178,9 @@ const getBinaryPkgAsync = (binaryDir) => { }) } -const getBinaryPkgVersion = R.propOr(null, 'version') -const getBinaryElectronVersion = R.propOr(null, 'electronVersion') -const getBinaryElectronNodeVersion = R.propOr(null, 'electronNodeVersion') +const getBinaryPkgVersion = (o) => _.get(o, 'version', null) +const getBinaryElectronVersion = (o) => _.get(o, 'electronVersion', null) +const getBinaryElectronNodeVersion = (o) => _.get(o, 'electronNodeVersion', null) module.exports = { getPathToExecutable, diff --git a/cli/lib/util.js b/cli/lib/util.js index 4d2b6d7e085e..fa8e43a80c1c 100644 --- a/cli/lib/util.js +++ b/cli/lib/util.js @@ -1,5 +1,4 @@ const _ = require('lodash') -const R = require('ramda') const os = require('os') const ospath = require('ospath') const crypto = require('crypto') @@ -114,10 +113,9 @@ const logBrokenGtkDisplayWarning = () => { } function stdoutLineMatches (expectedLine, stdout) { - const lines = stdout.split('\n').map(R.trim) - const lineMatches = R.equals(expectedLine) + const lines = stdout.split('\n').map((val) => val.trim()) - return lines.some(lineMatches) + return lines.some((line) => line === expectedLine) } /** @@ -232,11 +230,14 @@ const parseOpts = (opts) => { // some options might be quoted - which leads to unexpected results // remove double quotes from certain options - const removeQuotes = { - group: dequote, - ciBuildId: dequote, + const cleanOpts = { ...opts } + const toDequote = ['group', 'ciBuildId'] + + for (const prop of toDequote) { + if (_.has(opts, prop)) { + cleanOpts[prop] = dequote(opts[prop]) + } } - const cleanOpts = R.evolve(removeQuotes, opts) debug('parsed cli options %o', cleanOpts) diff --git a/cli/package.json b/cli/package.json index 4387fc409906..dccb14bb48fa 100644 --- a/cli/package.json +++ b/cli/package.json @@ -55,7 +55,6 @@ "ospath": "^1.2.2", "pretty-bytes": "^5.6.0", "proxy-from-env": "1.0.0", - "ramda": "~0.27.1", "request-progress": "^3.0.0", "supports-color": "^8.1.1", "tmp": "~0.2.1", diff --git a/cli/schema/cypress.schema.json b/cli/schema/cypress.schema.json index baa58a927905..b204cf285736 100644 --- a/cli/schema/cypress.schema.json +++ b/cli/schema/cypress.schema.json @@ -44,6 +44,11 @@ "default": null, "description": "The reporter options used. Supported options depend on the reporter. See https://on.cypress.io/reporters#Reporter-Options" }, + "slowTestThreshold": { + "type": "number", + "default": 10000, + "description": "Slow test threshold in milliseconds. Only affects the visual output of some reporters. For example, the spec reporter will display the test time in yellow if over the threshold. See https://on.cypress.io/configuration#Timeouts" + }, "testFiles": { "type": [ "string", diff --git a/cli/test/lib/build_spec.js b/cli/test/lib/build_spec.js index 722f2d59105b..74a27803dfa6 100644 --- a/cli/test/lib/build_spec.js +++ b/cli/test/lib/build_spec.js @@ -5,13 +5,12 @@ const makeUserPackageFile = require('../../scripts/build') const snapshot = require('../support/snapshot') const la = require('lazy-ass') const is = require('check-more-types') -const R = require('ramda') const hasVersion = (json) => { return la(is.semver(json.version), 'cannot find version', json) } -const changeVersion = R.assoc('version', 'x.y.z') +const changeVersion = (o) => ({ ...o, version: 'x.y.z' }) describe('package.json build', () => { beforeEach(function () { diff --git a/cli/test/lib/cypress_spec.js b/cli/test/lib/cypress_spec.js index 12694b5611e3..829c42f3e492 100644 --- a/cli/test/lib/cypress_spec.js +++ b/cli/test/lib/cypress_spec.js @@ -2,7 +2,7 @@ require('../spec_helper') const os = require('os') const path = require('path') -const R = require('ramda') +const _ = require('lodash') const snapshot = require('../support/snapshot') const Promise = require('bluebird') const tmp = Promise.promisifyAll(require('tmp')) @@ -27,11 +27,10 @@ describe('cypress', function () { sinon.stub(open, 'start').resolves() }) - const getCallArgs = R.path(['lastCall', 'args', 0]) const getStartArgs = () => { expect(open.start).to.be.called - return getCallArgs(open.start) + return _.get(open.start, ['lastCall', 'args', 0]) } it('calls open#start, passing in options', function () { @@ -100,7 +99,6 @@ describe('cypress', function () { }) }) - const getCallArgs = R.path(['lastCall', 'args', 0]) const normalizeCallArgs = (args) => { expect(args.outputPath).to.equal(outputPath) delete args.outputPath @@ -110,7 +108,7 @@ describe('cypress', function () { const getStartArgs = () => { expect(run.start).to.be.called - return normalizeCallArgs(getCallArgs(run.start)) + return normalizeCallArgs(_.get(run.start, ['lastCall', 'args', 0])) } it('calls run#start, passing in options', () => { diff --git a/cli/types/cypress-npm-api.d.ts b/cli/types/cypress-npm-api.d.ts index c001524cb4f1..fb8eb2533a60 100644 --- a/cli/types/cypress-npm-api.d.ts +++ b/cli/types/cypress-npm-api.d.ts @@ -91,6 +91,10 @@ declare namespace CypressCommandLine { * Specify mocha reporter options */ reporterOptions: any + /** + * Slow test threshold in milliseconds. Only affects the visual output of some reporters. For example, the spec reporter will display the test time in yellow if over the threshold. + */ + slowTestThreshold: number /** * Specify the specs to run */ diff --git a/cli/types/cypress.d.ts b/cli/types/cypress.d.ts index 590bc0d674fb..c2eb9ae6ffe9 100644 --- a/cli/types/cypress.d.ts +++ b/cli/types/cypress.d.ts @@ -2577,6 +2577,11 @@ declare namespace Cypress { * @default "spec" */ reporterOptions: { [key: string]: any } + /** + * Slow test threshold in milliseconds. Only affects the visual output of some reporters. For example, the spec reporter will display the test time in yellow if over the threshold. + * @default 10000 + */ + slowTestThreshold: number /** * Whether Cypress will watch and restart tests on test file changes * @default true @@ -5672,7 +5677,7 @@ declare namespace Cypress { xhr: XMLHttpRequest } - type Encodings = 'ascii' | 'base64' | 'binary' | 'hex' | 'latin1' | 'utf8' | 'utf-8' | 'ucs2' | 'ucs-2' | 'utf16le' | 'utf-16le' + type Encodings = 'ascii' | 'base64' | 'binary' | 'hex' | 'latin1' | 'utf8' | 'utf-8' | 'ucs2' | 'ucs-2' | 'utf16le' | 'utf-16le' | null type PositionType = 'topLeft' | 'top' | 'topRight' | 'left' | 'center' | 'right' | 'bottomLeft' | 'bottom' | 'bottomRight' type ViewportPreset = 'macbook-16' | 'macbook-15' | 'macbook-13' | 'macbook-11' | 'ipad-2' | 'ipad-mini' | 'iphone-xr' | 'iphone-x' | 'iphone-6+' | 'iphone-se2' | 'iphone-8' | 'iphone-7' | 'iphone-6' | 'iphone-5' | 'iphone-4' | 'iphone-3' | 'samsung-s10' | 'samsung-note9' interface Offset { diff --git a/npm/create-cypress-tests/CHANGELOG.md b/npm/create-cypress-tests/CHANGELOG.md index ccfc9ef729a4..ca5d9c1fd808 100644 --- a/npm/create-cypress-tests/CHANGELOG.md +++ b/npm/create-cypress-tests/CHANGELOG.md @@ -1,3 +1,10 @@ +# [create-cypress-tests-v1.1.3](https://github.com/cypress-io/cypress/compare/create-cypress-tests-v1.1.2...create-cypress-tests-v1.1.3) (2021-10-29) + + +### Bug Fixes + +* revive type checker ([#18172](https://github.com/cypress-io/cypress/issues/18172)) ([af472b6](https://github.com/cypress-io/cypress/commit/af472b6419ecb2aec1abdb09df99b2fa5f56e033)) + # [create-cypress-tests-v1.1.2](https://github.com/cypress-io/cypress/compare/create-cypress-tests-v1.1.1...create-cypress-tests-v1.1.2) (2021-06-17) diff --git a/npm/cypress-schematic/CHANGELOG.md b/npm/cypress-schematic/CHANGELOG.md index 242f0ad431fa..f50756a22d84 100644 --- a/npm/cypress-schematic/CHANGELOG.md +++ b/npm/cypress-schematic/CHANGELOG.md @@ -1,3 +1,17 @@ +# [@cypress/schematic-v1.5.3](https://github.com/cypress-io/cypress/compare/@cypress/schematic-v1.5.2...@cypress/schematic-v1.5.3) (2021-10-29) + + +### Bug Fixes + +* remove outdated registry link ([#18710](https://github.com/cypress-io/cypress/issues/18710)) ([e2a869d](https://github.com/cypress-io/cypress/commit/e2a869d2a984abb6703aec966dd9124ee693b8c1)) + +# [@cypress/schematic-v1.5.2](https://github.com/cypress-io/cypress/compare/@cypress/schematic-v1.5.1...@cypress/schematic-v1.5.2) (2021-10-29) + + +### Bug Fixes + +* revive type checker ([#18172](https://github.com/cypress-io/cypress/issues/18172)) ([af472b6](https://github.com/cypress-io/cypress/commit/af472b6419ecb2aec1abdb09df99b2fa5f56e033)) + # [@cypress/schematic-v1.5.1](https://github.com/cypress-io/cypress/compare/@cypress/schematic-v1.5.0...@cypress/schematic-v1.5.1) (2021-09-10) diff --git a/npm/cypress-schematic/package.json b/npm/cypress-schematic/package.json index 353db69e6843..fa053922be27 100644 --- a/npm/cypress-schematic/package.json +++ b/npm/cypress-schematic/package.json @@ -52,8 +52,7 @@ "testing" ], "publishConfig": { - "access": "public", - "registry": "http://registry.npmjs.org/" + "access": "public" }, "builders": "./src/builders/builders.json", "ng-add": { diff --git a/npm/react/CHANGELOG.md b/npm/react/CHANGELOG.md index 4424052efd17..32c8ef992c0d 100644 --- a/npm/react/CHANGELOG.md +++ b/npm/react/CHANGELOG.md @@ -1,3 +1,12 @@ +# [@cypress/react-v5.10.2](https://github.com/cypress-io/cypress/compare/@cypress/react-v5.10.1...@cypress/react-v5.10.2) (2021-10-29) + + +### Bug Fixes + +* Next.JS 12 components testing failing with ` TypeError: Cannot read property 'traceChild' of undefined` ([#18648](https://github.com/cypress-io/cypress/issues/18648)) ([cb0cbdf](https://github.com/cypress-io/cypress/commit/cb0cbdf4c35da09a7dedcc4563a242cb4748e994)) +* remove outdated registry link ([#18710](https://github.com/cypress-io/cypress/issues/18710)) ([e2a869d](https://github.com/cypress-io/cypress/commit/e2a869d2a984abb6703aec966dd9124ee693b8c1)) +* **cypress/react:** disable react-refresh for craco setups ([#18517](https://github.com/cypress-io/cypress/issues/18517)) ([ea10795](https://github.com/cypress-io/cypress/commit/ea1079559473fc672b5e0e188b5b54bf8ebe2f98)) + # [@cypress/react-v5.10.1](https://github.com/cypress-io/cypress/compare/@cypress/react-v5.10.0...@cypress/react-v5.10.1) (2021-10-04) diff --git a/npm/react/package.json b/npm/react/package.json index 2623073dfce9..cefdf42304ba 100644 --- a/npm/react/package.json +++ b/npm/react/package.json @@ -178,8 +178,7 @@ } }, "publishConfig": { - "access": "public", - "registry": "http://registry.npmjs.org/" + "access": "public" }, "standard": { "globals": [ diff --git a/npm/react/plugins/next/checkSWC.ts b/npm/react/plugins/next/checkSWC.ts new file mode 100644 index 000000000000..6ba4fb5a1cc3 --- /dev/null +++ b/npm/react/plugins/next/checkSWC.ts @@ -0,0 +1,19 @@ +import type { Configuration } from 'webpack' + +export function checkSWC ( + webpackConfig: Configuration, + cypressConfig: Cypress.Config, +) { + const hasSWCLoader = webpackConfig.module?.rules.some((rule) => { + return rule.oneOf?.some( + (oneOf) => (oneOf.use as any)?.loader === 'next-swc-loader' + ) + }) + + if (hasSWCLoader && cypressConfig.nodeVersion !== 'system') { + throw new Error(`Cypress requires "nodeVersion" to be set to "system" in order to run Next.js with SWC optimizations. +Please add "nodeVersion": "system" to your Cypress configuration and try again.`) + } + + return false +} diff --git a/npm/react/plugins/next/findNextWebpackConfig.js b/npm/react/plugins/next/findNextWebpackConfig.js index e2609de57fd3..2b4acfb59837 100644 --- a/npm/react/plugins/next/findNextWebpackConfig.js +++ b/npm/react/plugins/next/findNextWebpackConfig.js @@ -4,6 +4,7 @@ const debug = require('debug')('@cypress/react') const getNextJsBaseWebpackConfig = require('next/dist/build/webpack-config').default const { findPagesDir } = require('../../dist/next/findPagesDir') const { getRunWebpackSpan } = require('../../dist/next/getRunWebpackSpan') +const { checkSWC } = require('../../dist/next/checkSWC') async function getNextWebpackConfig (config) { let loadConfig @@ -38,6 +39,8 @@ async function getNextWebpackConfig (config) { debug('resolved next.js webpack config %o', nextWebpackConfig) + checkSWC(nextWebpackConfig, config) + return nextWebpackConfig } diff --git a/npm/react/plugins/next/getRunWebpackSpan.ts b/npm/react/plugins/next/getRunWebpackSpan.ts index ead3dcdbe227..44c0585883e7 100644 --- a/npm/react/plugins/next/getRunWebpackSpan.ts +++ b/npm/react/plugins/next/getRunWebpackSpan.ts @@ -3,13 +3,21 @@ import type { Span } from 'next/dist/telemetry/trace/trace' // Starting with v11.1.1, a trace is required. // 'next/dist/telemetry/trace/trace' only exists since v10.0.9 // and our peerDeps support back to v8 so try-catch this import +// Starting from 12.0 trace is now located in 'next/dist/trace/trace' export async function getRunWebpackSpan (): Promise<{ runWebpackSpan?: Span }> { let trace: (name: string) => Span try { - trace = await import('next/dist/telemetry/trace/trace').then((m) => m.trace) + try { + trace = await import('next/dist/telemetry/trace/trace').then((m) => m.trace) - return { runWebpackSpan: trace('cypress') } + return { runWebpackSpan: trace('cypress') } + } catch (_) { + // @ts-ignore + trace = await import('next/dist/trace/trace').then((m) => m.trace) + + return { runWebpackSpan: trace('cypress') } + } } catch (_) { return {} } diff --git a/npm/vite-dev-server/CHANGELOG.md b/npm/vite-dev-server/CHANGELOG.md index e93fbc66cc52..d620302873cd 100644 --- a/npm/vite-dev-server/CHANGELOG.md +++ b/npm/vite-dev-server/CHANGELOG.md @@ -1,3 +1,10 @@ +# [@cypress/vite-dev-server-v2.2.0](https://github.com/cypress-io/cypress/compare/@cypress/vite-dev-server-v2.1.1...@cypress/vite-dev-server-v2.2.0) (2021-10-15) + + +### Features + +* normalized signatures webpack & vite servers ([#18379](https://github.com/cypress-io/cypress/issues/18379)) ([8f5308f](https://github.com/cypress-io/cypress/commit/8f5308f7068b80fb877da539ce34fb67ba497c4f)) + # [@cypress/vite-dev-server-v2.1.1](https://github.com/cypress-io/cypress/compare/@cypress/vite-dev-server-v2.1.0...@cypress/vite-dev-server-v2.1.1) (2021-10-04) diff --git a/npm/vue/CHANGELOG.md b/npm/vue/CHANGELOG.md index 5bfa81a08a55..dd9b8dd160cb 100644 --- a/npm/vue/CHANGELOG.md +++ b/npm/vue/CHANGELOG.md @@ -1,3 +1,10 @@ +# [@cypress/vue-v3.0.4](https://github.com/cypress-io/cypress/compare/@cypress/vue-v3.0.3...@cypress/vue-v3.0.4) (2021-10-29) + + +### Bug Fixes + +* remove outdated registry link ([#18710](https://github.com/cypress-io/cypress/issues/18710)) ([e2a869d](https://github.com/cypress-io/cypress/commit/e2a869d2a984abb6703aec966dd9124ee693b8c1)) + # [@cypress/vue-v3.0.3](https://github.com/cypress-io/cypress/compare/@cypress/vue-v3.0.2...@cypress/vue-v3.0.3) (2021-07-31) diff --git a/npm/vue/package.json b/npm/vue/package.json index c97340958290..e609046a4664 100644 --- a/npm/vue/package.json +++ b/npm/vue/package.json @@ -103,7 +103,6 @@ } }, "publishConfig": { - "access": "public", - "registry": "http://registry.npmjs.org/" + "access": "public" } } diff --git a/npm/webpack-dev-server/CHANGELOG.md b/npm/webpack-dev-server/CHANGELOG.md index 93c0f5fe19ab..3e53a7f9c5ca 100644 --- a/npm/webpack-dev-server/CHANGELOG.md +++ b/npm/webpack-dev-server/CHANGELOG.md @@ -1,3 +1,10 @@ +# [@cypress/webpack-dev-server-v1.7.0](https://github.com/cypress-io/cypress/compare/@cypress/webpack-dev-server-v1.6.0...@cypress/webpack-dev-server-v1.7.0) (2021-10-15) + + +### Features + +* normalized signatures webpack & vite servers ([#18379](https://github.com/cypress-io/cypress/issues/18379)) ([8f5308f](https://github.com/cypress-io/cypress/commit/8f5308f7068b80fb877da539ce34fb67ba497c4f)) + # [@cypress/webpack-dev-server-v1.6.0](https://github.com/cypress-io/cypress/compare/@cypress/webpack-dev-server-v1.5.0...@cypress/webpack-dev-server-v1.6.0) (2021-09-10) diff --git a/package.json b/package.json index 2c1effed7791..6d2549a9af10 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cypress", - "version": "8.6.0", + "version": "8.7.0", "description": "Cypress.io end to end testing tool", "private": true, "scripts": { @@ -114,7 +114,6 @@ "@types/mocha": "8.0.3", "@types/node": "14.14.31", "@types/prismjs": "1.16.0", - "@types/ramda": "0.25.47", "@types/react": "16.9.50", "@types/react-dom": "16.9.8", "@types/request-promise": "4.1.45", @@ -205,7 +204,6 @@ "pretty-ms": "7.0.0", "print-arch": "1.0.0", "proxyquire": "2.1.3", - "ramda": "0.27.1", "semantic-release": "17.2.3", "semantic-release-monorepo": "7.0.3", "semver": "7.3.2", diff --git a/packages/driver/cypress/fixtures/sticky-header.html b/packages/driver/cypress/fixtures/sticky-header.html new file mode 100644 index 000000000000..63f891a7ee39 --- /dev/null +++ b/packages/driver/cypress/fixtures/sticky-header.html @@ -0,0 +1,17 @@ + + + +
+
+ +
+

content to scroll to

+ + +
+
+
+ + \ No newline at end of file diff --git a/packages/driver/cypress/integration/commands/actions/check_spec.js b/packages/driver/cypress/integration/commands/actions/check_spec.js index 3b236e383228..a60c9cd10957 100644 --- a/packages/driver/cypress/integration/commands/actions/check_spec.js +++ b/packages/driver/cypress/integration/commands/actions/check_spec.js @@ -204,6 +204,42 @@ describe('src/cy/commands/actions/check', () => { }) }) + it('can specify scrollBehavior bottom in config', { scrollBehavior: 'bottom' }, () => { + cy.get(':checkbox:first').then((el) => { + cy.spy(el[0], 'scrollIntoView') + }) + + cy.get(':checkbox:first').check() + + cy.get(':checkbox:first').then((el) => { + expect(el[0].scrollIntoView).to.be.calledWith({ block: 'end' }) + }) + }) + + it('can specify scrollBehavior center in config', { scrollBehavior: 'center' }, () => { + cy.get(':checkbox:first').then((el) => { + cy.spy(el[0], 'scrollIntoView') + }) + + cy.get(':checkbox:first').check() + + cy.get(':checkbox:first').then((el) => { + expect(el[0].scrollIntoView).to.be.calledWith({ block: 'center' }) + }) + }) + + it('can specify scrollBehavior nearest in config', { scrollBehavior: 'nearest' }, () => { + cy.get(':checkbox:first').then((el) => { + cy.spy(el[0], 'scrollIntoView') + }) + + cy.get(':checkbox:first').check() + + cy.get(':checkbox:first').then((el) => { + expect(el[0].scrollIntoView).to.be.calledWith({ block: 'nearest' }) + }) + }) + it('does not scroll when scrollBehavior is false in config', { scrollBehavior: false }, () => { cy.get(':checkbox:first').scrollIntoView() cy.get(':checkbox:first').then((el) => { @@ -230,6 +266,13 @@ describe('src/cy/commands/actions/check', () => { }) }) + // https://github.com/cypress-io/cypress/issues/4233 + it('can check an element behind a sticky header', () => { + cy.viewport(400, 400) + cy.visit('./fixtures/sticky-header.html') + cy.get(':checkbox:first').check() + }) + it('waits until element is no longer disabled', () => { const chk = $(':checkbox:first').prop('disabled', true) diff --git a/packages/driver/cypress/integration/commands/actions/clear_spec.js b/packages/driver/cypress/integration/commands/actions/clear_spec.js index 145d135d9cb4..5dfab1bb74ae 100644 --- a/packages/driver/cypress/integration/commands/actions/clear_spec.js +++ b/packages/driver/cypress/integration/commands/actions/clear_spec.js @@ -124,6 +124,13 @@ describe('src/cy/commands/actions/type - #clear', () => { }) }) + // https://github.com/cypress-io/cypress/issues/4233 + it('can scroll to an element behind a sticky header', () => { + cy.viewport(400, 400) + cy.visit('./fixtures/sticky-header.html') + cy.get('input:first').clear() + }) + // https://github.com/cypress-io/cypress/issues/5835 it('can force clear when hidden in input', () => { const input = cy.$$('input:first') diff --git a/packages/driver/cypress/integration/commands/actions/click_spec.js b/packages/driver/cypress/integration/commands/actions/click_spec.js index 7e0b0cacf535..e8e0bc7b54f3 100644 --- a/packages/driver/cypress/integration/commands/actions/click_spec.js +++ b/packages/driver/cypress/integration/commands/actions/click_spec.js @@ -1090,6 +1090,13 @@ describe('src/cy/commands/actions/click', () => { cy.get('#overflow-auto-container').contains('quux').click() }) + // https://github.com/cypress-io/cypress/issues/4233 + it('can click an element behind a sticky header', () => { + cy.viewport(400, 400) + cy.visit('./fixtures/sticky-header.html') + cy.get('p').click() + }) + it('does not scroll when being forced', () => { const scrolled = [] @@ -1224,6 +1231,42 @@ describe('src/cy/commands/actions/click', () => { }) }) + it('can specify scrollBehavior bottom in config', { scrollBehavior: 'bottom' }, () => { + cy.get('input:first').then((el) => { + cy.spy(el[0], 'scrollIntoView') + }) + + cy.get('input:first').click() + + cy.get('input:first').then((el) => { + expect(el[0].scrollIntoView).calledWith({ block: 'end' }) + }) + }) + + it('can specify scrollBehavior center in config', { scrollBehavior: 'center' }, () => { + cy.get('input:first').then((el) => { + cy.spy(el[0], 'scrollIntoView') + }) + + cy.get('input:first').click() + + cy.get('input:first').then((el) => { + expect(el[0].scrollIntoView).calledWith({ block: 'center' }) + }) + }) + + it('can specify scrollBehavior nearest in config', { scrollBehavior: 'nearest' }, () => { + cy.get('input:first').then((el) => { + cy.spy(el[0], 'scrollIntoView') + }) + + cy.get('input:first').click() + + cy.get('input:first').then((el) => { + expect(el[0].scrollIntoView).calledWith({ block: 'nearest' }) + }) + }) + it('does not scroll when scrollBehavior is false in config', { scrollBehavior: false }, () => { cy.get('input:first').then((el) => { cy.spy(el[0], 'scrollIntoView') @@ -2155,7 +2198,8 @@ describe('src/cy/commands/actions/click', () => { cy.on('fail', (err) => { expect(this.logs.length).eq(2) expect(err.message).not.to.contain('CSS property: `opacity: 0`') - expect(err.message).to.contain('`cy.click()` failed because this element is not visible') + expect(err.message).to.contain('`cy.click()` failed because this element') + expect(err.message).to.contain('is being covered by another element') done() }) @@ -2282,17 +2326,10 @@ describe('src/cy/commands/actions/click', () => { expect(lastLog.get('snapshots')[0].name).to.eq('before') expect(lastLog.get('snapshots')[1]).to.be.an('object') expect(lastLog.get('snapshots')[1].name).to.eq('after') - expect(err.message).to.include('`cy.click()` failed because this element is not visible:') - expect(err.message).to.include('>button ...') - expect(err.message).to.include('`` is not visible because it has CSS property: `position: fixed` and it\'s being covered') - expect(err.message).to.include('>span on...') + expect(err.message).to.include('`cy.click()` failed because this element:') + expect(err.message).to.include('is being covered by another element:') expect(err.docsUrl).to.eq('https://on.cypress.io/element-cannot-be-interacted-with') - const console = lastLog.invoke('consoleProps') - - expect(console['Tried to Click']).to.be.undefined - expect(console['But its Covered By']).to.be.undefined - done() }) diff --git a/packages/driver/cypress/integration/commands/actions/trigger_spec.js b/packages/driver/cypress/integration/commands/actions/trigger_spec.js index 7bda43e1a03a..98e483876923 100644 --- a/packages/driver/cypress/integration/commands/actions/trigger_spec.js +++ b/packages/driver/cypress/integration/commands/actions/trigger_spec.js @@ -654,6 +654,42 @@ describe('src/cy/commands/actions/trigger', () => { }) }) + it('can specify scrollBehavior bottom in config', { scrollBehavior: 'bottom' }, () => { + cy.get('button:first').then((el) => { + cy.spy(el[0], 'scrollIntoView') + }) + + cy.get('button:first').trigger('mouseover') + + cy.get('button:first').then((el) => { + expect(el[0].scrollIntoView).to.be.calledWith({ block: 'end' }) + }) + }) + + it('can specify scrollBehavior center in config', { scrollBehavior: 'center' }, () => { + cy.get('button:first').then((el) => { + cy.spy(el[0], 'scrollIntoView') + }) + + cy.get('button:first').trigger('mouseover') + + cy.get('button:first').then((el) => { + expect(el[0].scrollIntoView).to.be.calledWith({ block: 'center' }) + }) + }) + + it('can specify scrollBehavior nearest in config', { scrollBehavior: 'nearest' }, () => { + cy.get('button:first').then((el) => { + cy.spy(el[0], 'scrollIntoView') + }) + + cy.get('button:first').trigger('mouseover') + + cy.get('button:first').then((el) => { + expect(el[0].scrollIntoView).to.be.calledWith({ block: 'nearest' }) + }) + }) + it('does not scroll when scrollBehavior is false in config', { scrollBehavior: false }, () => { cy.scrollTo('top') cy.get('button:first').then((el) => { @@ -680,6 +716,13 @@ describe('src/cy/commands/actions/trigger', () => { }) }) + // https://github.com/cypress-io/cypress/issues/4233 + it('can check an element behind a sticky header', () => { + cy.viewport(400, 400) + cy.visit('./fixtures/sticky-header.html') + cy.get('p').trigger('mouseover') + }) + it('errors when scrollBehavior is false and element is out of view and is clicked', (done) => { cy.scrollTo('top') @@ -1046,7 +1089,8 @@ describe('src/cy/commands/actions/trigger', () => { cy.on('fail', (err) => { expect(this.logs.length).eq(2) expect(err.message).not.to.contain('CSS property: `opacity: 0`') - expect(err.message).to.contain('`cy.trigger()` failed because this element is not visible') + expect(err.message).to.contain('`cy.trigger()` failed because this element') + expect(err.message).to.contain('is being covered by another element') done() }) diff --git a/packages/driver/cypress/integration/commands/actions/type_spec.js b/packages/driver/cypress/integration/commands/actions/type_spec.js index 9d338c27eabd..99a2cacbd6e3 100644 --- a/packages/driver/cypress/integration/commands/actions/type_spec.js +++ b/packages/driver/cypress/integration/commands/actions/type_spec.js @@ -408,6 +408,42 @@ describe('src/cy/commands/actions/type - #type', () => { }) }) + it('can specify scrollBehavior bottom in config', { scrollBehavior: 'bottom' }, () => { + cy.get(':text:first').then((el) => { + cy.spy(el[0], 'scrollIntoView') + }) + + cy.get(':text:first').type('foo') + + cy.get(':text:first').then((el) => { + expect(el[0].scrollIntoView).to.be.calledWith({ block: 'end' }) + }) + }) + + it('can specify scrollBehavior center in config', { scrollBehavior: 'center' }, () => { + cy.get(':text:first').then((el) => { + cy.spy(el[0], 'scrollIntoView') + }) + + cy.get(':text:first').type('foo') + + cy.get(':text:first').then((el) => { + expect(el[0].scrollIntoView).to.be.calledWith({ block: 'center' }) + }) + }) + + it('can specify scrollBehavior nearest in config', { scrollBehavior: 'nearest' }, () => { + cy.get(':text:first').then((el) => { + cy.spy(el[0], 'scrollIntoView') + }) + + cy.get(':text:first').type('foo') + + cy.get(':text:first').then((el) => { + expect(el[0].scrollIntoView).to.be.calledWith({ block: 'nearest' }) + }) + }) + it('does not scroll when scrollBehavior is false in config', { scrollBehavior: false }, () => { cy.get(':text:first').then((el) => { cy.spy(el[0], 'scrollIntoView') @@ -432,6 +468,13 @@ describe('src/cy/commands/actions/type - #type', () => { }) }) + // https://github.com/cypress-io/cypress/issues/4233 + it('can scroll to an element behind a sticky header', () => { + cy.viewport(400, 400) + cy.visit('./fixtures/sticky-header.html') + cy.get('input:first').type('foo') + }) + it('errors when scrollBehavior is false and element is out of view and is clicked', (done) => { cy.on('fail', (err) => { expect(err.message).to.include('`cy.type()` failed because the center of this element is hidden from view') diff --git a/packages/driver/cypress/integration/commands/files_spec.js b/packages/driver/cypress/integration/commands/files_spec.js index 104558a88da5..0267f707dc19 100644 --- a/packages/driver/cypress/integration/commands/files_spec.js +++ b/packages/driver/cypress/integration/commands/files_spec.js @@ -37,6 +37,22 @@ describe('src/cy/commands/files', () => { }) }) + // https://github.com/cypress-io/cypress/issues/1558 + it('passes explicit null encoding through to server and decodes response', () => { + Cypress.backend.resolves({ + contents: Buffer.from('\n'), + filePath: '/path/to/foo.json', + }) + + cy.readFile('foo.json', null).then(() => { + expect(Cypress.backend).to.be.calledWith( + 'read:file', + 'foo.json', + { encoding: null }, + ) + }).should('eql', Buffer.from('\n')) + }) + it('sets the contents as the subject', () => { Cypress.backend.resolves(okResponse) @@ -340,6 +356,23 @@ describe('src/cy/commands/files', () => { }) }) + // https://github.com/cypress-io/cypress/issues/1558 + it('explicit null encoding is sent to server as Buffer', () => { + Cypress.backend.resolves(okResponse) + + cy.writeFile('foo.txt', Buffer.from([0, 0, 54, 255]), null).then(() => { + expect(Cypress.backend).to.be.calledWith( + 'write:file', + 'foo.txt', + Buffer.from([0, 0, 54, 255]), + { + encoding: null, + flag: 'w', + }, + ) + }) + }) + it('can take encoding as part of options', () => { Cypress.backend.resolves(okResponse) diff --git a/packages/driver/cypress/integration/commands/fixtures_spec.js b/packages/driver/cypress/integration/commands/fixtures_spec.js index 254afb7879b9..9f084878f7ef 100644 --- a/packages/driver/cypress/integration/commands/fixtures_spec.js +++ b/packages/driver/cypress/integration/commands/fixtures_spec.js @@ -35,6 +35,17 @@ describe('src/cy/commands/fixtures', () => { }) }) + // https://github.com/cypress-io/cypress/issues/1558 + it('passes explicit null encoding through to server and decodes response', () => { + Cypress.backend.withArgs('get:fixture').resolves(Buffer.from('\n')) + + cy.fixture('foo', null).then((obj) => { + expect(Cypress.backend).to.be.calledWith('get:fixture', 'foo', { + encoding: null, + }) + }).should('eql', Buffer.from('\n')) + }) + it('can have encoding as second argument and options as third argument', () => { Cypress.backend.withArgs('get:fixture').resolves({ foo: 'bar' }) diff --git a/packages/driver/src/cy/actionability.ts b/packages/driver/src/cy/actionability.ts index ca0d16eb4eca..ee9b86d0396c 100644 --- a/packages/driver/src/cy/actionability.ts +++ b/packages/driver/src/cy/actionability.ts @@ -288,8 +288,9 @@ const ensureNotAnimating = function (cy, $el, coordsHistory, animationDistanceTh cy.ensureElementIsNotAnimating($el, coordsHistory, animationDistanceThreshold) } -const verify = function (cy, $el, options, callbacks) { +const verify = function (cy, $el, config, options, callbacks) { _.defaults(options, { + scrollBehavior: config('scrollBehavior'), ensure: { position: true, visibility: true, @@ -381,9 +382,11 @@ const verify = function (cy, $el, options, callbacks) { } } - // ensure its visible if (options.ensure.visibility) { - cy.ensureVisibility($el, _log) + // ensure element is visible but do not check if hidden by ancestors + // until nudging algorithm occurs + // https://whimsical.com/actionability-J38eY9K2Y3vA6uCMWtmLVA + cy.ensureStrictVisibility($el, _log) } if (options.ensure.notReadonly) { @@ -419,6 +422,7 @@ const verify = function (cy, $el, options, callbacks) { // this calculation is relative from the viewport so we // only care about fromElViewport coords $elAtCoords = options.ensure.notCovered && ensureElIsNotCovered(cy, win, $el, coords.fromElViewport, options, _log, onScroll) + cy.ensureNotHiddenByAncestors($el, _log) } // pass our final object into onReady diff --git a/packages/driver/src/cy/commands/actions/click.ts b/packages/driver/src/cy/commands/actions/click.ts index 07bf7cd25c22..796b50752cba 100644 --- a/packages/driver/src/cy/commands/actions/click.ts +++ b/packages/driver/src/cy/commands/actions/click.ts @@ -65,7 +65,6 @@ export default (Commands, Cypress, cy, state, config) => { errorOnSelect: true, waitForAnimations: config('waitForAnimations'), animationDistanceThreshold: config('animationDistanceThreshold'), - scrollBehavior: config('scrollBehavior'), ctrlKey: false, controlKey: false, altKey: false, @@ -183,13 +182,15 @@ export default (Commands, Cypress, cy, state, config) => { // properties like `total` and `_retries` are mutated by // $actionability.verify and retrying, but each click should // have its own full timeout - const individualOptions = { ... options } + const individualOptions = { + ...options, + } // must use callbacks here instead of .then() // because we're issuing the clicks synchronously // once we establish the coordinates and the element // passes all of the internal checks - return $actionability.verify(cy, $el, individualOptions, { + return $actionability.verify(cy, $el, config, individualOptions, { onScroll ($el, type) { return Cypress.action('cy:scrolled', $el, type) }, diff --git a/packages/driver/src/cy/commands/actions/trigger.ts b/packages/driver/src/cy/commands/actions/trigger.ts index e0bdf26aa2b6..5b6b448134f5 100644 --- a/packages/driver/src/cy/commands/actions/trigger.ts +++ b/packages/driver/src/cy/commands/actions/trigger.ts @@ -56,7 +56,6 @@ export default (Commands, Cypress, cy, state, config) => { y, waitForAnimations: config('waitForAnimations'), animationDistanceThreshold: config('animationDistanceThreshold'), - scrollBehavior: config('scrollBehavior'), }) if ($dom.isWindow(options.$el)) { @@ -112,7 +111,7 @@ export default (Commands, Cypress, cy, state, config) => { return dispatch(subject, state('window'), eventName, eventOptions) } - return $actionability.verify(cy, subject, options, { + return $actionability.verify(cy, subject, config, options, { onScroll ($el, type) { Cypress.action('cy:scrolled', $el, type) }, diff --git a/packages/driver/src/cy/commands/actions/type.ts b/packages/driver/src/cy/commands/actions/type.ts index 53bac165685c..d6d18c9445de 100644 --- a/packages/driver/src/cy/commands/actions/type.ts +++ b/packages/driver/src/cy/commands/actions/type.ts @@ -31,7 +31,6 @@ export default function (Commands, Cypress, cy, state, config) { parseSpecialCharSequences: true, waitForAnimations: config('waitForAnimations'), animationDistanceThreshold: config('animationDistanceThreshold'), - scrollBehavior: config('scrollBehavior'), }) if (options.log) { @@ -415,7 +414,7 @@ export default function (Commands, Cypress, cy, state, config) { } } - return $actionability.verify(cy, options.$el, options, { + return $actionability.verify(cy, options.$el, config, options, { onScroll ($el, type) { return Cypress.action('cy:scrolled', $el, type) }, @@ -442,6 +441,7 @@ export default function (Commands, Cypress, cy, state, config) { timeout: options.timeout, interval: options.interval, errorOnSelect: false, + scrollBehavior: options.scrollBehavior, }) .then(() => { let activeElement = $elements.getActiveElByDocument($elToClick) @@ -502,7 +502,6 @@ export default function (Commands, Cypress, cy, state, config) { force: false, waitForAnimations: config('waitForAnimations'), animationDistanceThreshold: config('animationDistanceThreshold'), - scrollBehavior: config('scrollBehavior'), }) // blow up if any member of the subject @@ -569,7 +568,7 @@ export default function (Commands, Cypress, cy, state, config) { notReadonly: true, } - return $actionability.verify(cy, $el, options, { + return $actionability.verify(cy, $el, config, options, { onScroll ($el, type) { return Cypress.action('cy:scrolled', $el, type) }, diff --git a/packages/driver/src/cy/commands/files.ts b/packages/driver/src/cy/commands/files.ts index a7d994b25a5f..276ccfa766d7 100644 --- a/packages/driver/src/cy/commands/files.ts +++ b/packages/driver/src/cy/commands/files.ts @@ -11,11 +11,16 @@ export default (Commands, Cypress, cy) => { if (_.isObject(encoding)) { userOptions = encoding - encoding = null + encoding = undefined } options = _.defaults({}, userOptions, { - encoding: encoding != null ? encoding : 'utf8', + // https://github.com/cypress-io/cypress/issues/1558 + // If no encoding is specified, then Cypress has historically defaulted + // to `utf8`, because of it's focus on text files. This is in contrast to + // NodeJs, which defaults to binary. We allow users to pass in `null` + // to restore the default node behavior. + encoding: encoding === undefined ? 'utf8' : encoding, log: true, }) @@ -53,6 +58,14 @@ export default (Commands, Cypress, cy) => { args: { cmd: 'readFile', action: 'read', file, filePath: err.filePath, error: err.message }, }) }).then(({ contents, filePath }) => { + // https://github.com/cypress-io/cypress/issues/1558 + // We invoke Buffer.from() in order to transform this from an ArrayBuffer - + // which socket.io uses to transfer the file over the websocket - into a + // `Buffer`, which webpack polyfills in the browser. + if (options.encoding === null) { + contents = Buffer.from(contents) + } + consoleProps['File Path'] = filePath consoleProps['Contents'] = contents @@ -85,11 +98,16 @@ export default (Commands, Cypress, cy) => { if (_.isObject(encoding)) { userOptions = encoding - encoding = null + encoding = undefined } options = _.defaults({}, userOptions, { - encoding: encoding ? encoding : 'utf8', + // https://github.com/cypress-io/cypress/issues/1558 + // If no encoding is specified, then Cypress has historically defaulted + // to `utf8`, because of it's focus on text files. This is in contrast to + // NodeJs, which defaults to binary. We allow users to pass in `null` + // to restore the default node behavior. + encoding: encoding === undefined ? 'utf8' : encoding, flag: userOptions.flag ? userOptions.flag : 'w', log: true, }) @@ -120,7 +138,7 @@ export default (Commands, Cypress, cy) => { }) } - if (_.isObject(contents)) { + if (_.isObject(contents) && !Buffer.isBuffer(contents)) { contents = JSON.stringify(contents, null, 2) } diff --git a/packages/driver/src/cy/commands/fixtures.ts b/packages/driver/src/cy/commands/fixtures.ts index bd6d6700058e..8af57b71fcb4 100644 --- a/packages/driver/src/cy/commands/fixtures.ts +++ b/packages/driver/src/cy/commands/fixtures.ts @@ -6,6 +6,10 @@ import Promise from 'bluebird' import $errUtils from '../../cypress/error_utils' const clone = (obj) => { + if (Buffer.isBuffer(obj)) { + return Buffer.from(obj) + } + return JSON.parse(JSON.stringify(obj)) } @@ -47,7 +51,7 @@ export default (Commands, Cypress, cy, state, config) => { options = args[1] } - if (_.isString(args[0])) { + if (_.isString(args[0]) || args[0] === null) { options.encoding = args[0] } @@ -64,6 +68,18 @@ export default (Commands, Cypress, cy, state, config) => { return $errUtils.throwErr(response.__error) } + // https://github.com/cypress-io/cypress/issues/1558 + // We invoke Buffer.from() in order to transform this from an ArrayBuffer - + // which socket.io uses to transfer the file over the websocket - into a + // `Buffer`, which webpack polyfills in the browser. + if (options.encoding === null) { + response = Buffer.from(response) + } else if (response instanceof ArrayBuffer) { + // Cypress' behavior is to base64 encode binary files if the user + // doesn't explicitly pass `null` as the encoding. + response = Buffer.from(response).toString('base64') + } + // add the fixture to the cache // so it can just be returned next time cache[fixture] = response diff --git a/packages/driver/src/cy/commands/xhr.ts b/packages/driver/src/cy/commands/xhr.ts index 29cf190c4f00..a7e34226b338 100644 --- a/packages/driver/src/cy/commands/xhr.ts +++ b/packages/driver/src/cy/commands/xhr.ts @@ -5,7 +5,7 @@ import Promise from 'bluebird' import $utils from '../../cypress/utils' import $errUtils from '../../cypress/error_utils' import $stackUtils from '../../cypress/stack_utils' -import $Server, { Server } from '../../cypress/server' +import { Server } from '../../cypress/server' import { $Location } from '../../cypress/location' let server: Server | null = null @@ -103,7 +103,7 @@ type XHRConsoleProps = { const startXhrServer = (cy, state, config) => { const logs = {} - server = $Server.create({ + server = new Server({ xhrUrl: config('xhrUrl'), stripOrigin, diff --git a/packages/driver/src/cy/ensures.ts b/packages/driver/src/cy/ensures.ts index 5af8d946c62a..e3976e11c4e6 100644 --- a/packages/driver/src/cy/ensures.ts +++ b/packages/driver/src/cy/ensures.ts @@ -158,9 +158,9 @@ export default { } } - const ensureVisibility = (subject, onFail) => { + const runVisibilityCheck = (subject, onFail, method) => { if (subject.length !== subject.filter(function () { - return !$dom.isHidden(this, 'isVisible()', { checkOpacity: false }) + return !method(this, 'isVisible()', { checkOpacity: false }) }).length) { const cmd = state('current').get('name') const reason = $dom.getReasonIsHidden(subject, { checkOpacity: false }) @@ -173,6 +173,18 @@ export default { } } + const ensureVisibility = (subject, onFail) => { + return runVisibilityCheck(subject, onFail, $dom.isHidden) + } + + const ensureStrictVisibility = (subject, onFail) => { + return runVisibilityCheck(subject, onFail, $dom.isStrictlyHidden) + } + + const ensureNotHiddenByAncestors = (subject, onFail) => { + return runVisibilityCheck(subject, onFail, $dom.isHiddenByAncestors) + } + const ensureAttached = (subject, name, onFail) => { if ($dom.isDetached(subject)) { const current = state('current') @@ -399,6 +411,10 @@ export default { ensureVisibility, + ensureStrictVisibility, + + ensureNotHiddenByAncestors, + ensureExistence, ensureElExistence, diff --git a/packages/driver/src/cypress/cy.ts b/packages/driver/src/cypress/cy.ts index b25f9d20420e..0a43e12e3fab 100644 --- a/packages/driver/src/cypress/cy.ts +++ b/packages/driver/src/cypress/cy.ts @@ -619,6 +619,8 @@ export default { ensureElExistence: ensures.ensureElExistence, ensureElDoesNotHaveCSS: ensures.ensureElDoesNotHaveCSS, ensureVisibility: ensures.ensureVisibility, + ensureStrictVisibility: ensures.ensureStrictVisibility, + ensureNotHiddenByAncestors: ensures.ensureNotHiddenByAncestors, ensureDescendents: ensures.ensureDescendents, ensureNotReadonly: ensures.ensureNotReadonly, ensureNotDisabled: ensures.ensureNotDisabled, diff --git a/packages/driver/src/cypress/mocha.ts b/packages/driver/src/cypress/mocha.ts index ad43cd564193..ed713cd0f9f7 100644 --- a/packages/driver/src/cypress/mocha.ts +++ b/packages/driver/src/cypress/mocha.ts @@ -500,6 +500,8 @@ const create = (specWindow, Cypress, config) => { const _mocha = createMocha(specWindow) + _mocha.slow(config('slowTestThreshold')) + const _runner = getRunner(_mocha) _mocha.suite.file = Cypress.spec.relative diff --git a/packages/driver/src/cypress/runner.ts b/packages/driver/src/cypress/runner.ts index 9fc0ce178b6f..97ee42be0692 100644 --- a/packages/driver/src/cypress/runner.ts +++ b/packages/driver/src/cypress/runner.ts @@ -21,7 +21,7 @@ const TEST_BEFORE_RUN_EVENT = 'runner:test:before:run' const TEST_AFTER_RUN_EVENT = 'runner:test:after:run' const RUNNABLE_LOGS = 'routes agents commands hooks'.split(' ') -const RUNNABLE_PROPS = '_testConfig id order title _titlePath root hookName hookId err state failedFromHookId body speed type duration wallClockStartedAt wallClockDuration timings file originalTitle invocationDetails final currentRetry retries'.split(' ') +const RUNNABLE_PROPS = '_testConfig id order title _titlePath root hookName hookId err state failedFromHookId body speed type duration wallClockStartedAt wallClockDuration timings file originalTitle invocationDetails final currentRetry retries _slow'.split(' ') const debug = debugFn('cypress:driver:runner') const debugErrors = debugFn('cypress:driver:errors') @@ -581,6 +581,10 @@ const normalize = (runnable, tests, initialTests, onRunnable, onLogsById, getRun wrappedRunnable._testConfig = cfg } + if (cfg.slowTestThreshold) { + runnable.slow(cfg.slowTestThreshold) + } + wrappedRunnable._titlePath = runnable.titlePath() } diff --git a/packages/driver/src/cypress/server.ts b/packages/driver/src/cypress/server.ts index ffdd6908c7be..16ed777a71a0 100644 --- a/packages/driver/src/cypress/server.ts +++ b/packages/driver/src/cypress/server.ts @@ -1,5 +1,3 @@ -// @ts-nocheck - import _ from 'lodash' import capitalize from 'underscore.string/capitalize' import minimatch from 'minimatch' @@ -12,56 +10,6 @@ const regularResourcesRe = /\.(jsx?|coffee|html|less|s?css|svg)(\?.*)?$/ const needsDashRe = /([a-z][A-Z])/g const props = 'onreadystatechange onload onerror'.split(' ') -let restoreFn = null - -const setHeader = (xhr, key, val, transformer) => { - if (val != null) { - if (transformer) { - val = transformer(val) - } - - key = `X-Cypress-${capitalize(key)}` - - return xhr.setRequestHeader(key, encodeURI(val)) - } -} - -const normalize = (val) => { - val = val.replace(needsDashRe, (match) => { - return `${match[0]}-${match[1]}` - }) - - return val.toLowerCase() -} - -const nope = () => { - return null -} - -const responseTypeIsTextOrEmptyString = (responseType) => { - return responseType === '' || responseType === 'text' -} - -// when the browser naturally cancels/aborts -// an XHR because the window is unloading -// on chrome < 71 -const isAbortedThroughUnload = (xhr) => { - return xhr.canceled !== true && - xhr.readyState === 4 && - xhr.status === 0 && - // responseText may be undefined on some responseTypes - // https://github.com/cypress-io/cypress/issues/3008 - // TODO: How do we want to handle other responseTypes? - responseTypeIsTextOrEmptyString(xhr.responseType) && - xhr.responseText === '' -} - -const warnOnWhitelistRenamed = (obj, type) => { - if (obj.whitelist) { - return $errUtils.throwErrByPath('server.whitelist_renamed', { args: { type } }) - } -} - const ignore = (xhr) => { const url = new URL(xhr.url) @@ -103,576 +51,601 @@ const serverDefaults = { onNetworkError () {}, } -const restore = () => { - if (restoreFn) { - restoreFn() - - restoreFn = null - } +// override the defaults for all servers +export const defaults = (obj = {}) => { + // merge obj into defaults + return _.extend(serverDefaults, obj) } -const getStack = () => { - const err = new Error +export class Server { + options: any - return err.stack.split('\n').slice(3).join('\n') -} + private xhrs: Record = {} + private proxies: Record = {} + private routes: Array = [] + private hasEnabledStubs = false + private restoreFn: (() => void) | null = null -const get404Route = () => { - return { - status: 404, - response: '', - delay: 0, - headers: null, - is404: true, + private enableStubs (bool = true) { + return this.hasEnabledStubs = bool } -} -const transformHeaders = (headers) => { - // normalize camel-cased headers key - headers = _.reduce(headers, (memo, value, key) => { - memo[normalize(key)] = value - - return memo - }, {}) + private setHeader (xhr, key, val, transformer?) { + if (val != null) { + if (transformer) { + val = transformer(val) + } - return JSON.stringify(headers) -} + key = `X-Cypress-${capitalize(key)}` -const normalizeStubUrl = (xhrUrl, url) => { - if (!xhrUrl) { - $errUtils.warnByPath('server.xhrurl_not_set') + return xhr.setRequestHeader(key, encodeURI(val)) + } } - // always ensure this is an absolute-relative url - // and remove any double slashes - xhrUrl = _.compact(xhrUrl.split('/')).join('/') - url = _.trimStart(url, '/') + private normalize (val) { + val = val.replace(needsDashRe, (match) => { + return `${match[0]}-${match[1]}` + }) - return [`/${xhrUrl}`, url].join('/') -} + return val.toLowerCase() + } -const getFullyQualifiedUrl = (contentWindow, url) => { - // the href getter will always resolve a full path - const a = contentWindow.document.createElement('a') + private responseTypeIsTextOrEmptyString (responseType) { + return responseType === '' || responseType === 'text' + } - a.href = url + // when the browser naturally cancels/aborts + // an XHR because the window is unloading + // on chrome < 71 + private isAbortedThroughUnload (xhr) { + return xhr.canceled !== true && + xhr.readyState === 4 && + xhr.status === 0 && + // responseText may be undefined on some responseTypes + // https://github.com/cypress-io/cypress/issues/3008 + // TODO: How do we want to handle other responseTypes? + this.responseTypeIsTextOrEmptyString(xhr.responseType) && + xhr.responseText === '' + } - return a.href -} + constructor (options: any = {}) { + this.options = _.defaults(options, serverDefaults) -// override the defaults for all servers -const defaults = (obj = {}) => { - // merge obj into defaults - return _.extend(serverDefaults, obj) -} + // The function below is used as a callback for lodash to cancel any pending xhrs + this.cancelXhr = this.cancelXhr.bind(this) + } -// TODO: Convert it to a class. -// It's written in this way to bypass type failures. -export type Server = { - restore: () => void - cancelPendingXhrs: () => any[] - bindTo: (win: Window) => void -} + restore () { + if (this.restoreFn) { + this.restoreFn() -const create = (options = {}): Server => { - options = _.defaults(options, serverDefaults) + this.restoreFn = null + } + } - const xhrs = {} - const proxies = {} - const routes = [] + getStack () { + const err = new Error - // always start disabled - // so we dont handle stubs - let hasEnabledStubs = false + return err.stack!.split('\n').slice(3).join('\n') + } - const enableStubs = (bool = true) => { - return hasEnabledStubs = bool + get404Route () { + return { + status: 404, + response: '', + delay: 0, + headers: null, + is404: true, + } } - const server = { - options, + transformHeaders (headers) { + // normalize camel-cased headers key + headers = _.reduce(headers, (memo, value, key) => { + memo[this.normalize(key)] = value - restore, + return memo + }, {}) - getStack, + return JSON.stringify(headers) + } - get404Route, + normalizeStubUrl (xhrUrl, url) { + if (!xhrUrl) { + $errUtils.warnByPath('server.xhrurl_not_set') + } - transformHeaders, + // always ensure this is an absolute-relative url + // and remove any double slashes + xhrUrl = _.compact(xhrUrl.split('/')).join('/') + url = _.trimStart(url, '/') - normalizeStubUrl, + return [`/${xhrUrl}`, url].join('/') + } - getFullyQualifiedUrl, + getFullyQualifiedUrl (contentWindow, url) { + // the href getter will always resolve a full path + const a = contentWindow.document.createElement('a') - getOptions () { - // clone the options to prevent - // accidental mutations - return _.clone(options) - }, + a.href = url - getRoutes () { - return routes - }, + return a.href + } - isIgnored (xhr) { - return options.ignore(xhr) - }, + getOptions () { + // clone the options to prevent + // accidental mutations + return _.clone(this.options) + } - shouldApplyStub (route) { - return hasEnabledStubs && route && (route.response != null) - }, + getRoutes () { + return this.routes + } - applyStubProperties (xhr, route) { - const responser = _.isObject(route.response) ? JSON.stringify : null + isIgnored (xhr) { + return this.options.ignore(xhr) + } - // add header properties for the xhr's id - // and the testId - setHeader(xhr, 'id', xhr.id) - // setHeader(xhr, "testId", options.testId) + shouldApplyStub (route) { + return this.hasEnabledStubs && route && (route.response != null) + } - setHeader(xhr, 'status', route.status) - setHeader(xhr, 'response', route.response, responser) - setHeader(xhr, 'matched', `${route.url}`) - setHeader(xhr, 'delay', route.delay) + applyStubProperties (xhr, route) { + const responser = _.isObject(route.response) ? JSON.stringify : null - return setHeader(xhr, 'headers', route.headers, transformHeaders) - }, + // add header properties for the xhr's id + this.setHeader(xhr, 'id', xhr.id) - route (attrs = {}) { - // merge attrs with the server's defaults - // so we preserve the state of the attrs - // at the time they're created since we - // can create another server later + this.setHeader(xhr, 'status', route.status) + this.setHeader(xhr, 'response', route.response, responser) + this.setHeader(xhr, 'matched', `${route.url}`) + this.setHeader(xhr, 'delay', route.delay) - // dont mutate the original attrs - const route = _.defaults( - {}, - attrs, - _.pick(options, 'delay', 'method', 'status', 'autoRespond', 'waitOnResponses', 'onRequest', 'onResponse'), - ) + return this.setHeader(xhr, 'headers', route.headers, this.transformHeaders) + } - routes.push(route) + route (attrs = {}) { + // merge attrs with the server's defaults + // so we preserve the state of the attrs + // at the time they're created since we + // can create another server later - return route - }, + // dont mutate the original attrs + const route = _.defaults( + {}, + attrs, + _.pick(this.options, 'delay', 'method', 'status', 'autoRespond', 'waitOnResponses', 'onRequest', 'onResponse'), + ) - getRouteForXhr (xhr) { - // return the 404 stub if we dont have any stubs - // but we are stubbed - meaning we havent added any routes - // but have started the server - // and this request shouldnt be allowed - if (!routes.length && hasEnabledStubs && - options.force404 !== false && !server.isIgnored(xhr)) { - return get404Route() - } + this.routes.push(route) - // bail if we've attached no stubs - if (!routes.length) { - return nope() - } + return route + } - // bail if this xhr matches our ignore list - if (server.isIgnored(xhr)) { - return nope() - } + getRouteForXhr (xhr) { + // return the 404 stub if we dont have any stubs + // but we are stubbed - meaning we havent added any routes + // but have started the server + // and this request shouldnt be allowed + if (!this.routes.length && this.hasEnabledStubs && + this.options.force404 !== false && !this.isIgnored(xhr)) { + return this.get404Route() + } - // loop in reverse to get - // the first matching stub - // thats been most recently added - for (let i = routes.length - 1; i >= 0; i--) { - const route = routes[i] + // bail if we've attached no stubs + if (!this.routes.length) { + return null + } - if (server.xhrMatchesRoute(xhr, route)) { - return route - } - } + // bail if this xhr matches our ignore list + if (this.isIgnored(xhr)) { + return null + } + + // loop in reverse to get + // the first matching stub + // thats been most recently added + for (let i = this.routes.length - 1; i >= 0; i--) { + const route = this.routes[i] - // else if no stub matched - // send 404 if we're allowed to - if (options.force404) { - return get404Route() + if (this.xhrMatchesRoute(xhr, route)) { + return route } + } - // else return null - return nope() - }, - - methodsMatch (routeMethod, xhrMethod) { - // normalize both methods by uppercasing them - return routeMethod.toUpperCase() === xhrMethod.toUpperCase() - }, - - urlsMatch (routePattern, fullyQualifiedUrl) { - const match = (str, pattern) => { - // be nice to our users and prepend - // pattern with "/" if it doesnt have one - // and str does - if (pattern[0] !== '/' && str[0] === '/') { - pattern = `/${pattern}` - } + // else if no stub matched + // send 404 if we're allowed to + if (this.options.force404) { + return this.get404Route() + } - return minimatch(str, pattern, options.urlMatchingOptions) - } + // else return null + return null + } - const testRe = (url1, url2) => { - return routePattern.test(url1) || routePattern.test(url2) - } + methodsMatch (routeMethod, xhrMethod) { + // normalize both methods by uppercasing them + return routeMethod.toUpperCase() === xhrMethod.toUpperCase() + } - const testStr = (url1, url2) => { - return (routePattern === url1) || (routePattern === url2) || - match(url1, routePattern) || match(url2, routePattern) + urlsMatch (routePattern, fullyQualifiedUrl) { + const match = (str, pattern) => { + // be nice to our users and prepend + // pattern with "/" if it doesnt have one + // and str does + if (pattern[0] !== '/' && str[0] === '/') { + pattern = `/${pattern}` } - if (_.isRegExp(routePattern)) { - return testRe(fullyQualifiedUrl, options.stripOrigin(fullyQualifiedUrl)) - } + return minimatch(str, pattern, this.options.urlMatchingOptions) + } - return testStr(fullyQualifiedUrl, options.stripOrigin(fullyQualifiedUrl)) - }, + const testRe = (url1, url2) => { + return routePattern.test(url1) || routePattern.test(url2) + } - xhrMatchesRoute (xhr, route) { - return server.methodsMatch(route.method, xhr.method) && server.urlsMatch(route.url, xhr.url) - }, + const testStr = (url1, url2) => { + return (routePattern === url1) || (routePattern === url2) || + match(url1, routePattern) || match(url2, routePattern) + } - add (xhr, attrs = {}) { - const id = _.uniqueId('xhr') + if (_.isRegExp(routePattern)) { + return testRe(fullyQualifiedUrl, this.options.stripOrigin(fullyQualifiedUrl)) + } - _.extend(xhr, attrs) - xhr.id = id - xhrs[id] = xhr - proxies[id] = $XHR.create(xhr) + return testStr(fullyQualifiedUrl, this.options.stripOrigin(fullyQualifiedUrl)) + } - return proxies[id] - }, + xhrMatchesRoute (xhr, route) { + return this.methodsMatch(route.method, xhr.method) && this.urlsMatch(route.url, xhr.url) + } - getProxyFor (xhr) { - return proxies[xhr.id] - }, + add (xhr, attrs = {}) { + const id = _.uniqueId('xhr') - abortXhr (xhr) { - const proxy = server.getProxyFor(xhr) + _.extend(xhr, attrs) + xhr.id = id + this.xhrs[id] = xhr + this.proxies[id] = $XHR.create(xhr) - // if the XHR leaks into the next test - // after we've reset our internal server - // then this may be undefined - if (!proxy) { - return - } + return this.proxies[id] + } - // return if we're already aborted which - // can happen if the browser already canceled - // this xhr but we called abort later - if (xhr.aborted) { - return - } + getProxyFor (xhr) { + return this.proxies[xhr.id] + } - xhr.aborted = true + abortXhr (xhr) { + const proxy = this.getProxyFor(xhr) - const abortStack = server.getStack() + // if the XHR leaks into the next test + // after we've reset our internal server + // then this may be undefined + if (!proxy) { + return + } - proxy.aborted = true + // return if we're already aborted which + // can happen if the browser already canceled + // this xhr but we called abort later + if (xhr.aborted) { + return + } - options.onXhrAbort(proxy, abortStack) + xhr.aborted = true - if (_.isFunction(options.onAnyAbort)) { - const route = server.getRouteForXhr(xhr) + const abortStack = this.getStack() - // call the onAnyAbort function - // after we've called options.onSend - return options.onAnyAbort(route, proxy) - } - }, + proxy.aborted = true - cancelXhr (xhr) { - const proxy = server.getProxyFor(xhr) + this.options.onXhrAbort(proxy, abortStack) - // if the XHR leaks into the next test - // after we've reset our internal server - // then this may be undefined - if (!proxy) { - return - } + if (_.isFunction(this.options.onAnyAbort)) { + const route = this.getRouteForXhr(xhr) - xhr.canceled = true + // call the onAnyAbort function + // after we've called options.onSend + return this.options.onAnyAbort(route, proxy) + } + } - proxy.canceled = true + cancelXhr (xhr) { + const proxy = this.getProxyFor(xhr) - options.onXhrCancel(proxy) + // if the XHR leaks into the next test + // after we've reset our internal server + // then this may be undefined + if (!proxy) { + return + } - return xhr - }, + xhr.canceled = true - cancelPendingXhrs () { - // cancel any outstanding xhr's - // which aren't already complete - // or already canceled - return _ - .chain(xhrs) - .reject({ readyState: 4 }) - .reject({ canceled: true }) - .map(server.cancelXhr) - .value() - }, + proxy.canceled = true - set (obj) { - warnOnWhitelistRenamed(obj, 'server') + this.options.onXhrCancel(proxy) - // handle enable=true|false - if (obj.enable != null) { - enableStubs(obj.enable) - } + return xhr + } - return _.extend(options, obj) - }, + cancelPendingXhrs () { + // cancel any outstanding xhr's + // which aren't already complete + // or already canceled + return _ + .chain(this.xhrs) + .reject({ readyState: 4 }) + .reject({ canceled: true }) + .map(this.cancelXhr) + .value() + } - bindTo (contentWindow) { - restore() + set (obj) { + // whitelist is deprecated. + if (obj.whitelist) { + return $errUtils.throwErrByPath('server.whitelist_renamed', { args: { type: 'server' } }) + } - const XHR = contentWindow.XMLHttpRequest - const { send, open, abort } = XHR.prototype - const srh = XHR.prototype.setRequestHeader + // handle enable=true|false + if (obj.enable != null) { + this.enableStubs(obj.enable) + } - const bridgeContentWindowListener = makeContentWindowListener('cypressXhrBridge', contentWindow) + return _.extend(this.options, obj) + } - restoreFn = () => { - // restore the property back on the window - return _.each( - { send, open, abort, setRequestHeader: srh }, - (value, key) => { - return XHR.prototype[key] = value - }, - ) - } + bindTo (contentWindow) { + this.restore() - XHR.prototype.setRequestHeader = function (...args) { - // if the XHR leaks into the next test - // after we've reset our internal server - // then this may be undefined - const proxy = server.getProxyFor(this) + const XHR = contentWindow.XMLHttpRequest + const { send, open, abort } = XHR.prototype + const srh = XHR.prototype.setRequestHeader - if (proxy) { - proxy._setRequestHeader.apply(proxy, args) - } + const bridgeContentWindowListener = makeContentWindowListener('cypressXhrBridge', contentWindow) - return srh.apply(this, args) - } + this.restoreFn = () => { + // restore the property back on the window + return _.each( + { send, open, abort, setRequestHeader: srh }, + (value, key) => { + return XHR.prototype[key] = value + }, + ) + } - XHR.prototype.abort = function (...args) { - // if we already have a readyState of 4 - // then do not get the abort stack or - // set the aborted property or call onXhrAbort - // to test this just use a regular XHR - if (this.readyState !== 4) { - server.abortXhr(this) - } + // we need this because of the non-arrow functions below. + const server = this - return abort.apply(this, args) - } + XHR.prototype.setRequestHeader = function (...args) { + // if the XHR leaks into the next test + // after we've reset our internal server + // then this may be undefined + const proxy = server.getProxyFor(this) - XHR.prototype.open = function (method, url, async = true, username, password) { - // get the fully qualified url that normally the browser - // would be sending this request to + if (proxy) { + proxy._setRequestHeader.apply(proxy, args) + } - // FQDN: http://www.google.com/responses/users.json - // relative: partials/phones-list.html - // absolute-relative: /app/partials/phones-list.html - const fullyQualifiedUrl = getFullyQualifiedUrl(contentWindow, url) + return srh.apply(this, args) + } - // decode the entire url.display to make - // it easier to do assertions - const proxy = server.add(this, { - method, - url: decodeURIComponent(fullyQualifiedUrl), - }) + XHR.prototype.abort = function (...args) { + // if we already have a readyState of 4 + // then do not get the abort stack or + // set the aborted property or call onXhrAbort + // to test this just use a regular XHR + if (this.readyState !== 4) { + server.abortXhr(this) + } - // if this XHR matches a stubbed route then shift - // its url to the stubbed url and set the request - // headers for the response - const route = server.getRouteForXhr(this) + return abort.apply(this, args) + } - if (server.shouldApplyStub(route)) { - url = server.normalizeStubUrl(options.xhrUrl, fullyQualifiedUrl) - } + XHR.prototype.open = function (method, url, async = true, username, password) { + // get the fully qualified url that normally the browser + // would be sending this request to + + // FQDN: http://www.google.com/responses/users.json + // relative: partials/phones-list.html + // absolute-relative: /app/partials/phones-list.html + const fullyQualifiedUrl = server.getFullyQualifiedUrl(contentWindow, url) + + // decode the entire url.display to make + // it easier to do assertions + const proxy = server.add(this, { + method, + url: decodeURIComponent(fullyQualifiedUrl), + }) + + // if this XHR matches a stubbed route then shift + // its url to the stubbed url and set the request + // headers for the response + const route = server.getRouteForXhr(this) + + if (server.shouldApplyStub(route)) { + url = server.normalizeStubUrl(server.options.xhrUrl, fullyQualifiedUrl) + } - const timeStart = new Date + const timeStart = new Date - const xhr = this - const fns = {} - const overrides = {} + const xhr = this + const fns: Record = {} + const overrides: Record = {} - const bailIfRecursive = (fn) => { - let isCalled = false + const bailIfRecursive = (fn) => { + let isCalled = false - return (...args) => { - if (isCalled) { - return - } + return (...args) => { + if (isCalled) { + return + } - isCalled = true - try { - return fn.apply(contentWindow, args) - } finally { - isCalled = false - } + isCalled = true + try { + return fn.apply(contentWindow, args) + } finally { + isCalled = false } } + } - const onLoadFn = function (...args) { - proxy._setDuration(timeStart) - proxy._setStatus() - proxy._setResponseHeaders() - proxy._setResponseBody() - - let err = proxy._getFixtureError() + const onLoadFn = function (...args) { + proxy._setDuration(timeStart) + proxy._setStatus() + proxy._setResponseHeaders() + proxy._setResponseBody() - if (err) { - return options.onFixtureError(proxy, err) - } + let err = proxy._getFixtureError() - // catch synchronous errors caused - // by the onload function - try { - const ol = fns.onload + if (err) { + return server.options.onFixtureError(proxy, err) + } - if (_.isFunction(ol)) { - ol.apply(xhr, args) - } + // catch synchronous errors caused + // by the onload function + try { + const ol = fns.onload - options.onLoad(proxy, route) - } catch (error) { - err = error - options.onError(proxy, err) + if (_.isFunction(ol)) { + ol.apply(xhr, args) } - if (_.isFunction(options.onAnyResponse)) { - return options.onAnyResponse(route, proxy) - } + server.options.onLoad(proxy, route) + } catch (error) { + err = error + server.options.onError(proxy, err) } - const onErrorFn = function (...args) { - // its possible our real onerror handler - // throws so we need to catch those errors too - try { - const oe = fns.onerror + if (_.isFunction(server.options.onAnyResponse)) { + return server.options.onAnyResponse(route, proxy) + } + } - if (_.isFunction(oe)) { - oe.apply(xhr, args) - } + const onErrorFn = function (...args) { + // its possible our real onerror handler + // throws so we need to catch those errors too + try { + const oe = fns.onerror - return options.onNetworkError(proxy) - } catch (err) { - return options.onError(proxy, err) + if (_.isFunction(oe)) { + oe.apply(xhr, args) } - } - const onReadyStateFn = function (...args) { - // catch synchronous errors caused - // by the onreadystatechange function - try { - const orst = fns.onreadystatechange + return server.options.onNetworkError(proxy) + } catch (err) { + return server.options.onError(proxy, err) + } + } - if (isAbortedThroughUnload(xhr)) { - server.abortXhr(xhr) - } + const onReadyStateFn = function (...args) { + // catch synchronous errors caused + // by the onreadystatechange function + try { + const orst = fns.onreadystatechange - if (_.isFunction(orst)) { - return orst.apply(xhr, args) - } - } catch (err) { - // its failed stop sending the callack - xhr.onreadystatechange = null + if (server.isAbortedThroughUnload(xhr)) { + server.abortXhr(xhr) + } - return options.onError(proxy, err) + if (_.isFunction(orst)) { + return orst.apply(xhr, args) } + } catch (err) { + // its failed stop sending the callack + xhr.onreadystatechange = null + + return server.options.onError(proxy, err) } + } - // bail if eventhandlers have already been called to prevent - // infinite recursion - overrides.onload = bridgeContentWindowListener(bailIfRecursive(onLoadFn)) - overrides.onerror = bridgeContentWindowListener(bailIfRecursive(onErrorFn)) - overrides.onreadystatechange = bridgeContentWindowListener(bailIfRecursive(onReadyStateFn)) + // bail if eventhandlers have already been called to prevent + // infinite recursion + overrides.onload = bridgeContentWindowListener(bailIfRecursive(onLoadFn)) + overrides.onerror = bridgeContentWindowListener(bailIfRecursive(onErrorFn)) + overrides.onreadystatechange = bridgeContentWindowListener(bailIfRecursive(onReadyStateFn)) - props.forEach((prop) => { - // if we currently have one of these properties then - // back them up! - const fn = xhr[prop] + props.forEach((prop) => { + // if we currently have one of these properties then + // back them up! + const fn = xhr[prop] - if (fn) { - fns[prop] = fn - } + if (fn) { + fns[prop] = fn + } - // set the override now - xhr[prop] = overrides[prop] + // set the override now + xhr[prop] = overrides[prop] - // and in the future if this is redefined - // then just back it up - return Object.defineProperty(xhr, prop, { - get () { - const bak = fns[prop] + // and in the future if this is redefined + // then just back it up + return Object.defineProperty(xhr, prop, { + get () { + const bak = fns[prop] - if (_.isFunction(bak)) { - return (...args) => { - return bak.apply(xhr, args) - } + if (_.isFunction(bak)) { + return (...args) => { + return bak.apply(xhr, args) } + } - return overrides[prop] - }, - set (fn) { - fns[prop] = fn - }, - configurable: true, - }) + return overrides[prop] + }, + set (fn) { + fns[prop] = fn + }, + configurable: true, }) + }) - options.onOpen(method, url, async, username, password) - - // change absolute url's to relative ones - // if they match our baseUrl / visited URL - return open.call(this, method, url, async, username, password) - } + server.options.onOpen(method, url, async, username, password) - XHR.prototype.send = function (requestBody) { - // if there is an existing route for this - // XHR then add those properties into it - // only if route isnt explicitly false - // and the server is enabled - const route = server.getRouteForXhr(this) + // change absolute url's to relative ones + // if they match our baseUrl / visited URL + return open.call(this, method, url, async, username, password) + } - if (server.shouldApplyStub(route)) { - server.applyStubProperties(this, route) - } + XHR.prototype.send = function (requestBody) { + // if there is an existing route for this + // XHR then add those properties into it + // only if route isnt explicitly false + // and the server is enabled + const route = server.getRouteForXhr(this) - // capture where this xhr came from - const sendStack = server.getStack() + if (server.shouldApplyStub(route)) { + server.applyStubProperties(this, route) + } - // get the proxy xhr - const proxy = server.getProxyFor(this) + // capture where this xhr came from + const sendStack = server.getStack() - proxy._setRequestBody(requestBody) + // get the proxy xhr + const proxy = server.getProxyFor(this) - // log this out now since it's being sent officially - // unless its not been ignored - if (!server.isIgnored(this)) { - options.onSend(proxy, sendStack, route) - } + proxy._setRequestBody(requestBody) - if (_.isFunction(options.onAnyRequest)) { - // call the onAnyRequest function - // after we've called options.onSend - options.onAnyRequest(route, proxy) - } + // log this out now since it's being sent officially + // unless its not been ignored + if (!server.isIgnored(this)) { + server.options.onSend(proxy, sendStack, route) + } - // eslint-disable-next-line prefer-rest-params - return send.apply(this, arguments) + if (_.isFunction(server.options.onAnyRequest)) { + // call the onAnyRequest function + // after we've called options.onSend + server.options.onAnyRequest(route, proxy) } - }, - } - return server + // eslint-disable-next-line prefer-rest-params + return send.apply(this, arguments) + } + } } +// Left behind for backwards compatibility +// When cy.server() is moved to a plugin, this might be safely removed. export default { - create, + create (options = {}) { + return new Server(options) + }, defaults, } diff --git a/packages/driver/src/dom/index.ts b/packages/driver/src/dom/index.ts index c27d31ef03e0..066afc89b344 100644 --- a/packages/driver/src/dom/index.ts +++ b/packages/driver/src/dom/index.ts @@ -9,7 +9,7 @@ import $visibility from './visibility' const { isWindow, getWindowByElement } = $window const { isDocument, getDocumentFromElement } = $document const { wrap, unwrap, isJquery, query } = $jquery -const { isVisible, isHidden, getReasonIsHidden, isW3CRendered, isW3CFocusable } = $visibility +const { isVisible, isHidden, isStrictlyHidden, isHiddenByAncestors, getReasonIsHidden, isW3CRendered, isW3CFocusable } = $visibility const { isInputType, isFocusable, isElement, isScrollable, isFocused, stringify, getElements, getContainsSelector, getFirstDeepestElement, isDetached, isAttached, isTextLike, isSelector, isDescendent, getFirstFixedOrStickyPositionParent, getFirstStickyPositionParent, getFirstScrollableParent, isUndefinedOrHTMLBodyDoc, elementFromPoint, getParent, findAllShadowRoots, isWithinShadowRoot, getHostContenteditable } = $elements const { getCoordsByPosition, getElementPositioning, getElementCoordinatesByPosition, getElementAtPointFromViewport, getElementCoordinatesByPositionRelativeToXY } = $coordinates const { getSelectionBounds } = $selection @@ -34,6 +34,8 @@ export default { isInputType, isVisible, isHidden, + isStrictlyHidden, + isHiddenByAncestors, isFocusable, isTextLike, isScrollable, diff --git a/packages/driver/src/dom/visibility.ts b/packages/driver/src/dom/visibility.ts index bd8d1a1b5038..9a1be1ac7f26 100644 --- a/packages/driver/src/dom/visibility.ts +++ b/packages/driver/src/dom/visibility.ts @@ -11,7 +11,7 @@ const fixedOrAbsoluteRe = /(fixed|absolute)/ const OVERFLOW_PROPS = ['hidden', 'scroll', 'auto'] -export const isVisible = (el) => { +const isVisible = (el) => { return !isHidden(el, 'isVisible()') } @@ -22,11 +22,22 @@ const { wrap } = $jquery // because of circular references // the ignoreOpacity option exists for checking actionability // as elements with `opacity: 0` are hidden yet actionable -export const isHidden = (el, methodName = 'isHidden()', options = { checkOpacity: true }) => { +const isHidden = (el, methodName = 'isHidden()', options = { checkOpacity: true }) => { + if (isStrictlyHidden(el, methodName, options, isHidden)) { + return true + } + + return isHiddenByAncestors(el, methodName, options) +} + +const ensureEl = (el, methodName) => { if (!isElement(el)) { throw new Error(`\`Cypress.dom.${methodName}\` failed because it requires a DOM element. The subject received was: \`${el}\``) } +} +const isStrictlyHidden = (el, methodName = 'isStrictlyHidden()', options = { checkOpacity: true }, recurse?) => { + ensureEl(el, methodName) const $el = $jquery.wrap(el) // the body and html are always visible @@ -49,7 +60,7 @@ export const isHidden = (el, methodName = 'isHidden()', options = { checkOpacity // in which case it will fall through to regular visibility logic if ($select && $select.length) { // if the select is hidden, the options in it are visible too - return isHidden($select[0], methodName) + return recurse ? recurse($select[0], methodName, options) : isStrictlyHidden($select[0], methodName, options) } } @@ -84,6 +95,13 @@ export const isHidden = (el, methodName = 'isHidden()', options = { checkOpacity return true } + return false +} + +const isHiddenByAncestors = (el, methodName = 'isHiddenByAncestors()', options = { checkOpacity: true }) => { + ensureEl(el, methodName) + const $el = $jquery.wrap(el) + // we do some calculations taking into account the parents // to see if its hidden by a parent if (elIsHiddenByAncestors($el, options.checkOpacity)) { @@ -537,5 +555,5 @@ export const getReasonIsHidden = function ($el, options = { checkOpacity: true } /* eslint-enable no-cond-assign */ export default { - isVisible, isHidden, getReasonIsHidden, isW3CFocusable, isW3CRendered, + isVisible, isHidden, isStrictlyHidden, isHiddenByAncestors, getReasonIsHidden, isW3CFocusable, isW3CRendered, } diff --git a/packages/electron/README.md b/packages/electron/README.md index bf2b3ec6001c..1de22a95471e 100644 --- a/packages/electron/README.md +++ b/packages/electron/README.md @@ -1,8 +1,8 @@ -# Electron +# @packages/electron This is the lib responsible for installing + building Electron. This enables us to develop with the Electron shell that will match how the final compiled Cypress binary looks 1:1. -It does this by using `symlinks` while in development. +It does this by using symlinks while in development. ## Building @@ -19,3 +19,33 @@ yarn workspace @packages/electron test yarn workspace @packages/electron test-debug yarn workspace @packages/electron test-watch ``` + +## Upgrading Electron + +The version of `electron` that is bundled with Cypress should be kept as up-to-date as possible with the [stable Electron releases](https://www.electronjs.org/releases/stable). Many users expect the bundled Chromium and Node.js to be relatively recent. Also, historically, it has been extremely difficult to upgrade over multiple major versions of Electron at once, because of all the breaking changes in Electron and Node.js that impact Cypress. + + +Upgrading `electron` involves more than just bumping this package's `package.json`. Here are additional tasks to check off when upgrading Electron: + +- [ ] **Write accurate changelog items.** The "User-facing changelog" for an Electron upgrade should mention the new Node.js and Chromium versions bundled. + - For example: + - Upgraded `electron` from `12.0.0-beta.14` to `13.1.7`. + - Upgraded bundled Node.js version from `14.6.0` to `14.17.0`. + - Upgraded bundled Chromium version from 89.0.0.1234 to 91.0.0.2345. +- [ ] **Determine if the Electron upgrade is a breaking change.** Electron upgrades constitute "breaking changes" in Cypress if: + - the major version number of Node.js changes, since users rely on the bundled Node.js to load plugins and `.js` fixtures, or + - there are changes to Electron that require new shared libraries to be installed on Linux, breaking existing CI setups, or + - there is some other change that would break existing usage of Cypress (for example, a Web API feature being removed/added to the bundled Chromium) +- [ ] **Create and publish Docker `base` and `browsers` family images matching the Node.js and Chromium versions in Electron.** The `browsers` image will be used for CI and the `base` will be used for any new `included` family images. + - See [`cypress-docker-images`](https://github.com/cypress-io/cypress-docker-images/). +- [ ] **Ensure that a matching Node.js version is enforced in the monorepo for local development and CI.** When Electron is upgraded, oftentimes, the bundled Node.js version that comes with Electron is updated as well. Because all unit and integration tests run in normal Node.js (not Electron's Node.js), it's important for this Node.js version to be synced with the monorepo. There are a few places where this needs to be done: + - [ ] [`/.node-version`](../../.node-version) - used by `nvm` and other Node version managers + - [ ] [`/appveyor.yml`](../../appveyor.yml) - update the `nodejs_version` + - [ ] [`/package.json`](../../package.json) - update `engines` + - [ ] [`/scripts/run-docker-local.sh`](../../scripts/run-docker-local.sh) - update Docker image to the new matching `browsers` image + - [ ] [`/circle.yml`](../../circle.yml) + - Update the Docker `image`s to the new matching `browsers` image. + - Update the `xcode` version to one with the same major Node.js version bundled. There is usually not an exact match, this is ok as long as the major version number as the same. + - [ ] Do a global search for the old Node.js version to identify any new areas that may need updating/unification, and update those locations (and this document!) +- [ ] **Manually smoke test `cypress open`.** Upgrading Electron can break the `desktop-gui` in unexpected ways. Since testing in this area is weak, double-check that things like launching `cypress open`, signing into the Dashboard, and launching Electron tests still work. +- [ ] **Fix failing tests.** Usually, these are due to breaking changes in either Node.js or Electron. Check the changelogs of both to find relevant changes. \ No newline at end of file diff --git a/packages/launcher/lib/darwin/index.ts b/packages/launcher/lib/darwin/index.ts index 96e95b3df273..d299d53fbe9e 100644 --- a/packages/launcher/lib/darwin/index.ts +++ b/packages/launcher/lib/darwin/index.ts @@ -2,7 +2,6 @@ import { findApp, FindAppParams } from './util' import type { Browser, DetectedBrowser } from '@packages/types' import * as linuxHelper from '../linux' import { log } from '../log' -import { merge } from 'ramda' import { get } from 'lodash' type Detectors = { @@ -105,7 +104,7 @@ export function detect (browser: Browser): Promise { } return findApp(findAppParams) - .then(merge({ name: browser.name })) + .then((val) => ({ name: browser.name, ...val })) .catch(() => { log('could not detect %s using traditional Mac methods', browser.name) log('trying linux search') diff --git a/packages/launcher/lib/darwin/util.ts b/packages/launcher/lib/darwin/util.ts index 51c83f1d3366..0a17f651e9bc 100644 --- a/packages/launcher/lib/darwin/util.ts +++ b/packages/launcher/lib/darwin/util.ts @@ -1,6 +1,5 @@ import { log } from '../log' import { notInstalledErr } from '../errors' -import { prop, tap } from 'ramda' import { utils } from '../utils' import * as fs from 'fs-extra' import * as os from 'os' @@ -27,7 +26,7 @@ export function parsePlist (p: string, property: string): Promise { return fs .readFile(pl, 'utf8') .then(plist.parse) - .then((obj) => obj[property]) + .then((val) => val[property]) .then(String) // explicitly convert value to String type .catch(failed) // to make TS compiler happy } @@ -50,8 +49,14 @@ export function mdfind (id: string): Promise { } return utils.execa(cmd) - .then(prop('stdout')) - .then(tap(logFound)) + .then((val) => { + return val.stdout + }) + .then((val) => { + logFound(val) + + return val + }) .catch(failedToFind) } diff --git a/packages/launcher/lib/detect.ts b/packages/launcher/lib/detect.ts index d9e7098d7e7f..f661e8c4a90a 100644 --- a/packages/launcher/lib/detect.ts +++ b/packages/launcher/lib/detect.ts @@ -1,7 +1,6 @@ import Bluebird from 'bluebird' -import { compact, extend, find } from 'lodash' +import _, { compact, extend, find } from 'lodash' import os from 'os' -import { flatten, merge, pick, props, tap, uniqBy } from 'ramda' import { browsers } from './browsers' import * as darwinHelper from './darwin' import { needsDarwinWorkaround, darwinDetectionWorkaround } from './darwin/util' @@ -19,7 +18,7 @@ import type { } from './types' import * as windowsHelper from './windows' -type HasVersion = Partial & { +type HasVersion = Omit, 'version' | 'name'> & { version: string name: string } @@ -94,7 +93,7 @@ function lookup ( * one for each binary. If Windows is detected, only one `checkOneBrowser` will be called, because * we don't use the `binary` field on Windows. */ -function checkBrowser (browser: Browser): Bluebird<(boolean | FoundBrowser)[]> { +function checkBrowser (browser: Browser): Bluebird<(boolean | HasVersion)[]> { if (Array.isArray(browser.binary) && os.platform() !== 'win32') { return Bluebird.map(browser.binary, (binary: string) => { return checkOneBrowser(extend({}, browser, { binary })) @@ -104,9 +103,9 @@ function checkBrowser (browser: Browser): Bluebird<(boolean | FoundBrowser)[]> { return Bluebird.map([browser], checkOneBrowser) } -function checkOneBrowser (browser: Browser): Promise { +function checkOneBrowser (browser: Browser): Promise { const platform = os.platform() - const pickBrowserProps = pick([ + const pickBrowserProps = [ 'name', 'family', 'channel', @@ -120,7 +119,7 @@ function checkOneBrowser (browser: Browser): Promise { 'info', 'minSupportedVersion', 'unsupportedVersion', - ]) + ] as const const logBrowser = (props: any) => { log('setting major version for %j', props) @@ -139,9 +138,13 @@ function checkOneBrowser (browser: Browser): Promise { log('checking one browser %s', browser.name) return lookup(platform, browser) - .then(merge(browser)) - .then(pickBrowserProps) - .then(tap(logBrowser)) + .then((val) => ({ ...browser, ...val })) + .then((val) => _.pick(val, pickBrowserProps) as HasVersion) + .then((val) => { + logBrowser(val) + + return val + }) .then((browser) => setMajorVersion(browser)) .catch(failed) } @@ -185,9 +188,11 @@ export const detect = (goalBrowsers?: Browser[], useDarwinWorkaround = true): Bl }) } - const removeDuplicates = uniqBy((browser: FoundBrowser) => { - return props(['name', 'version'], browser) - }) + const removeDuplicates = (val) => { + return _.uniqBy(val, (browser: FoundBrowser) => { + return `${browser.name}-${browser.version}` + }) + } const compactFalse = (browsers: any[]) => { return compact(browsers) as FoundBrowser[] } @@ -195,7 +200,7 @@ export const detect = (goalBrowsers?: Browser[], useDarwinWorkaround = true): Bl log('detecting if the following browsers are present %o', goalBrowsers) return Bluebird.mapSeries(goalBrowsers, checkBrowser) - .then(flatten) + .then((val) => _.flatten(val)) .then(compactFalse) .then(removeDuplicates) } diff --git a/packages/launcher/lib/linux/index.ts b/packages/launcher/lib/linux/index.ts index af99528c8d09..3b59fd03701b 100644 --- a/packages/launcher/lib/linux/index.ts +++ b/packages/launcher/lib/linux/index.ts @@ -1,7 +1,6 @@ import { log } from '../log' -import { partial, trim, tap, prop } from 'ramda' -import type { PathData } from '../types' import type { FoundBrowser, Browser } from '@packages/types' +import type { PathData } from '../types' import { notInstalledErr } from '../errors' import { utils } from '../utils' import os from 'os' @@ -69,9 +68,13 @@ export function getVersionString (path: string) { return Bluebird.resolve(utils.getOutput(path, ['--version'])) .timeout(30000, `Timed out after 30 seconds getting browser version for ${path}`) - .then(prop('stdout')) - .then(trim) - .then(tap(partial(log, ['stdout: "%s"']))) + .then((val) => val.stdout) + .then((val) => val.trim()) + .then((val) => { + log('stdout: %s', val) + + return val + }) } export function getVersionNumber (version: string, browser: Browser) { diff --git a/packages/launcher/lib/windows/index.ts b/packages/launcher/lib/windows/index.ts index 85c3371145f2..0ec7ee366a6c 100644 --- a/packages/launcher/lib/windows/index.ts +++ b/packages/launcher/lib/windows/index.ts @@ -1,7 +1,6 @@ import * as fse from 'fs-extra' import os from 'os' import { join, normalize, win32 } from 'path' -import { tap, trim, prop } from 'ramda' import { get } from 'lodash' import { notInstalledErr } from '../errors' import { log } from '../log' @@ -152,7 +151,11 @@ function getWindowsBrowser (browser: Browser): Promise { } return getVersionString(path) - .then(tap(log)) + .then((val) => { + log(val) + + return val + }) .then(getVersion) .then((version: string) => { log('browser %s at \'%s\' version %s', browser.name, exePath, version) @@ -194,8 +197,8 @@ export function getVersionString (path: string) { ] return utils.execa('wmic', args) - .then(prop('stdout')) - .then(trim) + .then((val) => val.stdout) + .then((val) => val.trim()) } export function getVersionNumber (version: string) { diff --git a/packages/launcher/package.json b/packages/launcher/package.json index 47180ad26517..46a722792407 100644 --- a/packages/launcher/package.json +++ b/packages/launcher/package.json @@ -19,7 +19,6 @@ "fs-extra": "8.1.0", "lodash": "4.17.21", "plist": "3.0.1", - "ramda": "0.27.1", "semver": "7.3.5" }, "devDependencies": { diff --git a/packages/launcher/test/unit/detect_spec.ts b/packages/launcher/test/unit/detect_spec.ts index 78057aa9d963..a9f2ef0aba95 100644 --- a/packages/launcher/test/unit/detect_spec.ts +++ b/packages/launcher/test/unit/detect_spec.ts @@ -1,4 +1,5 @@ require('../spec_helper') +import _ from 'lodash' import { detect, detectByPath, setMajorVersion } from '../../lib/detect' import { goalBrowsers } from '../fixtures' import { expect } from 'chai' @@ -6,7 +7,6 @@ import { utils } from '../../lib/utils' import sinon, { SinonStub } from 'sinon' import os from 'os' import { log } from '../log' -import { project } from 'ramda' import * as darwinUtil from '../../lib/darwin/util' const isWindows = () => { @@ -20,7 +20,7 @@ describe('browser detection', () => { log('detected browsers %j', browsers) expect(browsers).to.be.an('array') - const mainProps = project(['name', 'version'], browsers) + const mainProps = browsers.map((val) => _.pick(val, ['name', 'version'])) log('%d browsers\n%j', browsers.length, mainProps) diff --git a/packages/net-stubbing/lib/server/util.ts b/packages/net-stubbing/lib/server/util.ts index 5a4dd022d6ef..c33d4be1464f 100644 --- a/packages/net-stubbing/lib/server/util.ts +++ b/packages/net-stubbing/lib/server/util.ts @@ -120,7 +120,7 @@ export async function setResponseFromFixture (getFixtureFn: GetFixtureFn, static return } - const data = await getFixtureFn(fixture.filePath, { encoding: fixture.encoding || null }) + const data = await getFixtureFn(fixture.filePath, { encoding: fixture.encoding }) const { headers } = staticResponse diff --git a/packages/runner-ct/cypress/component/RunnerCt.spec.tsx b/packages/runner-ct/cypress/component/RunnerCt.spec.tsx index ccbaa8c41545..85bc7759695a 100644 --- a/packages/runner-ct/cypress/component/RunnerCt.spec.tsx +++ b/packages/runner-ct/cypress/component/RunnerCt.spec.tsx @@ -20,8 +20,10 @@ interface Overrides { const noop = () => {} class FakeEventManager { + reporterBus: { on: () => void } constructor (overrides: Overrides = {}) { this.saveState = overrides.saveState || noop + this.reporterBus = { on: noop } } start = noop @@ -132,4 +134,29 @@ describe('RunnerCt', () => { cy.get(selectors.noSpecSelectedReporter).should('exist') }) }) + + context('current spec is deleted', () => { + it('removes selection', () => { + const state = makeState({ + spec: { relative: '/test.js', absolute: 'root/test.js', name: 'test.js' }, + specs: [ + { relative: '/test2.js', absolute: 'root/test2.js', name: 'test2.js' }, + { relative: '/test.js', absolute: 'root/test.js', name: 'test.js' }, + ], + }) + + mount() + + cy.contains('Your tests are loading').then(() => { + state.setSpecs([{ relative: '/test2.js', absolute: 'root/test2.js', name: 'test2.js' }]) + }) + + cy.contains('No spec selected') + }) + }) }) diff --git a/packages/runner-shared/src/store.ts b/packages/runner-shared/src/store.ts index 5591dc2410da..ccfdc36b57ab 100644 --- a/packages/runner-shared/src/store.ts +++ b/packages/runner-shared/src/store.ts @@ -56,7 +56,18 @@ export class BaseStore { this.specRunId = nanoid() } + @action checkCurrentSpecStillExists (specs: Cypress.Spec[]) { + const newSpecsAbsolutes = new Set(specs.map((spec) => spec.absolute)) + + this.specs.forEach((oldSpec) => { + if (!newSpecsAbsolutes.has(oldSpec.absolute) && this.spec?.absolute === oldSpec.absolute) { + this.spec = undefined + } + }) + } + @action setSpecs (specs: Cypress.Spec[]) { + this.checkCurrentSpecStillExists(specs) this.specs = specs } diff --git a/packages/runner/__snapshots__/retries.mochaEvents.spec.js b/packages/runner/__snapshots__/retries.mochaEvents.spec.js index d440a0171dbd..58a4e7318da8 100644 --- a/packages/runner/__snapshots__/retries.mochaEvents.spec.js +++ b/packages/runner/__snapshots__/retries.mochaEvents.spec.js @@ -15,7 +15,8 @@ exports['src/cypress/runner retries mochaEvents simple retry #1'] = [ "root": true, "type": "suite", "file": "relative/path/to/spec.js", - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -28,7 +29,8 @@ exports['src/cypress/runner retries mochaEvents simple retry #1'] = [ "type": "suite", "file": null, "invocationDetails": "{Object 8}", - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -43,7 +45,8 @@ exports['src/cypress/runner retries mochaEvents simple retry #1'] = [ "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -59,7 +62,8 @@ exports['src/cypress/runner retries mochaEvents simple retry #1'] = [ "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -92,7 +96,8 @@ exports['src/cypress/runner retries mochaEvents simple retry #1'] = [ "invocationDetails": "{Object 8}", "final": false, "currentRetry": 0, - "retries": 1 + "retries": 1, + "_slow": 10000 }, { "message": "[error message]", @@ -133,7 +138,8 @@ exports['src/cypress/runner retries mochaEvents simple retry #1'] = [ "invocationDetails": "{Object 8}", "final": false, "currentRetry": 0, - "retries": 1 + "retries": 1, + "_slow": 10000 } ], [ @@ -147,7 +153,8 @@ exports['src/cypress/runner retries mochaEvents simple retry #1'] = [ "wallClockStartedAt": "match.date", "file": null, "currentRetry": 1, - "retries": 1 + "retries": 1, + "_slow": 10000 } ], [ @@ -171,7 +178,8 @@ exports['src/cypress/runner retries mochaEvents simple retry #1'] = [ "file": null, "final": true, "currentRetry": 1, - "retries": 1 + "retries": 1, + "_slow": 10000 } ], [ @@ -195,7 +203,8 @@ exports['src/cypress/runner retries mochaEvents simple retry #1'] = [ "file": null, "final": true, "currentRetry": 1, - "retries": 1 + "retries": 1, + "_slow": 10000 } ], [ @@ -208,7 +217,8 @@ exports['src/cypress/runner retries mochaEvents simple retry #1'] = [ "type": "suite", "file": null, "invocationDetails": "{Object 8}", - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -233,7 +243,8 @@ exports['src/cypress/runner retries mochaEvents simple retry #1'] = [ "file": null, "final": true, "currentRetry": 1, - "retries": 1 + "retries": 1, + "_slow": 10000 } ], [ @@ -245,7 +256,8 @@ exports['src/cypress/runner retries mochaEvents simple retry #1'] = [ "root": true, "type": "suite", "file": "relative/path/to/spec.js", - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -274,7 +286,8 @@ exports['src/cypress/runner retries mochaEvents test retry with hooks #1'] = [ "root": true, "type": "suite", "file": "relative/path/to/spec.js", - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -287,7 +300,8 @@ exports['src/cypress/runner retries mochaEvents test retry with hooks #1'] = [ "type": "suite", "file": null, "invocationDetails": "{Object 8}", - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -303,7 +317,8 @@ exports['src/cypress/runner retries mochaEvents test retry with hooks #1'] = [ "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -319,7 +334,8 @@ exports['src/cypress/runner retries mochaEvents test retry with hooks #1'] = [ "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -336,7 +352,8 @@ exports['src/cypress/runner retries mochaEvents test retry with hooks #1'] = [ "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -380,7 +397,8 @@ exports['src/cypress/runner retries mochaEvents test retry with hooks #1'] = [ "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": 1 + "retries": 1, + "_slow": 10000 } ], [ @@ -396,7 +414,8 @@ exports['src/cypress/runner retries mochaEvents test retry with hooks #1'] = [ "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -413,7 +432,8 @@ exports['src/cypress/runner retries mochaEvents test retry with hooks #1'] = [ "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -467,7 +487,8 @@ exports['src/cypress/runner retries mochaEvents test retry with hooks #1'] = [ "invocationDetails": "{Object 8}", "final": false, "currentRetry": 0, - "retries": 1 + "retries": 1, + "_slow": 10000 }, { "message": "[error message]", @@ -490,7 +511,8 @@ exports['src/cypress/runner retries mochaEvents test retry with hooks #1'] = [ "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -507,7 +529,8 @@ exports['src/cypress/runner retries mochaEvents test retry with hooks #1'] = [ "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -562,7 +585,8 @@ exports['src/cypress/runner retries mochaEvents test retry with hooks #1'] = [ "invocationDetails": "{Object 8}", "final": false, "currentRetry": 0, - "retries": 1 + "retries": 1, + "_slow": 10000 } ], [ @@ -579,7 +603,8 @@ exports['src/cypress/runner retries mochaEvents test retry with hooks #1'] = [ "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -593,7 +618,8 @@ exports['src/cypress/runner retries mochaEvents test retry with hooks #1'] = [ "wallClockStartedAt": "match.date", "file": null, "currentRetry": 1, - "retries": 1 + "retries": 1, + "_slow": 10000 } ], [ @@ -610,7 +636,8 @@ exports['src/cypress/runner retries mochaEvents test retry with hooks #1'] = [ "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -627,7 +654,8 @@ exports['src/cypress/runner retries mochaEvents test retry with hooks #1'] = [ "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -644,7 +672,8 @@ exports['src/cypress/runner retries mochaEvents test retry with hooks #1'] = [ "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -660,7 +689,8 @@ exports['src/cypress/runner retries mochaEvents test retry with hooks #1'] = [ "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -677,7 +707,8 @@ exports['src/cypress/runner retries mochaEvents test retry with hooks #1'] = [ "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -722,7 +753,8 @@ exports['src/cypress/runner retries mochaEvents test retry with hooks #1'] = [ "file": null, "final": true, "currentRetry": 1, - "retries": 1 + "retries": 1, + "_slow": 10000 } ], [ @@ -767,7 +799,8 @@ exports['src/cypress/runner retries mochaEvents test retry with hooks #1'] = [ "file": null, "final": true, "currentRetry": 1, - "retries": 1 + "retries": 1, + "_slow": 10000 } ], [ @@ -780,7 +813,8 @@ exports['src/cypress/runner retries mochaEvents test retry with hooks #1'] = [ "type": "suite", "file": null, "invocationDetails": "{Object 8}", - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -826,7 +860,8 @@ exports['src/cypress/runner retries mochaEvents test retry with hooks #1'] = [ "file": null, "final": true, "currentRetry": 1, - "retries": 1 + "retries": 1, + "_slow": 10000 } ], [ @@ -838,7 +873,8 @@ exports['src/cypress/runner retries mochaEvents test retry with hooks #1'] = [ "root": true, "type": "suite", "file": "relative/path/to/spec.js", - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -867,7 +903,8 @@ exports['src/cypress/runner retries mochaEvents test retry with [only] #1'] = [ "root": true, "type": "suite", "file": "relative/path/to/spec.js", - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -880,7 +917,8 @@ exports['src/cypress/runner retries mochaEvents test retry with [only] #1'] = [ "type": "suite", "file": null, "invocationDetails": "{Object 8}", - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -896,7 +934,8 @@ exports['src/cypress/runner retries mochaEvents test retry with [only] #1'] = [ "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -912,7 +951,8 @@ exports['src/cypress/runner retries mochaEvents test retry with [only] #1'] = [ "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -929,7 +969,8 @@ exports['src/cypress/runner retries mochaEvents test retry with [only] #1'] = [ "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -973,7 +1014,8 @@ exports['src/cypress/runner retries mochaEvents test retry with [only] #1'] = [ "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": 1 + "retries": 1, + "_slow": 10000 } ], [ @@ -989,7 +1031,8 @@ exports['src/cypress/runner retries mochaEvents test retry with [only] #1'] = [ "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -1006,7 +1049,8 @@ exports['src/cypress/runner retries mochaEvents test retry with [only] #1'] = [ "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -1060,7 +1104,8 @@ exports['src/cypress/runner retries mochaEvents test retry with [only] #1'] = [ "invocationDetails": "{Object 8}", "final": false, "currentRetry": 0, - "retries": 1 + "retries": 1, + "_slow": 10000 }, { "message": "[error message]", @@ -1083,7 +1128,8 @@ exports['src/cypress/runner retries mochaEvents test retry with [only] #1'] = [ "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -1100,7 +1146,8 @@ exports['src/cypress/runner retries mochaEvents test retry with [only] #1'] = [ "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -1155,7 +1202,8 @@ exports['src/cypress/runner retries mochaEvents test retry with [only] #1'] = [ "invocationDetails": "{Object 8}", "final": false, "currentRetry": 0, - "retries": 1 + "retries": 1, + "_slow": 10000 } ], [ @@ -1172,7 +1220,8 @@ exports['src/cypress/runner retries mochaEvents test retry with [only] #1'] = [ "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -1186,7 +1235,8 @@ exports['src/cypress/runner retries mochaEvents test retry with [only] #1'] = [ "wallClockStartedAt": "match.date", "file": null, "currentRetry": 1, - "retries": 1 + "retries": 1, + "_slow": 10000 } ], [ @@ -1203,7 +1253,8 @@ exports['src/cypress/runner retries mochaEvents test retry with [only] #1'] = [ "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -1220,7 +1271,8 @@ exports['src/cypress/runner retries mochaEvents test retry with [only] #1'] = [ "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -1237,7 +1289,8 @@ exports['src/cypress/runner retries mochaEvents test retry with [only] #1'] = [ "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -1253,7 +1306,8 @@ exports['src/cypress/runner retries mochaEvents test retry with [only] #1'] = [ "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -1270,7 +1324,8 @@ exports['src/cypress/runner retries mochaEvents test retry with [only] #1'] = [ "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -1315,7 +1370,8 @@ exports['src/cypress/runner retries mochaEvents test retry with [only] #1'] = [ "file": null, "final": true, "currentRetry": 1, - "retries": 1 + "retries": 1, + "_slow": 10000 } ], [ @@ -1360,7 +1416,8 @@ exports['src/cypress/runner retries mochaEvents test retry with [only] #1'] = [ "file": null, "final": true, "currentRetry": 1, - "retries": 1 + "retries": 1, + "_slow": 10000 } ], [ @@ -1373,7 +1430,8 @@ exports['src/cypress/runner retries mochaEvents test retry with [only] #1'] = [ "type": "suite", "file": null, "invocationDetails": "{Object 8}", - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -1419,7 +1477,8 @@ exports['src/cypress/runner retries mochaEvents test retry with [only] #1'] = [ "file": null, "final": true, "currentRetry": 1, - "retries": 1 + "retries": 1, + "_slow": 10000 } ], [ @@ -1431,7 +1490,8 @@ exports['src/cypress/runner retries mochaEvents test retry with [only] #1'] = [ "root": true, "type": "suite", "file": "relative/path/to/spec.js", - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -1460,7 +1520,8 @@ exports['src/cypress/runner retries mochaEvents can retry from [beforeEach] #1'] "root": true, "type": "suite", "file": "relative/path/to/spec.js", - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -1473,7 +1534,8 @@ exports['src/cypress/runner retries mochaEvents can retry from [beforeEach] #1'] "type": "suite", "file": null, "invocationDetails": "{Object 8}", - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -1489,7 +1551,8 @@ exports['src/cypress/runner retries mochaEvents can retry from [beforeEach] #1'] "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -1505,7 +1568,8 @@ exports['src/cypress/runner retries mochaEvents can retry from [beforeEach] #1'] "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -1522,7 +1586,8 @@ exports['src/cypress/runner retries mochaEvents can retry from [beforeEach] #1'] "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -1571,7 +1636,8 @@ exports['src/cypress/runner retries mochaEvents can retry from [beforeEach] #1'] "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": 1 + "retries": 1, + "_slow": 10000 } ], [ @@ -1587,7 +1653,8 @@ exports['src/cypress/runner retries mochaEvents can retry from [beforeEach] #1'] "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -1604,7 +1671,8 @@ exports['src/cypress/runner retries mochaEvents can retry from [beforeEach] #1'] "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -1620,7 +1688,8 @@ exports['src/cypress/runner retries mochaEvents can retry from [beforeEach] #1'] "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -1637,7 +1706,8 @@ exports['src/cypress/runner retries mochaEvents can retry from [beforeEach] #1'] "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -1653,7 +1723,8 @@ exports['src/cypress/runner retries mochaEvents can retry from [beforeEach] #1'] "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -1669,7 +1740,8 @@ exports['src/cypress/runner retries mochaEvents can retry from [beforeEach] #1'] "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -1730,7 +1802,8 @@ exports['src/cypress/runner retries mochaEvents can retry from [beforeEach] #1'] "invocationDetails": "{Object 8}", "final": false, "currentRetry": 0, - "retries": 1 + "retries": 1, + "_slow": 10000 }, { "message": "[error message]", @@ -1753,7 +1826,8 @@ exports['src/cypress/runner retries mochaEvents can retry from [beforeEach] #1'] "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -1770,7 +1844,8 @@ exports['src/cypress/runner retries mochaEvents can retry from [beforeEach] #1'] "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -1832,7 +1907,8 @@ exports['src/cypress/runner retries mochaEvents can retry from [beforeEach] #1'] "invocationDetails": "{Object 8}", "final": false, "currentRetry": 0, - "retries": 1 + "retries": 1, + "_slow": 10000 } ], [ @@ -1849,7 +1925,8 @@ exports['src/cypress/runner retries mochaEvents can retry from [beforeEach] #1'] "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -1863,7 +1940,8 @@ exports['src/cypress/runner retries mochaEvents can retry from [beforeEach] #1'] "wallClockStartedAt": "match.date", "file": null, "currentRetry": 1, - "retries": 1 + "retries": 1, + "_slow": 10000 } ], [ @@ -1880,7 +1958,8 @@ exports['src/cypress/runner retries mochaEvents can retry from [beforeEach] #1'] "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -1897,7 +1976,8 @@ exports['src/cypress/runner retries mochaEvents can retry from [beforeEach] #1'] "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -1914,7 +1994,8 @@ exports['src/cypress/runner retries mochaEvents can retry from [beforeEach] #1'] "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -1930,7 +2011,8 @@ exports['src/cypress/runner retries mochaEvents can retry from [beforeEach] #1'] "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -1947,7 +2029,8 @@ exports['src/cypress/runner retries mochaEvents can retry from [beforeEach] #1'] "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -1964,7 +2047,8 @@ exports['src/cypress/runner retries mochaEvents can retry from [beforeEach] #1'] "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -1981,7 +2065,8 @@ exports['src/cypress/runner retries mochaEvents can retry from [beforeEach] #1'] "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -1997,7 +2082,8 @@ exports['src/cypress/runner retries mochaEvents can retry from [beforeEach] #1'] "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -2014,7 +2100,8 @@ exports['src/cypress/runner retries mochaEvents can retry from [beforeEach] #1'] "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -2069,7 +2156,8 @@ exports['src/cypress/runner retries mochaEvents can retry from [beforeEach] #1'] "file": null, "final": true, "currentRetry": 1, - "retries": 1 + "retries": 1, + "_slow": 10000 } ], [ @@ -2124,7 +2212,8 @@ exports['src/cypress/runner retries mochaEvents can retry from [beforeEach] #1'] "file": null, "final": true, "currentRetry": 1, - "retries": 1 + "retries": 1, + "_slow": 10000 } ], [ @@ -2137,7 +2226,8 @@ exports['src/cypress/runner retries mochaEvents can retry from [beforeEach] #1'] "type": "suite", "file": null, "invocationDetails": "{Object 8}", - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -2193,7 +2283,8 @@ exports['src/cypress/runner retries mochaEvents can retry from [beforeEach] #1'] "file": null, "final": true, "currentRetry": 1, - "retries": 1 + "retries": 1, + "_slow": 10000 } ], [ @@ -2205,7 +2296,8 @@ exports['src/cypress/runner retries mochaEvents can retry from [beforeEach] #1'] "root": true, "type": "suite", "file": "relative/path/to/spec.js", - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -2234,7 +2326,8 @@ exports['src/cypress/runner retries mochaEvents can retry from [afterEach] #1'] "root": true, "type": "suite", "file": "relative/path/to/spec.js", - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -2247,7 +2340,8 @@ exports['src/cypress/runner retries mochaEvents can retry from [afterEach] #1'] "type": "suite", "file": null, "invocationDetails": "{Object 8}", - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -2263,7 +2357,8 @@ exports['src/cypress/runner retries mochaEvents can retry from [afterEach] #1'] "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -2279,7 +2374,8 @@ exports['src/cypress/runner retries mochaEvents can retry from [afterEach] #1'] "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -2296,7 +2392,8 @@ exports['src/cypress/runner retries mochaEvents can retry from [afterEach] #1'] "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -2350,7 +2447,8 @@ exports['src/cypress/runner retries mochaEvents can retry from [afterEach] #1'] "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": 2 + "retries": 2, + "_slow": 10000 } ], [ @@ -2366,7 +2464,8 @@ exports['src/cypress/runner retries mochaEvents can retry from [afterEach] #1'] "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -2383,7 +2482,8 @@ exports['src/cypress/runner retries mochaEvents can retry from [afterEach] #1'] "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -2399,7 +2499,8 @@ exports['src/cypress/runner retries mochaEvents can retry from [afterEach] #1'] "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -2416,7 +2517,8 @@ exports['src/cypress/runner retries mochaEvents can retry from [afterEach] #1'] "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -2432,7 +2534,8 @@ exports['src/cypress/runner retries mochaEvents can retry from [afterEach] #1'] "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -2449,7 +2552,8 @@ exports['src/cypress/runner retries mochaEvents can retry from [afterEach] #1'] "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -2465,7 +2569,8 @@ exports['src/cypress/runner retries mochaEvents can retry from [afterEach] #1'] "file": "relative/path/to/spec.js", "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -2531,7 +2636,8 @@ exports['src/cypress/runner retries mochaEvents can retry from [afterEach] #1'] "invocationDetails": "{Object 8}", "final": false, "currentRetry": 0, - "retries": 2 + "retries": 2, + "_slow": 10000 }, { "message": "[error message]", @@ -2562,7 +2668,8 @@ exports['src/cypress/runner retries mochaEvents can retry from [afterEach] #1'] "file": "relative/path/to/spec.js", "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -2629,7 +2736,8 @@ exports['src/cypress/runner retries mochaEvents can retry from [afterEach] #1'] "invocationDetails": "{Object 8}", "final": false, "currentRetry": 0, - "retries": 2 + "retries": 2, + "_slow": 10000 } ], [ @@ -2646,7 +2754,8 @@ exports['src/cypress/runner retries mochaEvents can retry from [afterEach] #1'] "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -2660,7 +2769,8 @@ exports['src/cypress/runner retries mochaEvents can retry from [afterEach] #1'] "wallClockStartedAt": "match.date", "file": null, "currentRetry": 1, - "retries": 2 + "retries": 2, + "_slow": 10000 } ], [ @@ -2677,7 +2787,8 @@ exports['src/cypress/runner retries mochaEvents can retry from [afterEach] #1'] "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -2694,7 +2805,8 @@ exports['src/cypress/runner retries mochaEvents can retry from [afterEach] #1'] "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -2711,7 +2823,8 @@ exports['src/cypress/runner retries mochaEvents can retry from [afterEach] #1'] "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -2728,7 +2841,8 @@ exports['src/cypress/runner retries mochaEvents can retry from [afterEach] #1'] "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -2745,7 +2859,8 @@ exports['src/cypress/runner retries mochaEvents can retry from [afterEach] #1'] "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -2769,7 +2884,8 @@ exports['src/cypress/runner retries mochaEvents can retry from [afterEach] #1'] "file": "relative/path/to/spec.js", "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -2786,7 +2902,8 @@ exports['src/cypress/runner retries mochaEvents can retry from [afterEach] #1'] "file": "relative/path/to/spec.js", "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -2834,7 +2951,8 @@ exports['src/cypress/runner retries mochaEvents can retry from [afterEach] #1'] "file": null, "final": true, "currentRetry": 1, - "retries": 2 + "retries": 2, + "_slow": 10000 } ], [ @@ -2882,7 +3000,8 @@ exports['src/cypress/runner retries mochaEvents can retry from [afterEach] #1'] "file": null, "final": true, "currentRetry": 1, - "retries": 2 + "retries": 2, + "_slow": 10000 } ], [ @@ -2931,7 +3050,8 @@ exports['src/cypress/runner retries mochaEvents can retry from [afterEach] #1'] "file": null, "final": true, "currentRetry": 1, - "retries": 2 + "retries": 2, + "_slow": 10000 } ], [ @@ -2946,7 +3066,8 @@ exports['src/cypress/runner retries mochaEvents can retry from [afterEach] #1'] "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -2963,7 +3084,8 @@ exports['src/cypress/runner retries mochaEvents can retry from [afterEach] #1'] "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -2979,7 +3101,8 @@ exports['src/cypress/runner retries mochaEvents can retry from [afterEach] #1'] "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -2996,7 +3119,8 @@ exports['src/cypress/runner retries mochaEvents can retry from [afterEach] #1'] "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -3013,7 +3137,8 @@ exports['src/cypress/runner retries mochaEvents can retry from [afterEach] #1'] "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -3030,7 +3155,8 @@ exports['src/cypress/runner retries mochaEvents can retry from [afterEach] #1'] "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -3047,7 +3173,8 @@ exports['src/cypress/runner retries mochaEvents can retry from [afterEach] #1'] "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -3064,7 +3191,8 @@ exports['src/cypress/runner retries mochaEvents can retry from [afterEach] #1'] "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -3081,7 +3209,8 @@ exports['src/cypress/runner retries mochaEvents can retry from [afterEach] #1'] "file": "relative/path/to/spec.js", "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -3098,7 +3227,8 @@ exports['src/cypress/runner retries mochaEvents can retry from [afterEach] #1'] "file": "relative/path/to/spec.js", "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -3148,7 +3278,8 @@ exports['src/cypress/runner retries mochaEvents can retry from [afterEach] #1'] "invocationDetails": "{Object 8}", "final": true, "currentRetry": 0, - "retries": 2 + "retries": 2, + "_slow": 10000 } ], [ @@ -3198,7 +3329,8 @@ exports['src/cypress/runner retries mochaEvents can retry from [afterEach] #1'] "invocationDetails": "{Object 8}", "final": true, "currentRetry": 0, - "retries": 2 + "retries": 2, + "_slow": 10000 } ], [ @@ -3249,7 +3381,8 @@ exports['src/cypress/runner retries mochaEvents can retry from [afterEach] #1'] "invocationDetails": "{Object 8}", "final": true, "currentRetry": 0, - "retries": 2 + "retries": 2, + "_slow": 10000 } ], [ @@ -3264,7 +3397,8 @@ exports['src/cypress/runner retries mochaEvents can retry from [afterEach] #1'] "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -3281,7 +3415,8 @@ exports['src/cypress/runner retries mochaEvents can retry from [afterEach] #1'] "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -3297,7 +3432,8 @@ exports['src/cypress/runner retries mochaEvents can retry from [afterEach] #1'] "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -3314,7 +3450,8 @@ exports['src/cypress/runner retries mochaEvents can retry from [afterEach] #1'] "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -3331,7 +3468,8 @@ exports['src/cypress/runner retries mochaEvents can retry from [afterEach] #1'] "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -3348,7 +3486,8 @@ exports['src/cypress/runner retries mochaEvents can retry from [afterEach] #1'] "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -3365,7 +3504,8 @@ exports['src/cypress/runner retries mochaEvents can retry from [afterEach] #1'] "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -3382,7 +3522,8 @@ exports['src/cypress/runner retries mochaEvents can retry from [afterEach] #1'] "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -3399,7 +3540,8 @@ exports['src/cypress/runner retries mochaEvents can retry from [afterEach] #1'] "file": "relative/path/to/spec.js", "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -3416,7 +3558,8 @@ exports['src/cypress/runner retries mochaEvents can retry from [afterEach] #1'] "file": "relative/path/to/spec.js", "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -3432,7 +3575,8 @@ exports['src/cypress/runner retries mochaEvents can retry from [afterEach] #1'] "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -3449,7 +3593,8 @@ exports['src/cypress/runner retries mochaEvents can retry from [afterEach] #1'] "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -3506,7 +3651,8 @@ exports['src/cypress/runner retries mochaEvents can retry from [afterEach] #1'] "invocationDetails": "{Object 8}", "final": true, "currentRetry": 0, - "retries": 2 + "retries": 2, + "_slow": 10000 } ], [ @@ -3563,7 +3709,8 @@ exports['src/cypress/runner retries mochaEvents can retry from [afterEach] #1'] "invocationDetails": "{Object 8}", "final": true, "currentRetry": 0, - "retries": 2 + "retries": 2, + "_slow": 10000 } ], [ @@ -3621,7 +3768,8 @@ exports['src/cypress/runner retries mochaEvents can retry from [afterEach] #1'] "invocationDetails": "{Object 8}", "final": true, "currentRetry": 0, - "retries": 2 + "retries": 2, + "_slow": 10000 } ], [ @@ -3634,7 +3782,8 @@ exports['src/cypress/runner retries mochaEvents can retry from [afterEach] #1'] "type": "suite", "file": null, "invocationDetails": "{Object 8}", - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -3647,7 +3796,8 @@ exports['src/cypress/runner retries mochaEvents can retry from [afterEach] #1'] "type": "suite", "file": null, "invocationDetails": "{Object 8}", - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -3662,7 +3812,8 @@ exports['src/cypress/runner retries mochaEvents can retry from [afterEach] #1'] "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -3678,7 +3829,8 @@ exports['src/cypress/runner retries mochaEvents can retry from [afterEach] #1'] "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -3694,7 +3846,8 @@ exports['src/cypress/runner retries mochaEvents can retry from [afterEach] #1'] "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -3741,7 +3894,8 @@ exports['src/cypress/runner retries mochaEvents can retry from [afterEach] #1'] "invocationDetails": "{Object 8}", "final": false, "currentRetry": 0, - "retries": 2 + "retries": 2, + "_slow": 10000 }, { "message": "[error message]", @@ -3772,7 +3926,8 @@ exports['src/cypress/runner retries mochaEvents can retry from [afterEach] #1'] "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -3789,7 +3944,8 @@ exports['src/cypress/runner retries mochaEvents can retry from [afterEach] #1'] "file": "relative/path/to/spec.js", "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -3806,7 +3962,8 @@ exports['src/cypress/runner retries mochaEvents can retry from [afterEach] #1'] "file": "relative/path/to/spec.js", "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -3854,7 +4011,8 @@ exports['src/cypress/runner retries mochaEvents can retry from [afterEach] #1'] "invocationDetails": "{Object 8}", "final": false, "currentRetry": 0, - "retries": 2 + "retries": 2, + "_slow": 10000 } ], [ @@ -3868,7 +4026,8 @@ exports['src/cypress/runner retries mochaEvents can retry from [afterEach] #1'] "wallClockStartedAt": "match.date", "file": null, "currentRetry": 1, - "retries": 2 + "retries": 2, + "_slow": 10000 } ], [ @@ -3892,7 +4051,8 @@ exports['src/cypress/runner retries mochaEvents can retry from [afterEach] #1'] "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -3937,7 +4097,8 @@ exports['src/cypress/runner retries mochaEvents can retry from [afterEach] #1'] "file": null, "final": false, "currentRetry": 1, - "retries": 2 + "retries": 2, + "_slow": 10000 }, { "message": "[error message]", @@ -3968,7 +4129,8 @@ exports['src/cypress/runner retries mochaEvents can retry from [afterEach] #1'] "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -3985,7 +4147,8 @@ exports['src/cypress/runner retries mochaEvents can retry from [afterEach] #1'] "file": "relative/path/to/spec.js", "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -4002,7 +4165,8 @@ exports['src/cypress/runner retries mochaEvents can retry from [afterEach] #1'] "file": "relative/path/to/spec.js", "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -4048,7 +4212,8 @@ exports['src/cypress/runner retries mochaEvents can retry from [afterEach] #1'] "file": null, "final": false, "currentRetry": 1, - "retries": 2 + "retries": 2, + "_slow": 10000 } ], [ @@ -4062,7 +4227,8 @@ exports['src/cypress/runner retries mochaEvents can retry from [afterEach] #1'] "wallClockStartedAt": "match.date", "file": null, "currentRetry": 2, - "retries": 2 + "retries": 2, + "_slow": 10000 } ], [ @@ -4086,7 +4252,8 @@ exports['src/cypress/runner retries mochaEvents can retry from [afterEach] #1'] "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -4103,7 +4270,8 @@ exports['src/cypress/runner retries mochaEvents can retry from [afterEach] #1'] "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -4120,7 +4288,8 @@ exports['src/cypress/runner retries mochaEvents can retry from [afterEach] #1'] "file": "relative/path/to/spec.js", "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -4137,7 +4306,8 @@ exports['src/cypress/runner retries mochaEvents can retry from [afterEach] #1'] "file": "relative/path/to/spec.js", "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -4173,7 +4343,8 @@ exports['src/cypress/runner retries mochaEvents can retry from [afterEach] #1'] "file": null, "final": true, "currentRetry": 2, - "retries": 2 + "retries": 2, + "_slow": 10000 } ], [ @@ -4209,7 +4380,8 @@ exports['src/cypress/runner retries mochaEvents can retry from [afterEach] #1'] "file": null, "final": true, "currentRetry": 2, - "retries": 2 + "retries": 2, + "_slow": 10000 } ], [ @@ -4246,7 +4418,8 @@ exports['src/cypress/runner retries mochaEvents can retry from [afterEach] #1'] "file": null, "final": true, "currentRetry": 2, - "retries": 2 + "retries": 2, + "_slow": 10000 } ], [ @@ -4259,7 +4432,8 @@ exports['src/cypress/runner retries mochaEvents can retry from [afterEach] #1'] "type": "suite", "file": null, "invocationDetails": "{Object 8}", - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -4272,7 +4446,8 @@ exports['src/cypress/runner retries mochaEvents can retry from [afterEach] #1'] "type": "suite", "file": null, "invocationDetails": "{Object 8}", - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -4287,7 +4462,8 @@ exports['src/cypress/runner retries mochaEvents can retry from [afterEach] #1'] "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -4303,7 +4479,8 @@ exports['src/cypress/runner retries mochaEvents can retry from [afterEach] #1'] "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -4320,7 +4497,8 @@ exports['src/cypress/runner retries mochaEvents can retry from [afterEach] #1'] "file": "relative/path/to/spec.js", "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -4337,7 +4515,8 @@ exports['src/cypress/runner retries mochaEvents can retry from [afterEach] #1'] "file": "relative/path/to/spec.js", "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -4370,7 +4549,8 @@ exports['src/cypress/runner retries mochaEvents can retry from [afterEach] #1'] "invocationDetails": "{Object 8}", "final": true, "currentRetry": 0, - "retries": 2 + "retries": 2, + "_slow": 10000 } ], [ @@ -4403,7 +4583,8 @@ exports['src/cypress/runner retries mochaEvents can retry from [afterEach] #1'] "invocationDetails": "{Object 8}", "final": true, "currentRetry": 0, - "retries": 2 + "retries": 2, + "_slow": 10000 } ], [ @@ -4416,7 +4597,8 @@ exports['src/cypress/runner retries mochaEvents can retry from [afterEach] #1'] "type": "suite", "file": null, "invocationDetails": "{Object 8}", - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -4450,7 +4632,8 @@ exports['src/cypress/runner retries mochaEvents can retry from [afterEach] #1'] "invocationDetails": "{Object 8}", "final": true, "currentRetry": 0, - "retries": 2 + "retries": 2, + "_slow": 10000 } ], [ @@ -4462,7 +4645,8 @@ exports['src/cypress/runner retries mochaEvents can retry from [afterEach] #1'] "root": true, "type": "suite", "file": "relative/path/to/spec.js", - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -4491,7 +4675,8 @@ exports['src/cypress/runner retries mochaEvents cant retry from [before] #1'] = "root": true, "type": "suite", "file": "relative/path/to/spec.js", - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -4504,7 +4689,8 @@ exports['src/cypress/runner retries mochaEvents cant retry from [before] #1'] = "type": "suite", "file": null, "invocationDetails": "{Object 8}", - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -4520,7 +4706,8 @@ exports['src/cypress/runner retries mochaEvents cant retry from [before] #1'] = "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -4536,7 +4723,8 @@ exports['src/cypress/runner retries mochaEvents cant retry from [before] #1'] = "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -4562,7 +4750,8 @@ exports['src/cypress/runner retries mochaEvents cant retry from [before] #1'] = "originalTitle": "\"before all\" hook", "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 }, { "message": "[error message]", @@ -4585,7 +4774,8 @@ exports['src/cypress/runner retries mochaEvents cant retry from [before] #1'] = "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -4602,7 +4792,8 @@ exports['src/cypress/runner retries mochaEvents cant retry from [before] #1'] = "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -4615,7 +4806,8 @@ exports['src/cypress/runner retries mochaEvents cant retry from [before] #1'] = "type": "suite", "file": null, "invocationDetails": "{Object 8}", - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -4660,7 +4852,8 @@ exports['src/cypress/runner retries mochaEvents cant retry from [before] #1'] = "invocationDetails": "{Object 8}", "final": true, "currentRetry": 0, - "retries": 1 + "retries": 1, + "_slow": 10000 } ], [ @@ -4706,7 +4899,8 @@ exports['src/cypress/runner retries mochaEvents cant retry from [before] #1'] = "invocationDetails": "{Object 8}", "final": true, "currentRetry": 0, - "retries": 1 + "retries": 1, + "_slow": 10000 } ], [ @@ -4718,7 +4912,8 @@ exports['src/cypress/runner retries mochaEvents cant retry from [before] #1'] = "root": true, "type": "suite", "file": "relative/path/to/spec.js", - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -4747,7 +4942,8 @@ exports['src/cypress/runner retries mochaEvents cant retry from [after] #1'] = [ "root": true, "type": "suite", "file": "relative/path/to/spec.js", - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -4760,7 +4956,8 @@ exports['src/cypress/runner retries mochaEvents cant retry from [after] #1'] = [ "type": "suite", "file": null, "invocationDetails": "{Object 8}", - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -4776,7 +4973,8 @@ exports['src/cypress/runner retries mochaEvents cant retry from [after] #1'] = [ "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -4792,7 +4990,8 @@ exports['src/cypress/runner retries mochaEvents cant retry from [after] #1'] = [ "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -4809,7 +5008,8 @@ exports['src/cypress/runner retries mochaEvents cant retry from [after] #1'] = [ "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -4870,7 +5070,8 @@ exports['src/cypress/runner retries mochaEvents cant retry from [after] #1'] = [ "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": 1 + "retries": 1, + "_slow": 10000 } ], [ @@ -4886,7 +5087,8 @@ exports['src/cypress/runner retries mochaEvents cant retry from [after] #1'] = [ "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -4903,7 +5105,8 @@ exports['src/cypress/runner retries mochaEvents cant retry from [after] #1'] = [ "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -4919,7 +5122,8 @@ exports['src/cypress/runner retries mochaEvents cant retry from [after] #1'] = [ "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -4936,7 +5140,8 @@ exports['src/cypress/runner retries mochaEvents cant retry from [after] #1'] = [ "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -4952,7 +5157,8 @@ exports['src/cypress/runner retries mochaEvents cant retry from [after] #1'] = [ "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -4969,7 +5175,8 @@ exports['src/cypress/runner retries mochaEvents cant retry from [after] #1'] = [ "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -4985,7 +5192,8 @@ exports['src/cypress/runner retries mochaEvents cant retry from [after] #1'] = [ "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -5002,7 +5210,8 @@ exports['src/cypress/runner retries mochaEvents cant retry from [after] #1'] = [ "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -5018,7 +5227,8 @@ exports['src/cypress/runner retries mochaEvents cant retry from [after] #1'] = [ "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -5044,7 +5254,8 @@ exports['src/cypress/runner retries mochaEvents cant retry from [after] #1'] = [ "originalTitle": "\"after all\" hook", "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 }, { "message": "[error message]", @@ -5124,7 +5335,8 @@ exports['src/cypress/runner retries mochaEvents cant retry from [after] #1'] = [ "invocationDetails": "{Object 8}", "final": true, "currentRetry": 0, - "retries": 1 + "retries": 1, + "_slow": 10000 } ], [ @@ -5137,7 +5349,8 @@ exports['src/cypress/runner retries mochaEvents cant retry from [after] #1'] = [ "type": "suite", "file": null, "invocationDetails": "{Object 8}", - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -5211,7 +5424,8 @@ exports['src/cypress/runner retries mochaEvents cant retry from [after] #1'] = [ "invocationDetails": "{Object 8}", "final": true, "currentRetry": 0, - "retries": 1 + "retries": 1, + "_slow": 10000 } ], [ @@ -5223,7 +5437,8 @@ exports['src/cypress/runner retries mochaEvents cant retry from [after] #1'] = [ "root": true, "type": "suite", "file": "relative/path/to/spec.js", - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -5252,7 +5467,8 @@ exports['src/cypress/runner retries mochaEvents three tests with retry #1'] = [ "root": true, "type": "suite", "file": "relative/path/to/spec.js", - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -5265,7 +5481,8 @@ exports['src/cypress/runner retries mochaEvents three tests with retry #1'] = [ "type": "suite", "file": null, "invocationDetails": "{Object 8}", - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -5281,7 +5498,8 @@ exports['src/cypress/runner retries mochaEvents three tests with retry #1'] = [ "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -5297,7 +5515,8 @@ exports['src/cypress/runner retries mochaEvents three tests with retry #1'] = [ "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -5314,7 +5533,8 @@ exports['src/cypress/runner retries mochaEvents three tests with retry #1'] = [ "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -5358,7 +5578,8 @@ exports['src/cypress/runner retries mochaEvents three tests with retry #1'] = [ "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": 2 + "retries": 2, + "_slow": 10000 } ], [ @@ -5374,7 +5595,8 @@ exports['src/cypress/runner retries mochaEvents three tests with retry #1'] = [ "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -5391,7 +5613,8 @@ exports['src/cypress/runner retries mochaEvents three tests with retry #1'] = [ "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -5407,7 +5630,8 @@ exports['src/cypress/runner retries mochaEvents three tests with retry #1'] = [ "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -5424,7 +5648,8 @@ exports['src/cypress/runner retries mochaEvents three tests with retry #1'] = [ "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -5471,7 +5696,8 @@ exports['src/cypress/runner retries mochaEvents three tests with retry #1'] = [ "invocationDetails": "{Object 8}", "final": true, "currentRetry": 0, - "retries": 2 + "retries": 2, + "_slow": 10000 } ], [ @@ -5518,7 +5744,8 @@ exports['src/cypress/runner retries mochaEvents three tests with retry #1'] = [ "invocationDetails": "{Object 8}", "final": true, "currentRetry": 0, - "retries": 2 + "retries": 2, + "_slow": 10000 } ], [ @@ -5566,7 +5793,8 @@ exports['src/cypress/runner retries mochaEvents three tests with retry #1'] = [ "invocationDetails": "{Object 8}", "final": true, "currentRetry": 0, - "retries": 2 + "retries": 2, + "_slow": 10000 } ], [ @@ -5581,7 +5809,8 @@ exports['src/cypress/runner retries mochaEvents three tests with retry #1'] = [ "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -5598,7 +5827,8 @@ exports['src/cypress/runner retries mochaEvents three tests with retry #1'] = [ "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -5614,7 +5844,8 @@ exports['src/cypress/runner retries mochaEvents three tests with retry #1'] = [ "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -5631,7 +5862,8 @@ exports['src/cypress/runner retries mochaEvents three tests with retry #1'] = [ "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -5678,7 +5910,8 @@ exports['src/cypress/runner retries mochaEvents three tests with retry #1'] = [ "invocationDetails": "{Object 8}", "final": false, "currentRetry": 0, - "retries": 2 + "retries": 2, + "_slow": 10000 }, { "message": "[error message]", @@ -5702,7 +5935,8 @@ exports['src/cypress/runner retries mochaEvents three tests with retry #1'] = [ "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -5719,7 +5953,8 @@ exports['src/cypress/runner retries mochaEvents three tests with retry #1'] = [ "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -5767,7 +6002,8 @@ exports['src/cypress/runner retries mochaEvents three tests with retry #1'] = [ "invocationDetails": "{Object 8}", "final": false, "currentRetry": 0, - "retries": 2 + "retries": 2, + "_slow": 10000 } ], [ @@ -5784,7 +6020,8 @@ exports['src/cypress/runner retries mochaEvents three tests with retry #1'] = [ "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -5798,7 +6035,8 @@ exports['src/cypress/runner retries mochaEvents three tests with retry #1'] = [ "wallClockStartedAt": "match.date", "file": null, "currentRetry": 1, - "retries": 2 + "retries": 2, + "_slow": 10000 } ], [ @@ -5815,7 +6053,8 @@ exports['src/cypress/runner retries mochaEvents three tests with retry #1'] = [ "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -5860,7 +6099,8 @@ exports['src/cypress/runner retries mochaEvents three tests with retry #1'] = [ "file": null, "final": false, "currentRetry": 1, - "retries": 2 + "retries": 2, + "_slow": 10000 }, { "message": "[error message]", @@ -5884,7 +6124,8 @@ exports['src/cypress/runner retries mochaEvents three tests with retry #1'] = [ "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -5901,7 +6142,8 @@ exports['src/cypress/runner retries mochaEvents three tests with retry #1'] = [ "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -5947,7 +6189,8 @@ exports['src/cypress/runner retries mochaEvents three tests with retry #1'] = [ "file": null, "final": false, "currentRetry": 1, - "retries": 2 + "retries": 2, + "_slow": 10000 } ], [ @@ -5964,7 +6207,8 @@ exports['src/cypress/runner retries mochaEvents three tests with retry #1'] = [ "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -5978,7 +6222,8 @@ exports['src/cypress/runner retries mochaEvents three tests with retry #1'] = [ "wallClockStartedAt": "match.date", "file": null, "currentRetry": 2, - "retries": 2 + "retries": 2, + "_slow": 10000 } ], [ @@ -5995,7 +6240,8 @@ exports['src/cypress/runner retries mochaEvents three tests with retry #1'] = [ "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -6012,7 +6258,8 @@ exports['src/cypress/runner retries mochaEvents three tests with retry #1'] = [ "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -6029,7 +6276,8 @@ exports['src/cypress/runner retries mochaEvents three tests with retry #1'] = [ "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -6067,7 +6315,8 @@ exports['src/cypress/runner retries mochaEvents three tests with retry #1'] = [ "file": null, "final": true, "currentRetry": 2, - "retries": 2 + "retries": 2, + "_slow": 10000 } ], [ @@ -6105,7 +6354,8 @@ exports['src/cypress/runner retries mochaEvents three tests with retry #1'] = [ "file": null, "final": true, "currentRetry": 2, - "retries": 2 + "retries": 2, + "_slow": 10000 } ], [ @@ -6144,7 +6394,8 @@ exports['src/cypress/runner retries mochaEvents three tests with retry #1'] = [ "file": null, "final": true, "currentRetry": 2, - "retries": 2 + "retries": 2, + "_slow": 10000 } ], [ @@ -6159,7 +6410,8 @@ exports['src/cypress/runner retries mochaEvents three tests with retry #1'] = [ "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -6176,7 +6428,8 @@ exports['src/cypress/runner retries mochaEvents three tests with retry #1'] = [ "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -6192,7 +6445,8 @@ exports['src/cypress/runner retries mochaEvents three tests with retry #1'] = [ "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -6209,7 +6463,8 @@ exports['src/cypress/runner retries mochaEvents three tests with retry #1'] = [ "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -6226,7 +6481,8 @@ exports['src/cypress/runner retries mochaEvents three tests with retry #1'] = [ "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -6243,7 +6499,8 @@ exports['src/cypress/runner retries mochaEvents three tests with retry #1'] = [ "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -6259,7 +6516,8 @@ exports['src/cypress/runner retries mochaEvents three tests with retry #1'] = [ "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -6276,7 +6534,8 @@ exports['src/cypress/runner retries mochaEvents three tests with retry #1'] = [ "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -6323,7 +6582,8 @@ exports['src/cypress/runner retries mochaEvents three tests with retry #1'] = [ "invocationDetails": "{Object 8}", "final": true, "currentRetry": 0, - "retries": 2 + "retries": 2, + "_slow": 10000 } ], [ @@ -6370,7 +6630,8 @@ exports['src/cypress/runner retries mochaEvents three tests with retry #1'] = [ "invocationDetails": "{Object 8}", "final": true, "currentRetry": 0, - "retries": 2 + "retries": 2, + "_slow": 10000 } ], [ @@ -6383,7 +6644,8 @@ exports['src/cypress/runner retries mochaEvents three tests with retry #1'] = [ "type": "suite", "file": null, "invocationDetails": "{Object 8}", - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -6431,7 +6693,8 @@ exports['src/cypress/runner retries mochaEvents three tests with retry #1'] = [ "invocationDetails": "{Object 8}", "final": true, "currentRetry": 0, - "retries": 2 + "retries": 2, + "_slow": 10000 } ], [ @@ -6443,7 +6706,8 @@ exports['src/cypress/runner retries mochaEvents three tests with retry #1'] = [ "root": true, "type": "suite", "file": "relative/path/to/spec.js", - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -6476,8 +6740,8 @@ exports['src/cypress/runner retries mochaEvents screenshots retry screenshot in "height": 660 }, "scaled": false, - "overwrite": false, "blackout": [], + "overwrite": false, "startTime": "match.string", "current": 1, "total": 1 @@ -6496,133 +6760,6 @@ exports['src/cypress/runner retries mochaEvents screenshots retry screenshot in "overwrite": false } -exports['serialize state - retries'] = { - "currentId": "r6", - "tests": { - "r3": { - "id": "r3", - "order": 1, - "title": "test 1", - "state": "passed", - "body": "[body]", - "type": "test", - "duration": 1, - "wallClockStartedAt": "1970-01-01T00:00:00.000Z", - "wallClockDuration": 1, - "timings": { - "lifecycle": 1, - "before all": [ - { - "hookId": "h1", - "fnDuration": 1, - "afterFnDuration": 1 - } - ], - "before each": [ - { - "hookId": "h2", - "fnDuration": 1, - "afterFnDuration": 1 - } - ], - "test": { - "fnDuration": 1, - "afterFnDuration": 1 - }, - "after each": [ - { - "hookId": "h4", - "fnDuration": 1, - "afterFnDuration": 1 - } - ], - "after all": [ - { - "hookId": "h3", - "fnDuration": 1, - "afterFnDuration": 1 - } - ] - }, - "file": null, - "invocationDetails": "{Object 8}", - "final": true, - "currentRetry": 0, - "retries": 1, - "hooks": [], - "prevAttempts": [] - }, - "r5": { - "id": "r5", - "title": "test 1", - "state": "passed", - "body": "[body]", - "type": "test", - "duration": 1, - "wallClockStartedAt": "1970-01-01T00:00:00.000Z", - "wallClockDuration": 1, - "timings": { - "lifecycle": 1, - "test": { - "fnDuration": 1, - "afterFnDuration": 1 - } - }, - "file": null, - "final": true, - "currentRetry": 1, - "retries": 1, - "prevAttempts": [ - { - "id": "r5", - "order": 2, - "title": "test 1", - "err": "{Object 9}", - "state": "failed", - "body": "[body]", - "type": "test", - "duration": 1, - "wallClockStartedAt": "1970-01-01T00:00:00.000Z", - "wallClockDuration": 1, - "timings": { - "lifecycle": 1, - "test": { - "fnDuration": 1, - "afterFnDuration": 1 - } - }, - "file": null, - "invocationDetails": "{Object 8}", - "final": false, - "currentRetry": 0, - "retries": 1, - "hooks": [] - } - ] - } - }, - "startTime": "1970-01-01T00:00:00.000Z", - "emissions": { - "started": { - "r1": true, - "r2": true, - "r3": true, - "r4": true, - "r5": true, - "r6": true - }, - "ended": { - "r3": true, - "r2": true, - "r5": true - } - }, - "passed": 2, - "failed": 0, - "pending": 0, - "numLogs": 0 -} - exports['src/cypress/runner retries mochaEvents cleanses errors before emitting does not try to serialize error with err.actual as DOM node #1'] = [ [ "mocha", @@ -6640,7 +6777,8 @@ exports['src/cypress/runner retries mochaEvents cleanses errors before emitting "root": true, "type": "suite", "file": "relative/path/to/spec.js", - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -6655,7 +6793,8 @@ exports['src/cypress/runner retries mochaEvents cleanses errors before emitting "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -6671,7 +6810,8 @@ exports['src/cypress/runner retries mochaEvents cleanses errors before emitting "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -6704,7 +6844,8 @@ exports['src/cypress/runner retries mochaEvents cleanses errors before emitting "invocationDetails": "{Object 8}", "final": false, "currentRetry": 0, - "retries": 2 + "retries": 2, + "_slow": 10000 }, { "message": "[error message]", @@ -6745,7 +6886,8 @@ exports['src/cypress/runner retries mochaEvents cleanses errors before emitting "invocationDetails": "{Object 8}", "final": false, "currentRetry": 0, - "retries": 2 + "retries": 2, + "_slow": 10000 } ], [ @@ -6759,7 +6901,8 @@ exports['src/cypress/runner retries mochaEvents cleanses errors before emitting "wallClockStartedAt": "match.date", "file": null, "currentRetry": 1, - "retries": 2 + "retries": 2, + "_slow": 10000 } ], [ @@ -6790,7 +6933,8 @@ exports['src/cypress/runner retries mochaEvents cleanses errors before emitting "file": null, "final": false, "currentRetry": 1, - "retries": 2 + "retries": 2, + "_slow": 10000 }, { "message": "[error message]", @@ -6829,7 +6973,8 @@ exports['src/cypress/runner retries mochaEvents cleanses errors before emitting "file": null, "final": false, "currentRetry": 1, - "retries": 2 + "retries": 2, + "_slow": 10000 } ], [ @@ -6843,7 +6988,8 @@ exports['src/cypress/runner retries mochaEvents cleanses errors before emitting "wallClockStartedAt": "match.date", "file": null, "currentRetry": 2, - "retries": 2 + "retries": 2, + "_slow": 10000 } ], [ @@ -6873,7 +7019,8 @@ exports['src/cypress/runner retries mochaEvents cleanses errors before emitting }, "file": null, "currentRetry": 2, - "retries": 2 + "retries": 2, + "_slow": 10000 }, { "message": "[error message]", @@ -6911,7 +7058,8 @@ exports['src/cypress/runner retries mochaEvents cleanses errors before emitting "file": null, "final": true, "currentRetry": 2, - "retries": 2 + "retries": 2, + "_slow": 10000 } ], [ @@ -6943,7 +7091,8 @@ exports['src/cypress/runner retries mochaEvents cleanses errors before emitting "file": null, "final": true, "currentRetry": 2, - "retries": 2 + "retries": 2, + "_slow": 10000 } ], [ @@ -6955,7 +7104,8 @@ exports['src/cypress/runner retries mochaEvents cleanses errors before emitting "root": true, "type": "suite", "file": "relative/path/to/spec.js", - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -6966,3 +7116,28 @@ exports['src/cypress/runner retries mochaEvents cleanses errors before emitting } ] ] + +exports['serialize state - retries'] = { + "currentId": "r6", + "tests": "{Object 2}", + "startTime": "1970-01-01T00:00:00.000Z", + "emissions": { + "started": { + "r1": true, + "r2": true, + "r3": true, + "r4": true, + "r5": true, + "r6": true + }, + "ended": { + "r3": true, + "r2": true, + "r5": true + } + }, + "passed": 2, + "failed": 0, + "pending": 0, + "numLogs": 0 +} diff --git a/packages/runner/__snapshots__/runner.mochaEvents.spec.js b/packages/runner/__snapshots__/runner.mochaEvents.spec.js index ab30d3da35c3..8aa18f1f22a7 100644 --- a/packages/runner/__snapshots__/runner.mochaEvents.spec.js +++ b/packages/runner/__snapshots__/runner.mochaEvents.spec.js @@ -15,7 +15,8 @@ exports['src/cypress/runner tests finish with correct state hook failures fail i "root": true, "type": "suite", "file": "relative/path/to/spec.js", - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -28,7 +29,8 @@ exports['src/cypress/runner tests finish with correct state hook failures fail i "type": "suite", "file": null, "invocationDetails": "{Object 8}", - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -44,7 +46,8 @@ exports['src/cypress/runner tests finish with correct state hook failures fail i "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -60,7 +63,8 @@ exports['src/cypress/runner tests finish with correct state hook failures fail i "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -86,7 +90,8 @@ exports['src/cypress/runner tests finish with correct state hook failures fail i "originalTitle": "\"before all\" hook", "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 }, { "message": "[error message]", @@ -106,7 +111,8 @@ exports['src/cypress/runner tests finish with correct state hook failures fail i "type": "suite", "file": null, "invocationDetails": "{Object 8}", - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -144,7 +150,8 @@ exports['src/cypress/runner tests finish with correct state hook failures fail i "invocationDetails": "{Object 8}", "final": true, "currentRetry": 0, - "retries": 0 + "retries": 0, + "_slow": 10000 } ], [ @@ -183,7 +190,8 @@ exports['src/cypress/runner tests finish with correct state hook failures fail i "invocationDetails": "{Object 8}", "final": true, "currentRetry": 0, - "retries": 0 + "retries": 0, + "_slow": 10000 } ], [ @@ -195,7 +203,8 @@ exports['src/cypress/runner tests finish with correct state hook failures fail i "root": true, "type": "suite", "file": "relative/path/to/spec.js", - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -224,7 +233,8 @@ exports['src/cypress/runner tests finish with correct state hook failures fail i "root": true, "type": "suite", "file": "relative/path/to/spec.js", - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -237,7 +247,8 @@ exports['src/cypress/runner tests finish with correct state hook failures fail i "type": "suite", "file": null, "invocationDetails": "{Object 8}", - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -252,7 +263,8 @@ exports['src/cypress/runner tests finish with correct state hook failures fail i "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -268,7 +280,8 @@ exports['src/cypress/runner tests finish with correct state hook failures fail i "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -284,7 +297,8 @@ exports['src/cypress/runner tests finish with correct state hook failures fail i "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -310,7 +324,8 @@ exports['src/cypress/runner tests finish with correct state hook failures fail i "originalTitle": "\"before each\" hook", "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 }, { "message": "[error message]", @@ -355,7 +370,8 @@ exports['src/cypress/runner tests finish with correct state hook failures fail i "invocationDetails": "{Object 8}", "final": true, "currentRetry": 0, - "retries": 0 + "retries": 0, + "_slow": 10000 } ], [ @@ -368,7 +384,8 @@ exports['src/cypress/runner tests finish with correct state hook failures fail i "type": "suite", "file": null, "invocationDetails": "{Object 8}", - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -407,7 +424,8 @@ exports['src/cypress/runner tests finish with correct state hook failures fail i "invocationDetails": "{Object 8}", "final": true, "currentRetry": 0, - "retries": 0 + "retries": 0, + "_slow": 10000 } ], [ @@ -419,7 +437,8 @@ exports['src/cypress/runner tests finish with correct state hook failures fail i "root": true, "type": "suite", "file": "relative/path/to/spec.js", - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -448,7 +467,8 @@ exports['src/cypress/runner tests finish with correct state hook failures fail i "root": true, "type": "suite", "file": "relative/path/to/spec.js", - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -461,7 +481,8 @@ exports['src/cypress/runner tests finish with correct state hook failures fail i "type": "suite", "file": null, "invocationDetails": "{Object 8}", - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -476,7 +497,8 @@ exports['src/cypress/runner tests finish with correct state hook failures fail i "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -492,7 +514,8 @@ exports['src/cypress/runner tests finish with correct state hook failures fail i "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -508,7 +531,8 @@ exports['src/cypress/runner tests finish with correct state hook failures fail i "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -534,7 +558,8 @@ exports['src/cypress/runner tests finish with correct state hook failures fail i "originalTitle": "\"after each\" hook", "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 }, { "message": "[error message]", @@ -583,7 +608,8 @@ exports['src/cypress/runner tests finish with correct state hook failures fail i "invocationDetails": "{Object 8}", "final": true, "currentRetry": 0, - "retries": 0 + "retries": 0, + "_slow": 10000 } ], [ @@ -596,7 +622,8 @@ exports['src/cypress/runner tests finish with correct state hook failures fail i "type": "suite", "file": null, "invocationDetails": "{Object 8}", - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -639,7 +666,8 @@ exports['src/cypress/runner tests finish with correct state hook failures fail i "invocationDetails": "{Object 8}", "final": true, "currentRetry": 0, - "retries": 0 + "retries": 0, + "_slow": 10000 } ], [ @@ -651,7 +679,8 @@ exports['src/cypress/runner tests finish with correct state hook failures fail i "root": true, "type": "suite", "file": "relative/path/to/spec.js", - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -680,7 +709,8 @@ exports['src/cypress/runner tests finish with correct state hook failures fail i "root": true, "type": "suite", "file": "relative/path/to/spec.js", - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -693,7 +723,8 @@ exports['src/cypress/runner tests finish with correct state hook failures fail i "type": "suite", "file": null, "invocationDetails": "{Object 8}", - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -708,7 +739,8 @@ exports['src/cypress/runner tests finish with correct state hook failures fail i "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -724,7 +756,8 @@ exports['src/cypress/runner tests finish with correct state hook failures fail i "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -750,7 +783,8 @@ exports['src/cypress/runner tests finish with correct state hook failures fail i "invocationDetails": "{Object 8}", "final": true, "currentRetry": 0, - "retries": 0 + "retries": 0, + "_slow": 10000 } ], [ @@ -776,7 +810,8 @@ exports['src/cypress/runner tests finish with correct state hook failures fail i "invocationDetails": "{Object 8}", "final": true, "currentRetry": 0, - "retries": 0 + "retries": 0, + "_slow": 10000 } ], [ @@ -803,7 +838,8 @@ exports['src/cypress/runner tests finish with correct state hook failures fail i "invocationDetails": "{Object 8}", "final": true, "currentRetry": 0, - "retries": 0 + "retries": 0, + "_slow": 10000 } ], [ @@ -818,7 +854,8 @@ exports['src/cypress/runner tests finish with correct state hook failures fail i "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -834,7 +871,8 @@ exports['src/cypress/runner tests finish with correct state hook failures fail i "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -850,7 +888,8 @@ exports['src/cypress/runner tests finish with correct state hook failures fail i "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -876,7 +915,8 @@ exports['src/cypress/runner tests finish with correct state hook failures fail i "originalTitle": "\"after all\" hook", "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 }, { "message": "[error message]", @@ -925,7 +965,8 @@ exports['src/cypress/runner tests finish with correct state hook failures fail i "invocationDetails": "{Object 8}", "final": true, "currentRetry": 0, - "retries": 0 + "retries": 0, + "_slow": 10000 } ], [ @@ -938,7 +979,8 @@ exports['src/cypress/runner tests finish with correct state hook failures fail i "type": "suite", "file": null, "invocationDetails": "{Object 8}", - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -981,7 +1023,8 @@ exports['src/cypress/runner tests finish with correct state hook failures fail i "invocationDetails": "{Object 8}", "final": true, "currentRetry": 0, - "retries": 0 + "retries": 0, + "_slow": 10000 } ], [ @@ -993,7 +1036,8 @@ exports['src/cypress/runner tests finish with correct state hook failures fail i "root": true, "type": "suite", "file": "relative/path/to/spec.js", - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -1022,7 +1066,8 @@ exports['src/cypress/runner tests finish with correct state mocha grep fail with "root": true, "type": "suite", "file": "relative/path/to/spec.js", - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -1035,7 +1080,8 @@ exports['src/cypress/runner tests finish with correct state mocha grep fail with "type": "suite", "file": null, "invocationDetails": "{Object 8}", - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -1051,7 +1097,8 @@ exports['src/cypress/runner tests finish with correct state mocha grep fail with "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -1067,7 +1114,8 @@ exports['src/cypress/runner tests finish with correct state mocha grep fail with "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -1084,7 +1132,8 @@ exports['src/cypress/runner tests finish with correct state mocha grep fail with "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -1135,7 +1184,8 @@ exports['src/cypress/runner tests finish with correct state mocha grep fail with "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": 0 + "retries": 0, + "_slow": 10000 } ], [ @@ -1151,7 +1201,8 @@ exports['src/cypress/runner tests finish with correct state mocha grep fail with "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -1168,7 +1219,8 @@ exports['src/cypress/runner tests finish with correct state mocha grep fail with "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -1228,7 +1280,8 @@ exports['src/cypress/runner tests finish with correct state mocha grep fail with "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": 0 + "retries": 0, + "_slow": 10000 }, { "message": "[error message]", @@ -1251,7 +1304,8 @@ exports['src/cypress/runner tests finish with correct state mocha grep fail with "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -1268,7 +1322,8 @@ exports['src/cypress/runner tests finish with correct state mocha grep fail with "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -1284,7 +1339,8 @@ exports['src/cypress/runner tests finish with correct state mocha grep fail with "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -1301,7 +1357,8 @@ exports['src/cypress/runner tests finish with correct state mocha grep fail with "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -1362,7 +1419,8 @@ exports['src/cypress/runner tests finish with correct state mocha grep fail with "invocationDetails": "{Object 8}", "final": true, "currentRetry": 0, - "retries": 0 + "retries": 0, + "_slow": 10000 } ], [ @@ -1375,7 +1433,8 @@ exports['src/cypress/runner tests finish with correct state mocha grep fail with "type": "suite", "file": null, "invocationDetails": "{Object 8}", - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -1437,7 +1496,8 @@ exports['src/cypress/runner tests finish with correct state mocha grep fail with "invocationDetails": "{Object 8}", "final": true, "currentRetry": 0, - "retries": 0 + "retries": 0, + "_slow": 10000 } ], [ @@ -1449,7 +1509,8 @@ exports['src/cypress/runner tests finish with correct state mocha grep fail with "root": true, "type": "suite", "file": "relative/path/to/spec.js", - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -1478,7 +1539,8 @@ exports['src/cypress/runner tests finish with correct state mocha grep pass with "root": true, "type": "suite", "file": "relative/path/to/spec.js", - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -1491,7 +1553,8 @@ exports['src/cypress/runner tests finish with correct state mocha grep pass with "type": "suite", "file": null, "invocationDetails": "{Object 8}", - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -1507,7 +1570,8 @@ exports['src/cypress/runner tests finish with correct state mocha grep pass with "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -1523,7 +1587,8 @@ exports['src/cypress/runner tests finish with correct state mocha grep pass with "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -1540,7 +1605,8 @@ exports['src/cypress/runner tests finish with correct state mocha grep pass with "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -1591,7 +1657,8 @@ exports['src/cypress/runner tests finish with correct state mocha grep pass with "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": 0 + "retries": 0, + "_slow": 10000 } ], [ @@ -1607,7 +1674,8 @@ exports['src/cypress/runner tests finish with correct state mocha grep pass with "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -1624,7 +1692,8 @@ exports['src/cypress/runner tests finish with correct state mocha grep pass with "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -1640,7 +1709,8 @@ exports['src/cypress/runner tests finish with correct state mocha grep pass with "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -1657,7 +1727,8 @@ exports['src/cypress/runner tests finish with correct state mocha grep pass with "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -1673,7 +1744,8 @@ exports['src/cypress/runner tests finish with correct state mocha grep pass with "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -1690,7 +1762,8 @@ exports['src/cypress/runner tests finish with correct state mocha grep pass with "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -1744,7 +1817,8 @@ exports['src/cypress/runner tests finish with correct state mocha grep pass with "invocationDetails": "{Object 8}", "final": true, "currentRetry": 0, - "retries": 0 + "retries": 0, + "_slow": 10000 } ], [ @@ -1798,7 +1872,8 @@ exports['src/cypress/runner tests finish with correct state mocha grep pass with "invocationDetails": "{Object 8}", "final": true, "currentRetry": 0, - "retries": 0 + "retries": 0, + "_slow": 10000 } ], [ @@ -1811,7 +1886,8 @@ exports['src/cypress/runner tests finish with correct state mocha grep pass with "type": "suite", "file": null, "invocationDetails": "{Object 8}", - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -1866,7 +1942,8 @@ exports['src/cypress/runner tests finish with correct state mocha grep pass with "invocationDetails": "{Object 8}", "final": true, "currentRetry": 0, - "retries": 0 + "retries": 0, + "_slow": 10000 } ], [ @@ -1878,7 +1955,8 @@ exports['src/cypress/runner tests finish with correct state mocha grep pass with "root": true, "type": "suite", "file": "relative/path/to/spec.js", - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -1939,8 +2017,8 @@ exports['src/cypress/runner other specs screenshots screenshot after failed test "height": 660 }, "scaled": true, - "overwrite": false, "blackout": [], + "overwrite": false, "startTime": "1970-01-01T00:00:00.000Z" } ] @@ -1963,7 +2041,8 @@ exports['src/cypress/runner mocha events simple single test #1'] = [ "root": true, "type": "suite", "file": "relative/path/to/spec.js", - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -1976,7 +2055,8 @@ exports['src/cypress/runner mocha events simple single test #1'] = [ "type": "suite", "file": null, "invocationDetails": "{Object 8}", - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -1991,7 +2071,8 @@ exports['src/cypress/runner mocha events simple single test #1'] = [ "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -2007,7 +2088,8 @@ exports['src/cypress/runner mocha events simple single test #1'] = [ "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -2033,7 +2115,8 @@ exports['src/cypress/runner mocha events simple single test #1'] = [ "invocationDetails": "{Object 8}", "final": true, "currentRetry": 0, - "retries": 0 + "retries": 0, + "_slow": 10000 } ], [ @@ -2059,7 +2142,8 @@ exports['src/cypress/runner mocha events simple single test #1'] = [ "invocationDetails": "{Object 8}", "final": true, "currentRetry": 0, - "retries": 0 + "retries": 0, + "_slow": 10000 } ], [ @@ -2072,7 +2156,8 @@ exports['src/cypress/runner mocha events simple single test #1'] = [ "type": "suite", "file": null, "invocationDetails": "{Object 8}", - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -2099,7 +2184,8 @@ exports['src/cypress/runner mocha events simple single test #1'] = [ "invocationDetails": "{Object 8}", "final": true, "currentRetry": 0, - "retries": 0 + "retries": 0, + "_slow": 10000 } ], [ @@ -2111,7 +2197,8 @@ exports['src/cypress/runner mocha events simple single test #1'] = [ "root": true, "type": "suite", "file": "relative/path/to/spec.js", - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -2140,7 +2227,8 @@ exports['src/cypress/runner mocha events simple three tests #1'] = [ "root": true, "type": "suite", "file": "relative/path/to/spec.js", - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -2153,7 +2241,8 @@ exports['src/cypress/runner mocha events simple three tests #1'] = [ "type": "suite", "file": null, "invocationDetails": "{Object 8}", - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -2169,7 +2258,8 @@ exports['src/cypress/runner mocha events simple three tests #1'] = [ "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -2185,7 +2275,8 @@ exports['src/cypress/runner mocha events simple three tests #1'] = [ "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -2202,7 +2293,8 @@ exports['src/cypress/runner mocha events simple three tests #1'] = [ "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -2246,7 +2338,8 @@ exports['src/cypress/runner mocha events simple three tests #1'] = [ "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": 0 + "retries": 0, + "_slow": 10000 } ], [ @@ -2262,7 +2355,8 @@ exports['src/cypress/runner mocha events simple three tests #1'] = [ "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -2279,7 +2373,8 @@ exports['src/cypress/runner mocha events simple three tests #1'] = [ "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -2295,7 +2390,8 @@ exports['src/cypress/runner mocha events simple three tests #1'] = [ "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -2312,7 +2408,8 @@ exports['src/cypress/runner mocha events simple three tests #1'] = [ "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -2359,7 +2456,8 @@ exports['src/cypress/runner mocha events simple three tests #1'] = [ "invocationDetails": "{Object 8}", "final": true, "currentRetry": 0, - "retries": 0 + "retries": 0, + "_slow": 10000 } ], [ @@ -2406,7 +2504,8 @@ exports['src/cypress/runner mocha events simple three tests #1'] = [ "invocationDetails": "{Object 8}", "final": true, "currentRetry": 0, - "retries": 0 + "retries": 0, + "_slow": 10000 } ], [ @@ -2454,7 +2553,8 @@ exports['src/cypress/runner mocha events simple three tests #1'] = [ "invocationDetails": "{Object 8}", "final": true, "currentRetry": 0, - "retries": 0 + "retries": 0, + "_slow": 10000 } ], [ @@ -2469,7 +2569,8 @@ exports['src/cypress/runner mocha events simple three tests #1'] = [ "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -2486,7 +2587,8 @@ exports['src/cypress/runner mocha events simple three tests #1'] = [ "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -2502,7 +2604,8 @@ exports['src/cypress/runner mocha events simple three tests #1'] = [ "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -2519,7 +2622,8 @@ exports['src/cypress/runner mocha events simple three tests #1'] = [ "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -2536,7 +2640,8 @@ exports['src/cypress/runner mocha events simple three tests #1'] = [ "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -2553,7 +2658,8 @@ exports['src/cypress/runner mocha events simple three tests #1'] = [ "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -2593,7 +2699,8 @@ exports['src/cypress/runner mocha events simple three tests #1'] = [ "invocationDetails": "{Object 8}", "final": true, "currentRetry": 0, - "retries": 0 + "retries": 0, + "_slow": 10000 } ], [ @@ -2633,7 +2740,8 @@ exports['src/cypress/runner mocha events simple three tests #1'] = [ "invocationDetails": "{Object 8}", "final": true, "currentRetry": 0, - "retries": 0 + "retries": 0, + "_slow": 10000 } ], [ @@ -2674,7 +2782,8 @@ exports['src/cypress/runner mocha events simple three tests #1'] = [ "invocationDetails": "{Object 8}", "final": true, "currentRetry": 0, - "retries": 0 + "retries": 0, + "_slow": 10000 } ], [ @@ -2689,7 +2798,8 @@ exports['src/cypress/runner mocha events simple three tests #1'] = [ "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -2706,7 +2816,8 @@ exports['src/cypress/runner mocha events simple three tests #1'] = [ "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -2722,7 +2833,8 @@ exports['src/cypress/runner mocha events simple three tests #1'] = [ "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -2739,7 +2851,8 @@ exports['src/cypress/runner mocha events simple three tests #1'] = [ "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -2756,7 +2869,8 @@ exports['src/cypress/runner mocha events simple three tests #1'] = [ "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -2773,7 +2887,8 @@ exports['src/cypress/runner mocha events simple three tests #1'] = [ "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -2789,7 +2904,8 @@ exports['src/cypress/runner mocha events simple three tests #1'] = [ "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -2806,7 +2922,8 @@ exports['src/cypress/runner mocha events simple three tests #1'] = [ "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -2853,7 +2970,8 @@ exports['src/cypress/runner mocha events simple three tests #1'] = [ "invocationDetails": "{Object 8}", "final": true, "currentRetry": 0, - "retries": 0 + "retries": 0, + "_slow": 10000 } ], [ @@ -2900,7 +3018,8 @@ exports['src/cypress/runner mocha events simple three tests #1'] = [ "invocationDetails": "{Object 8}", "final": true, "currentRetry": 0, - "retries": 0 + "retries": 0, + "_slow": 10000 } ], [ @@ -2913,7 +3032,8 @@ exports['src/cypress/runner mocha events simple three tests #1'] = [ "type": "suite", "file": null, "invocationDetails": "{Object 8}", - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -2961,7 +3081,8 @@ exports['src/cypress/runner mocha events simple three tests #1'] = [ "invocationDetails": "{Object 8}", "final": true, "currentRetry": 0, - "retries": 0 + "retries": 0, + "_slow": 10000 } ], [ @@ -2973,7 +3094,8 @@ exports['src/cypress/runner mocha events simple three tests #1'] = [ "root": true, "type": "suite", "file": "relative/path/to/spec.js", - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ diff --git a/packages/runner/__snapshots__/studio.mochaEvents.spec.js b/packages/runner/__snapshots__/studio.mochaEvents.spec.js index ebb6612843ce..7f02cccca6c6 100644 --- a/packages/runner/__snapshots__/studio.mochaEvents.spec.js +++ b/packages/runner/__snapshots__/studio.mochaEvents.spec.js @@ -15,7 +15,8 @@ exports['studio mocha events only runs a single test by id #1'] = [ "root": true, "type": "suite", "file": "relative/path/to/spec.js", - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -28,7 +29,8 @@ exports['studio mocha events only runs a single test by id #1'] = [ "type": "suite", "file": null, "invocationDetails": "{Object 8}", - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -43,7 +45,8 @@ exports['studio mocha events only runs a single test by id #1'] = [ "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -59,7 +62,8 @@ exports['studio mocha events only runs a single test by id #1'] = [ "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -85,7 +89,8 @@ exports['studio mocha events only runs a single test by id #1'] = [ "invocationDetails": "{Object 8}", "final": true, "currentRetry": 0, - "retries": 0 + "retries": 0, + "_slow": 10000 } ], [ @@ -111,7 +116,8 @@ exports['studio mocha events only runs a single test by id #1'] = [ "invocationDetails": "{Object 8}", "final": true, "currentRetry": 0, - "retries": 0 + "retries": 0, + "_slow": 10000 } ], [ @@ -124,7 +130,8 @@ exports['studio mocha events only runs a single test by id #1'] = [ "type": "suite", "file": null, "invocationDetails": "{Object 8}", - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -151,7 +158,8 @@ exports['studio mocha events only runs a single test by id #1'] = [ "invocationDetails": "{Object 8}", "final": true, "currentRetry": 0, - "retries": 0 + "retries": 0, + "_slow": 10000 } ], [ @@ -163,7 +171,8 @@ exports['studio mocha events only runs a single test by id #1'] = [ "root": true, "type": "suite", "file": "relative/path/to/spec.js", - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -192,7 +201,8 @@ exports['studio mocha events creates a new test when adding to a suite #1'] = [ "root": true, "type": "suite", "file": "relative/path/to/spec.js", - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -205,7 +215,8 @@ exports['studio mocha events creates a new test when adding to a suite #1'] = [ "type": "suite", "file": null, "invocationDetails": "{Object 8}", - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -219,7 +230,8 @@ exports['studio mocha events creates a new test when adding to a suite #1'] = [ "type": "test", "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -234,7 +246,8 @@ exports['studio mocha events creates a new test when adding to a suite #1'] = [ "wallClockStartedAt": "match.date", "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -259,7 +272,8 @@ exports['studio mocha events creates a new test when adding to a suite #1'] = [ "invocationDetails": "{Object 8}", "final": true, "currentRetry": 0, - "retries": 0 + "retries": 0, + "_slow": 10000 } ], [ @@ -284,7 +298,8 @@ exports['studio mocha events creates a new test when adding to a suite #1'] = [ "invocationDetails": "{Object 8}", "final": true, "currentRetry": 0, - "retries": 0 + "retries": 0, + "_slow": 10000 } ], [ @@ -297,7 +312,8 @@ exports['studio mocha events creates a new test when adding to a suite #1'] = [ "type": "suite", "file": null, "invocationDetails": "{Object 8}", - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -323,7 +339,8 @@ exports['studio mocha events creates a new test when adding to a suite #1'] = [ "invocationDetails": "{Object 8}", "final": true, "currentRetry": 0, - "retries": 0 + "retries": 0, + "_slow": 10000 } ], [ @@ -335,7 +352,156 @@ exports['studio mocha events creates a new test when adding to a suite #1'] = [ "root": true, "type": "suite", "file": "relative/path/to/spec.js", - "retries": -1 + "retries": -1, + "_slow": 10000 + } + ], + [ + "mocha", + "end", + { + "end": "match.date" + } + ] +] + +exports['studio mocha events can add new test to root runnable #1'] = [ + [ + "mocha", + "start", + { + "start": "match.date" + } + ], + [ + "mocha", + "suite", + { + "id": "r1", + "title": "", + "root": true, + "type": "suite", + "file": "relative/path/to/spec.js", + "retries": -1, + "_slow": 10000 + } + ], + [ + "mocha", + "test", + { + "id": "r2", + "order": 1, + "title": "New Test", + "body": "[body]", + "type": "test", + "currentRetry": 0, + "retries": -1, + "_slow": 10000 + } + ], + [ + "mocha", + "test:before:run", + { + "id": "r2", + "order": 1, + "title": "New Test", + "body": "[body]", + "type": "test", + "wallClockStartedAt": "match.date", + "currentRetry": 0, + "retries": -1, + "_slow": 10000 + } + ], + [ + "mocha", + "pass", + { + "id": "r2", + "order": 1, + "title": "New Test", + "state": "passed", + "body": "[body]", + "type": "test", + "duration": "match.number", + "wallClockStartedAt": "match.date", + "timings": { + "lifecycle": "match.number", + "test": { + "fnDuration": "match.number", + "afterFnDuration": "match.number" + } + }, + "final": true, + "currentRetry": 0, + "retries": 0, + "_slow": 10000 + } + ], + [ + "mocha", + "test end", + { + "id": "r2", + "order": 1, + "title": "New Test", + "state": "passed", + "body": "[body]", + "type": "test", + "duration": "match.number", + "wallClockStartedAt": "match.date", + "timings": { + "lifecycle": "match.number", + "test": { + "fnDuration": "match.number", + "afterFnDuration": "match.number" + } + }, + "final": true, + "currentRetry": 0, + "retries": 0, + "_slow": 10000 + } + ], + [ + "mocha", + "test:after:run", + { + "id": "r2", + "order": 1, + "title": "New Test", + "state": "passed", + "body": "[body]", + "type": "test", + "duration": "match.number", + "wallClockStartedAt": "match.date", + "wallClockDuration": "match.number", + "timings": { + "lifecycle": "match.number", + "test": { + "fnDuration": "match.number", + "afterFnDuration": "match.number" + } + }, + "final": true, + "currentRetry": 0, + "retries": 0, + "_slow": 10000 + } + ], + [ + "mocha", + "suite end", + { + "id": "r1", + "title": "", + "root": true, + "type": "suite", + "file": "relative/path/to/spec.js", + "retries": -1, + "_slow": 10000 } ], [ @@ -364,7 +530,8 @@ exports['studio mocha events hooks runs before hooks and test body but not after "root": true, "type": "suite", "file": "relative/path/to/spec.js", - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -377,7 +544,8 @@ exports['studio mocha events hooks runs before hooks and test body but not after "type": "suite", "file": null, "invocationDetails": "{Object 8}", - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -393,7 +561,8 @@ exports['studio mocha events hooks runs before hooks and test body but not after "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -409,7 +578,8 @@ exports['studio mocha events hooks runs before hooks and test body but not after "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -426,7 +596,8 @@ exports['studio mocha events hooks runs before hooks and test body but not after "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -463,7 +634,8 @@ exports['studio mocha events hooks runs before hooks and test body but not after "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": 0 + "retries": 0, + "_slow": 10000 } ], [ @@ -479,7 +651,8 @@ exports['studio mocha events hooks runs before hooks and test body but not after "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -496,7 +669,8 @@ exports['studio mocha events hooks runs before hooks and test body but not after "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -536,7 +710,8 @@ exports['studio mocha events hooks runs before hooks and test body but not after "invocationDetails": "{Object 8}", "final": true, "currentRetry": 0, - "retries": 0 + "retries": 0, + "_slow": 10000 } ], [ @@ -576,7 +751,8 @@ exports['studio mocha events hooks runs before hooks and test body but not after "invocationDetails": "{Object 8}", "final": true, "currentRetry": 0, - "retries": 0 + "retries": 0, + "_slow": 10000 } ], [ @@ -589,7 +765,8 @@ exports['studio mocha events hooks runs before hooks and test body but not after "type": "suite", "file": null, "invocationDetails": "{Object 8}", - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -630,7 +807,8 @@ exports['studio mocha events hooks runs before hooks and test body but not after "invocationDetails": "{Object 8}", "final": true, "currentRetry": 0, - "retries": 0 + "retries": 0, + "_slow": 10000 } ], [ @@ -642,7 +820,8 @@ exports['studio mocha events hooks runs before hooks and test body but not after "root": true, "type": "suite", "file": "relative/path/to/spec.js", - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -671,7 +850,8 @@ exports['studio mocha events hooks runs before hooks but not after hooks when ad "root": true, "type": "suite", "file": "relative/path/to/spec.js", - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -684,7 +864,8 @@ exports['studio mocha events hooks runs before hooks but not after hooks when ad "type": "suite", "file": null, "invocationDetails": "{Object 8}", - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -700,7 +881,8 @@ exports['studio mocha events hooks runs before hooks but not after hooks when ad "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -715,7 +897,8 @@ exports['studio mocha events hooks runs before hooks but not after hooks when ad "wallClockStartedAt": "match.date", "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -732,7 +915,8 @@ exports['studio mocha events hooks runs before hooks but not after hooks when ad "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -768,7 +952,8 @@ exports['studio mocha events hooks runs before hooks but not after hooks when ad }, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": 0 + "retries": 0, + "_slow": 10000 } ], [ @@ -784,7 +969,8 @@ exports['studio mocha events hooks runs before hooks but not after hooks when ad "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -801,7 +987,8 @@ exports['studio mocha events hooks runs before hooks but not after hooks when ad "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -840,7 +1027,8 @@ exports['studio mocha events hooks runs before hooks but not after hooks when ad "invocationDetails": "{Object 8}", "final": true, "currentRetry": 0, - "retries": 0 + "retries": 0, + "_slow": 10000 } ], [ @@ -879,7 +1067,8 @@ exports['studio mocha events hooks runs before hooks but not after hooks when ad "invocationDetails": "{Object 8}", "final": true, "currentRetry": 0, - "retries": 0 + "retries": 0, + "_slow": 10000 } ], [ @@ -892,7 +1081,8 @@ exports['studio mocha events hooks runs before hooks but not after hooks when ad "type": "suite", "file": null, "invocationDetails": "{Object 8}", - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -932,7 +1122,8 @@ exports['studio mocha events hooks runs before hooks but not after hooks when ad "invocationDetails": "{Object 8}", "final": true, "currentRetry": 0, - "retries": 0 + "retries": 0, + "_slow": 10000 } ], [ @@ -944,7 +1135,8 @@ exports['studio mocha events hooks runs before hooks but not after hooks when ad "root": true, "type": "suite", "file": "relative/path/to/spec.js", - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -973,7 +1165,8 @@ exports['studio mocha events only test can be extended #1'] = [ "root": true, "type": "suite", "file": "relative/path/to/spec.js", - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -986,7 +1179,8 @@ exports['studio mocha events only test can be extended #1'] = [ "type": "suite", "file": null, "invocationDetails": "{Object 8}", - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -999,7 +1193,8 @@ exports['studio mocha events only test can be extended #1'] = [ "type": "suite", "file": null, "invocationDetails": "{Object 8}", - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -1014,7 +1209,8 @@ exports['studio mocha events only test can be extended #1'] = [ "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -1030,7 +1226,8 @@ exports['studio mocha events only test can be extended #1'] = [ "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -1056,7 +1253,8 @@ exports['studio mocha events only test can be extended #1'] = [ "invocationDetails": "{Object 8}", "final": true, "currentRetry": 0, - "retries": 0 + "retries": 0, + "_slow": 10000 } ], [ @@ -1082,7 +1280,8 @@ exports['studio mocha events only test can be extended #1'] = [ "invocationDetails": "{Object 8}", "final": true, "currentRetry": 0, - "retries": 0 + "retries": 0, + "_slow": 10000 } ], [ @@ -1095,7 +1294,8 @@ exports['studio mocha events only test can be extended #1'] = [ "type": "suite", "file": null, "invocationDetails": "{Object 8}", - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -1108,7 +1308,8 @@ exports['studio mocha events only test can be extended #1'] = [ "type": "suite", "file": null, "invocationDetails": "{Object 8}", - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -1135,7 +1336,8 @@ exports['studio mocha events only test can be extended #1'] = [ "invocationDetails": "{Object 8}", "final": true, "currentRetry": 0, - "retries": 0 + "retries": 0, + "_slow": 10000 } ], [ @@ -1147,7 +1349,8 @@ exports['studio mocha events only test can be extended #1'] = [ "root": true, "type": "suite", "file": "relative/path/to/spec.js", - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -1176,7 +1379,8 @@ exports['studio mocha events only test can be extended when there are multiple i "root": true, "type": "suite", "file": "relative/path/to/spec.js", - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -1189,7 +1393,8 @@ exports['studio mocha events only test can be extended when there are multiple i "type": "suite", "file": null, "invocationDetails": "{Object 8}", - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -1202,7 +1407,8 @@ exports['studio mocha events only test can be extended when there are multiple i "type": "suite", "file": null, "invocationDetails": "{Object 8}", - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -1217,7 +1423,8 @@ exports['studio mocha events only test can be extended when there are multiple i "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -1233,7 +1440,8 @@ exports['studio mocha events only test can be extended when there are multiple i "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -1259,7 +1467,8 @@ exports['studio mocha events only test can be extended when there are multiple i "invocationDetails": "{Object 8}", "final": true, "currentRetry": 0, - "retries": 0 + "retries": 0, + "_slow": 10000 } ], [ @@ -1285,7 +1494,8 @@ exports['studio mocha events only test can be extended when there are multiple i "invocationDetails": "{Object 8}", "final": true, "currentRetry": 0, - "retries": 0 + "retries": 0, + "_slow": 10000 } ], [ @@ -1298,7 +1508,8 @@ exports['studio mocha events only test can be extended when there are multiple i "type": "suite", "file": null, "invocationDetails": "{Object 8}", - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -1311,7 +1522,8 @@ exports['studio mocha events only test can be extended when there are multiple i "type": "suite", "file": null, "invocationDetails": "{Object 8}", - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -1338,7 +1550,8 @@ exports['studio mocha events only test can be extended when there are multiple i "invocationDetails": "{Object 8}", "final": true, "currentRetry": 0, - "retries": 0 + "retries": 0, + "_slow": 10000 } ], [ @@ -1350,7 +1563,8 @@ exports['studio mocha events only test can be extended when there are multiple i "root": true, "type": "suite", "file": "relative/path/to/spec.js", - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -1379,7 +1593,8 @@ exports['studio mocha events only test can extend a suite that contains an only "root": true, "type": "suite", "file": "relative/path/to/spec.js", - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -1392,7 +1607,8 @@ exports['studio mocha events only test can extend a suite that contains an only "type": "suite", "file": null, "invocationDetails": "{Object 8}", - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -1405,7 +1621,8 @@ exports['studio mocha events only test can extend a suite that contains an only "type": "suite", "file": null, "invocationDetails": "{Object 8}", - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -1419,7 +1636,8 @@ exports['studio mocha events only test can extend a suite that contains an only "type": "test", "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -1434,7 +1652,8 @@ exports['studio mocha events only test can extend a suite that contains an only "wallClockStartedAt": "match.date", "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -1459,7 +1678,8 @@ exports['studio mocha events only test can extend a suite that contains an only "invocationDetails": "{Object 8}", "final": true, "currentRetry": 0, - "retries": 0 + "retries": 0, + "_slow": 10000 } ], [ @@ -1484,7 +1704,8 @@ exports['studio mocha events only test can extend a suite that contains an only "invocationDetails": "{Object 8}", "final": true, "currentRetry": 0, - "retries": 0 + "retries": 0, + "_slow": 10000 } ], [ @@ -1497,7 +1718,8 @@ exports['studio mocha events only test can extend a suite that contains an only "type": "suite", "file": null, "invocationDetails": "{Object 8}", - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -1510,7 +1732,8 @@ exports['studio mocha events only test can extend a suite that contains an only "type": "suite", "file": null, "invocationDetails": "{Object 8}", - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -1536,7 +1759,8 @@ exports['studio mocha events only test can extend a suite that contains an only "invocationDetails": "{Object 8}", "final": true, "currentRetry": 0, - "retries": 0 + "retries": 0, + "_slow": 10000 } ], [ @@ -1548,7 +1772,8 @@ exports['studio mocha events only test can extend a suite that contains an only "root": true, "type": "suite", "file": "relative/path/to/spec.js", - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -1577,7 +1802,8 @@ exports['studio mocha events only suite can be added to #1'] = [ "root": true, "type": "suite", "file": "relative/path/to/spec.js", - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -1590,7 +1816,8 @@ exports['studio mocha events only suite can be added to #1'] = [ "type": "suite", "file": null, "invocationDetails": "{Object 8}", - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -1603,7 +1830,8 @@ exports['studio mocha events only suite can be added to #1'] = [ "type": "suite", "file": null, "invocationDetails": "{Object 8}", - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -1617,7 +1845,8 @@ exports['studio mocha events only suite can be added to #1'] = [ "type": "test", "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -1632,7 +1861,8 @@ exports['studio mocha events only suite can be added to #1'] = [ "wallClockStartedAt": "match.date", "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -1657,7 +1887,8 @@ exports['studio mocha events only suite can be added to #1'] = [ "invocationDetails": "{Object 8}", "final": true, "currentRetry": 0, - "retries": 0 + "retries": 0, + "_slow": 10000 } ], [ @@ -1682,7 +1913,8 @@ exports['studio mocha events only suite can be added to #1'] = [ "invocationDetails": "{Object 8}", "final": true, "currentRetry": 0, - "retries": 0 + "retries": 0, + "_slow": 10000 } ], [ @@ -1695,7 +1927,8 @@ exports['studio mocha events only suite can be added to #1'] = [ "type": "suite", "file": null, "invocationDetails": "{Object 8}", - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -1708,7 +1941,8 @@ exports['studio mocha events only suite can be added to #1'] = [ "type": "suite", "file": null, "invocationDetails": "{Object 8}", - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -1734,7 +1968,8 @@ exports['studio mocha events only suite can be added to #1'] = [ "invocationDetails": "{Object 8}", "final": true, "currentRetry": 0, - "retries": 0 + "retries": 0, + "_slow": 10000 } ], [ @@ -1746,7 +1981,8 @@ exports['studio mocha events only suite can be added to #1'] = [ "root": true, "type": "suite", "file": "relative/path/to/spec.js", - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -1775,7 +2011,8 @@ exports['studio mocha events only suite can be added to when there are multiple "root": true, "type": "suite", "file": "relative/path/to/spec.js", - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -1788,7 +2025,8 @@ exports['studio mocha events only suite can be added to when there are multiple "type": "suite", "file": null, "invocationDetails": "{Object 8}", - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -1801,7 +2039,8 @@ exports['studio mocha events only suite can be added to when there are multiple "type": "suite", "file": null, "invocationDetails": "{Object 8}", - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -1815,7 +2054,8 @@ exports['studio mocha events only suite can be added to when there are multiple "type": "test", "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -1830,7 +2070,8 @@ exports['studio mocha events only suite can be added to when there are multiple "wallClockStartedAt": "match.date", "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -1855,7 +2096,8 @@ exports['studio mocha events only suite can be added to when there are multiple "invocationDetails": "{Object 8}", "final": true, "currentRetry": 0, - "retries": 0 + "retries": 0, + "_slow": 10000 } ], [ @@ -1880,7 +2122,8 @@ exports['studio mocha events only suite can be added to when there are multiple "invocationDetails": "{Object 8}", "final": true, "currentRetry": 0, - "retries": 0 + "retries": 0, + "_slow": 10000 } ], [ @@ -1893,7 +2136,8 @@ exports['studio mocha events only suite can be added to when there are multiple "type": "suite", "file": null, "invocationDetails": "{Object 8}", - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -1906,7 +2150,8 @@ exports['studio mocha events only suite can be added to when there are multiple "type": "suite", "file": null, "invocationDetails": "{Object 8}", - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -1932,7 +2177,8 @@ exports['studio mocha events only suite can be added to when there are multiple "invocationDetails": "{Object 8}", "final": true, "currentRetry": 0, - "retries": 0 + "retries": 0, + "_slow": 10000 } ], [ @@ -1944,7 +2190,8 @@ exports['studio mocha events only suite can be added to when there are multiple "root": true, "type": "suite", "file": "relative/path/to/spec.js", - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -1973,7 +2220,8 @@ exports['studio mocha events only suite can extend a test within an only suite # "root": true, "type": "suite", "file": "relative/path/to/spec.js", - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -1986,7 +2234,8 @@ exports['studio mocha events only suite can extend a test within an only suite # "type": "suite", "file": null, "invocationDetails": "{Object 8}", - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -1999,7 +2248,8 @@ exports['studio mocha events only suite can extend a test within an only suite # "type": "suite", "file": null, "invocationDetails": "{Object 8}", - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -2014,7 +2264,8 @@ exports['studio mocha events only suite can extend a test within an only suite # "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -2030,7 +2281,8 @@ exports['studio mocha events only suite can extend a test within an only suite # "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -2056,7 +2308,8 @@ exports['studio mocha events only suite can extend a test within an only suite # "invocationDetails": "{Object 8}", "final": true, "currentRetry": 0, - "retries": 0 + "retries": 0, + "_slow": 10000 } ], [ @@ -2082,7 +2335,8 @@ exports['studio mocha events only suite can extend a test within an only suite # "invocationDetails": "{Object 8}", "final": true, "currentRetry": 0, - "retries": 0 + "retries": 0, + "_slow": 10000 } ], [ @@ -2095,7 +2349,8 @@ exports['studio mocha events only suite can extend a test within an only suite # "type": "suite", "file": null, "invocationDetails": "{Object 8}", - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -2108,7 +2363,8 @@ exports['studio mocha events only suite can extend a test within an only suite # "type": "suite", "file": null, "invocationDetails": "{Object 8}", - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -2135,7 +2391,8 @@ exports['studio mocha events only suite can extend a test within an only suite # "invocationDetails": "{Object 8}", "final": true, "currentRetry": 0, - "retries": 0 + "retries": 0, + "_slow": 10000 } ], [ @@ -2147,7 +2404,8 @@ exports['studio mocha events only suite can extend a test within an only suite # "root": true, "type": "suite", "file": "relative/path/to/spec.js", - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -2176,7 +2434,8 @@ exports['studio mocha events only suite can extend a test within an only suite w "root": true, "type": "suite", "file": "relative/path/to/spec.js", - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -2189,7 +2448,8 @@ exports['studio mocha events only suite can extend a test within an only suite w "type": "suite", "file": null, "invocationDetails": "{Object 8}", - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -2202,7 +2462,8 @@ exports['studio mocha events only suite can extend a test within an only suite w "type": "suite", "file": null, "invocationDetails": "{Object 8}", - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -2217,7 +2478,8 @@ exports['studio mocha events only suite can extend a test within an only suite w "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -2233,7 +2495,8 @@ exports['studio mocha events only suite can extend a test within an only suite w "file": null, "invocationDetails": "{Object 8}", "currentRetry": 0, - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -2259,7 +2522,8 @@ exports['studio mocha events only suite can extend a test within an only suite w "invocationDetails": "{Object 8}", "final": true, "currentRetry": 0, - "retries": 0 + "retries": 0, + "_slow": 10000 } ], [ @@ -2285,7 +2549,8 @@ exports['studio mocha events only suite can extend a test within an only suite w "invocationDetails": "{Object 8}", "final": true, "currentRetry": 0, - "retries": 0 + "retries": 0, + "_slow": 10000 } ], [ @@ -2298,7 +2563,8 @@ exports['studio mocha events only suite can extend a test within an only suite w "type": "suite", "file": null, "invocationDetails": "{Object 8}", - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -2311,7 +2577,8 @@ exports['studio mocha events only suite can extend a test within an only suite w "type": "suite", "file": null, "invocationDetails": "{Object 8}", - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ @@ -2338,148 +2605,8 @@ exports['studio mocha events only suite can extend a test within an only suite w "invocationDetails": "{Object 8}", "final": true, "currentRetry": 0, - "retries": 0 - } - ], - [ - "mocha", - "suite end", - { - "id": "r1", - "title": "", - "root": true, - "type": "suite", - "file": "relative/path/to/spec.js", - "retries": -1 - } - ], - [ - "mocha", - "end", - { - "end": "match.date" - } - ] -] - -exports['studio mocha events can add new test to root runnable #1'] = [ - [ - "mocha", - "start", - { - "start": "match.date" - } - ], - [ - "mocha", - "suite", - { - "id": "r1", - "title": "", - "root": true, - "type": "suite", - "file": "relative/path/to/spec.js", - "retries": -1 - } - ], - [ - "mocha", - "test", - { - "id": "r2", - "order": 1, - "title": "New Test", - "body": "[body]", - "type": "test", - "currentRetry": 0, - "retries": -1 - } - ], - [ - "mocha", - "test:before:run", - { - "id": "r2", - "order": 1, - "title": "New Test", - "body": "[body]", - "type": "test", - "wallClockStartedAt": "match.date", - "currentRetry": 0, - "retries": -1 - } - ], - [ - "mocha", - "pass", - { - "id": "r2", - "order": 1, - "title": "New Test", - "state": "passed", - "body": "[body]", - "type": "test", - "duration": "match.number", - "wallClockStartedAt": "match.date", - "timings": { - "lifecycle": "match.number", - "test": { - "fnDuration": "match.number", - "afterFnDuration": "match.number" - } - }, - "final": true, - "currentRetry": 0, - "retries": 0 - } - ], - [ - "mocha", - "test end", - { - "id": "r2", - "order": 1, - "title": "New Test", - "state": "passed", - "body": "[body]", - "type": "test", - "duration": "match.number", - "wallClockStartedAt": "match.date", - "timings": { - "lifecycle": "match.number", - "test": { - "fnDuration": "match.number", - "afterFnDuration": "match.number" - } - }, - "final": true, - "currentRetry": 0, - "retries": 0 - } - ], - [ - "mocha", - "test:after:run", - { - "id": "r2", - "order": 1, - "title": "New Test", - "state": "passed", - "body": "[body]", - "type": "test", - "duration": "match.number", - "wallClockStartedAt": "match.date", - "wallClockDuration": "match.number", - "timings": { - "lifecycle": "match.number", - "test": { - "fnDuration": "match.number", - "afterFnDuration": "match.number" - } - }, - "final": true, - "currentRetry": 0, - "retries": 0 + "retries": 0, + "_slow": 10000 } ], [ @@ -2491,7 +2618,8 @@ exports['studio mocha events can add new test to root runnable #1'] = [ "root": true, "type": "suite", "file": "relative/path/to/spec.js", - "retries": -1 + "retries": -1, + "_slow": 10000 } ], [ diff --git a/packages/server/lib/config.ts b/packages/server/lib/config.ts index 7aec4f32b509..1f527190a198 100644 --- a/packages/server/lib/config.ts +++ b/packages/server/lib/config.ts @@ -1,5 +1,4 @@ import _ from 'lodash' -import R from 'ramda' import path from 'path' import Promise from 'bluebird' import deepDiff from 'return-deep-diff' @@ -23,19 +22,7 @@ export interface ConfigSettingsConfig { const debug = Debug('cypress:server:config') import { options, breakingOptions } from './config_options' -import { getProcessEnvVars } from './util/config' - -export const CYPRESS_ENV_PREFIX = 'CYPRESS_' - -export const CYPRESS_ENV_PREFIX_LENGTH = 'CYPRESS_'.length - -export const CYPRESS_RESERVED_ENV_VARS = [ - 'CYPRESS_INTERNAL_ENV', -] - -export const CYPRESS_SPECIAL_ENV_VARS = [ - 'RECORD_KEY', -] +import { getProcessEnvVars, CYPRESS_SPECIAL_ENV_VARS } from './util/config' const dashesOrUnderscoresRe = /^(_-)+/ @@ -269,6 +256,11 @@ export function mergeDefaults (config: Record = {}, options: Record _.defaults(config, defaultValues) + // Default values can be functions, in which case they are evaluated + // at runtime - for example, slowTestThreshold where the default value + // varies between e2e and component testing. + config = _.mapValues(config, (value) => (typeof value === 'function' ? value(options) : value)) + // split out our own app wide env from user env variables // and delete envFile config.env = parseEnv(config, options.env, resolved) @@ -291,7 +283,7 @@ export function mergeDefaults (config: Record = {}, options: Record config.numTestsKeptInMemory = 0 } - config = setResolvedConfigValues(config, defaultValues, resolved) + config = setResolvedConfigValues(config, defaultValues, resolved, options) if (config.port) { config = setUrls(config) @@ -316,10 +308,10 @@ export function mergeDefaults (config: Record = {}, options: Record .then(_.partialRight(setNodeBinary, options.onWarning)) } -export function setResolvedConfigValues (config, defaults, resolved) { +export function setResolvedConfigValues (config, defaults, resolved, options) { const obj = _.clone(config) - obj.resolved = resolveConfigValues(config, defaults, resolved) + obj.resolved = resolveConfigValues(config, defaults, resolved, options) debug('resolved config is %o', obj.resolved.browsers) return obj @@ -364,7 +356,7 @@ export function updateWithPluginValues (cfg, overrides) { return errors.throw('CONFIG_VALIDATION_ERROR', errMsg) }) - let originalResolvedBrowsers = cfg && cfg.resolved && cfg.resolved.browsers && R.clone(cfg.resolved.browsers) + let originalResolvedBrowsers = cfg && cfg.resolved && cfg.resolved.browsers && _.cloneDeep(cfg.resolved.browsers) if (!originalResolvedBrowsers) { // have something to resolve with if plugins return nothing @@ -378,7 +370,7 @@ export function updateWithPluginValues (cfg, overrides) { debug('config diffs %o', diffs) - const userBrowserList = diffs && diffs.browsers && R.clone(diffs.browsers) + const userBrowserList = diffs && diffs.browsers && _.cloneDeep(diffs.browsers) if (userBrowserList) { debug('user browser list %o', userBrowserList) @@ -424,7 +416,7 @@ export function updateWithPluginValues (cfg, overrides) { // combines the default configuration object with values specified in the // configuration file like "cypress.{ts|js}". Values in configuration file // overwrite the defaults. -export function resolveConfigValues (config, defaults, resolved = {}) { +export function resolveConfigValues (config, defaults, resolved = {}, options = {}) { // pick out only known configuration keys return _ .chain(config) @@ -448,7 +440,9 @@ export function resolveConfigValues (config, defaults, resolved = {}) { return source(r) } - if (!(!_.isEqual(config[key], defaults[key]) && key !== 'browsers')) { + const defaultValue = typeof defaults[key] === 'function' ? defaults[key](options) : defaults[key] + + if (!(!_.isEqual(config[key], defaultValue) && key !== 'browsers')) { // "browsers" list is special, since it is dynamic by default // and can only be ovewritten via plugins file return source('default') diff --git a/packages/server/lib/config_options.ts b/packages/server/lib/config_options.ts index fff78dccda3f..86fa27536daf 100644 --- a/packages/server/lib/config_options.ts +++ b/packages/server/lib/config_options.ts @@ -206,6 +206,10 @@ const testingTypeOptions = [ defaultValue: 'cypress/screenshots', validation: v.isStringOrFalse, isFolder: true, + }, { + name: 'slowTestThreshold', + defaultValue: (options: Record) => options.testingType === 'component' ? 250 : 10000, + validation: v.isNumber, }, { name: 'socketId', defaultValue: null, diff --git a/packages/server/lib/controllers/files.js b/packages/server/lib/controllers/files.js index 3be7f91f6725..91b4a14c9dc0 100644 --- a/packages/server/lib/controllers/files.js +++ b/packages/server/lib/controllers/files.js @@ -1,5 +1,4 @@ const _ = require('lodash') -const R = require('ramda') const path = require('path') const Promise = require('bluebird') const cwd = require('../cwd') @@ -75,7 +74,7 @@ module.exports = { // desktop-gui/src/specs/specs-store.js return spec.relative.toLowerCase().includes(specFilter.toLowerCase()) } - const specFilterFn = specFilter ? specFilterContains : R.T + const specFilterFn = specFilter ? specFilterContains : () => true const getSpecsHelper = () => { // grab all of the specs if this is ci @@ -85,17 +84,21 @@ module.exports = { debug('returning all specs') return specsUtil.default.findSpecs(config) - .then(R.tap((specs) => { - return debug('found __all specs %o', specs) - })) + .then((specs) => { + debug('found __all specs %o', specs) + + return specs + }) .filter(specFilterFn) .filter((foundSpec) => { return componentTestingEnabled ? foundSpec.specType === 'component' : foundSpec.specType === 'integration' - }).then(R.tap((specs) => { - return debug('filtered __all specs %o', specs) - })).map((spec) => { + }).then((specs) => { + debug('filtered __all specs %o', specs) + + return specs + }).map((spec) => { // grab the name of each return spec.absolute }).map(convertSpecPath) diff --git a/packages/server/lib/cypress.js b/packages/server/lib/cypress.js index c9c37ff0bb47..1b099dc4ccef 100644 --- a/packages/server/lib/cypress.js +++ b/packages/server/lib/cypress.js @@ -9,7 +9,6 @@ require('./environment') // essentially do it all again when we boot the correct // mode. -const R = require('ramda') const Promise = require('bluebird') const debug = require('debug')('cypress:server:cypress') const argsUtils = require('./util/args') @@ -123,7 +122,7 @@ module.exports = { // if the CLI passed "--" somewhere, we need to remove it // for https://github.com/cypress-io/cypress/issues/5466 - argv = R.without('--', argv) + argv = argv.filter((val) => val !== '--') let options diff --git a/packages/server/lib/exec.js b/packages/server/lib/exec.js index 3e49d85c6868..d8f61eecc7cd 100644 --- a/packages/server/lib/exec.js +++ b/packages/server/lib/exec.js @@ -1,18 +1,25 @@ const Promise = require('bluebird') const execa = require('execa') -const R = require('ramda') const shellEnv = require('shell-env') +const _ = require('lodash') const log = require('./log') const utils = require('./util/shell') -const pickMainProps = R.pick(['stdout', 'stderr', 'code']) +const pickMainProps = (val) => _.pick(val, ['stdout', 'stderr', 'code']) -const trimStdio = R.evolve({ - stdout: R.trim, - stderr: R.trim, -}) +const trimStdio = (val) => { + const result = { ...val } -const loadShellVars = R.memoizeWith(R.toString, shellEnv) + if (_.isString(val.stdout)) { + result.stdout = val.stdout.trim() + } + + if (_.isString(val.stderr)) { + result.stderr = val.stderr.trim() + } + + return result +} module.exports = { run (projectRoot, options) { @@ -38,9 +45,9 @@ module.exports = { } const run = () => { - return loadShellVars() + return shellEnv() .then((shellVariables) => { - const env = R.mergeAll([{}, shellVariables, process.env, options.env]) + const env = _.merge({}, shellVariables, process.env, options.env) return utils.getShell(env.SHELL) .then((shell) => { diff --git a/packages/server/lib/files.js b/packages/server/lib/files.js index 3cb8a3732ce1..3add13e81ed9 100644 --- a/packages/server/lib/files.js +++ b/packages/server/lib/files.js @@ -4,9 +4,14 @@ const { fs } = require('./util/fs') module.exports = { readFile (projectRoot, file, options = {}) { const filePath = path.resolve(projectRoot, file) - const readFn = path.extname(filePath) === '.json' ? fs.readJsonAsync : fs.readFileAsync + const readFn = (path.extname(filePath) === '.json' && options.encoding !== null) ? fs.readJsonAsync : fs.readFileAsync - return readFn(filePath, options.encoding || 'utf8') + // https://github.com/cypress-io/cypress/issues/1558 + // If no encoding is specified, then Cypress has historically defaulted + // to `utf8`, because of it's focus on text files. This is in contrast to + // NodeJs, which defaults to binary. We allow users to pass in `null` + // to restore the default node behavior. + return readFn(filePath, options.encoding === undefined ? 'utf8' : options.encoding) .then((contents) => { return { contents, @@ -22,7 +27,7 @@ module.exports = { writeFile (projectRoot, file, contents, options = {}) { const filePath = path.resolve(projectRoot, file) const writeOptions = { - encoding: options.encoding || 'utf8', + encoding: options.encoding === undefined ? 'utf8' : options.encoding, flag: options.flag || 'w', } diff --git a/packages/server/lib/fixture.js b/packages/server/lib/fixture.js index 50748c005aa7..d762ab7fcdb2 100644 --- a/packages/server/lib/fixture.js +++ b/packages/server/lib/fixture.js @@ -1,4 +1,3 @@ -const _ = require('lodash') const path = require('path') const check = require('syntax-error') const debug = require('debug')('cypress:server:fixture') @@ -116,15 +115,24 @@ module.exports = { }, parseFileByExtension (p, fixture, ext, options = {}) { + // https://github.com/cypress-io/cypress/issues/1558 + // If the user explicitly specifies `null` as the encoding, we treat the + // file as binary regardless of extension. We base64 encode them for + // transmission over the websocket. There is a matching Buffer.from() + // in packages/driver/src/cy/commands/fixtures.ts + if (options.encoding === null) { + return this.parse(p, fixture) + } + switch (ext) { case '.json': return this.parseJson(p, fixture) case '.js': return this.parseJs(p, fixture) case '.coffee': return this.parseCoffee(p, fixture) case '.html': return this.parseHtml(p, fixture) case '.png': case '.jpg': case '.jpeg': case '.gif': case '.tif': case '.tiff': case '.zip': - return this.parse(p, fixture, _.isNull(options.encoding) ? null : (options.encoding || 'base64')) + return this.parse(p, fixture, options.encoding) default: - return this.parse(p, fixture, _.isNull(options.encoding) ? null : options.encoding) + return this.parse(p, fixture, options.encoding || 'utf8') } }, @@ -184,7 +192,7 @@ module.exports = { .bind(this) }, - parse (p, fixture, encoding = 'utf8') { + parse (p, fixture, encoding) { return fs.readFileAsync(p, encoding) .bind(this) }, diff --git a/packages/server/lib/modes/info.js b/packages/server/lib/modes/info.js index d763109b59dd..81f7c667f17f 100644 --- a/packages/server/lib/modes/info.js +++ b/packages/server/lib/modes/info.js @@ -3,7 +3,6 @@ const debug = require('debug')('cypress:server:info') const launcher = require('@packages/launcher') const pluralize = require('pluralize') const { stripIndent } = require('common-tags') -const { sortWith, ascend, prop } = require('ramda') const browserUtils = require('../browsers/utils') const _ = require('lodash') const chalk = require('chalk') @@ -83,11 +82,7 @@ const print = (browsers = []) => { console.log('') - const sortByNameAndMajor = sortWith([ - ascend(prop('name')), - ascend(prop('majorVersion')), - ]) - const sortedByNameAndMajorVersion = sortByNameAndMajor(browsers) + const sortedByNameAndMajorVersion = _.sortBy(browsers, ['name', 'majorVersion']) sortedByNameAndMajorVersion.forEach((browser, k) => { const text = stripIndent` diff --git a/packages/server/lib/reporter.js b/packages/server/lib/reporter.js index f4b09fad4f2c..5c5b6135c87e 100644 --- a/packages/server/lib/reporter.js +++ b/packages/server/lib/reporter.js @@ -8,6 +8,7 @@ const Mocha = require('mocha-7.0.1') const mochaReporters = require('mocha-7.0.1/lib/reporters') const mochaCreateStatsCollector = require('mocha-7.0.1/lib/stats-collector') const mochaColor = mochaReporters.Base.color +const mochaSymbols = mochaReporters.Base.symbols const debug = require('debug')('cypress:server:reporter') const Promise = require('bluebird') @@ -293,6 +294,34 @@ class Reporter { reporterOptions: this.reporterOptions, }) + if (this.reporterName === 'spec') { + // Unfortunately the reporter doesn't expose its indentation logic, so we have to replicate it here + let indents = 0 + + this.runner.on('suite', function (suite) { + ++indents + }) + + this.runner.on('suite end', function () { + --indents + }) + + // Override the default reporter to always show test timing even for fast tests + // and display slow ones in yellow rather than red + this.runner._events.pass[2] = function (test) { + const durationColor = test.speed === 'slow' ? 'medium' : 'fast' + const fmt = + Array(indents).join(' ') + + mochaColor('checkmark', ` ${ mochaSymbols.ok}`) + + mochaColor('pass', ' %s') + + mochaColor(durationColor, ' (%dms)') + + // Log: `✓ test title (300ms)` when a test passes + // eslint-disable-next-line no-console + console.log(fmt, test.title, test.duration) + } + } + this.runner.ignoreLeaks = true } diff --git a/packages/server/lib/scaffold.js b/packages/server/lib/scaffold.js index a65510bd4f29..a3dd38b35aa0 100644 --- a/packages/server/lib/scaffold.js +++ b/packages/server/lib/scaffold.js @@ -8,7 +8,6 @@ const glob = require('./util/glob') const cwd = require('./cwd') const debug = require('debug')('cypress:server:scaffold') const errors = require('./errors') -const { isEmpty } = require('ramda') const { isDefault } = require('./util/config') const getExampleSpecsFullPaths = cypressEx.getPathToExamples() @@ -116,8 +115,8 @@ const isNewProject = (config) => { debug('determine if we should scaffold:') // TODO: add tests for this - debug('- empty?', isEmpty(files)) - if (isEmpty(files)) { + debug('- empty?', _.isEmpty(files)) + if (_.isEmpty(files)) { return true } diff --git a/packages/server/lib/util/config.ts b/packages/server/lib/util/config.ts index 06bae0dbae87..0bb4c8e7eec5 100644 --- a/packages/server/lib/util/config.ts +++ b/packages/server/lib/util/config.ts @@ -1,11 +1,18 @@ import _ from 'lodash' -import { - CYPRESS_ENV_PREFIX, - CYPRESS_ENV_PREFIX_LENGTH, - CYPRESS_RESERVED_ENV_VARS, -} from '../config' import { coerce } from './coerce' +export const CYPRESS_ENV_PREFIX = 'CYPRESS_' + +export const CYPRESS_ENV_PREFIX_LENGTH = 'CYPRESS_'.length + +export const CYPRESS_RESERVED_ENV_VARS = [ + 'CYPRESS_INTERNAL_ENV', +] + +export const CYPRESS_SPECIAL_ENV_VARS = [ + 'RECORD_KEY', +] + export const isDefault = (config: Record, prop: string) => { return config.resolved[prop].from === 'default' } diff --git a/packages/server/lib/util/newlines.js b/packages/server/lib/util/newlines.js index ef4155558e68..960d31c73f76 100644 --- a/packages/server/lib/util/newlines.js +++ b/packages/server/lib/util/newlines.js @@ -1,10 +1,16 @@ -const R = require('ramda') - const addNewlineAtEveryNChar = (str, n) => { - // Add a newline char after every 'n' char - if (str) { - return R.splitEvery(n, str).join('\n') + if (!str) { + return str } + + let result = [] + let idx = 0 + + while (idx < str.length) { + result.push(str.slice(idx, idx += n)) + } + + return result.join('\n') } module.exports = { diff --git a/packages/server/lib/util/shell.js b/packages/server/lib/util/shell.js index 7df783b4f886..ca107de71450 100644 --- a/packages/server/lib/util/shell.js +++ b/packages/server/lib/util/shell.js @@ -1,7 +1,6 @@ const _ = require('lodash') const Promise = require('bluebird') const execa = require('execa') -const R = require('ramda') const os = require('os') const commandExistsModule = require('command-exists') const log = require('../log') @@ -71,7 +70,7 @@ const sourceShellCommand = function (cmd, shell) { const findBash = () => { return execa.shell('which bash') - .then(R.prop('stdout')) + .then((val) => val.stdout) } const getShell = function (shell) { diff --git a/packages/server/lib/util/specs.ts b/packages/server/lib/util/specs.ts index 79c4d901f0ac..8f125528a324 100644 --- a/packages/server/lib/util/specs.ts +++ b/packages/server/lib/util/specs.ts @@ -1,5 +1,4 @@ import _ from 'lodash' -import R from 'ramda' import la from 'lazy-ass' import path from 'path' import check from 'check-more-types' @@ -184,15 +183,13 @@ function findSpecsOfType (searchFolder: string, commonSearchOptions: CommonSearc return Bluebird.mapSeries(testFilesPatterns, findOnePattern).then(_.flatten) } -const setTestType = (testType: Cypress.CypressSpecType) => R.map(R.set(R.lensProp('specType'), testType)) - const findIntegrationSpecs = (searchFolder: string | undefined, commonSearchOptions: CommonSearchOptions, specPattern: string | undefined) => { if (!searchFolder) { return [] } return findSpecsOfType(searchFolder, commonSearchOptions, specPattern) - .then(setTestType(SPEC_TYPES.INTEGRATION)) + .then((val) => val.map((s) => ({ ...s, specType: SPEC_TYPES.INTEGRATION }))) } const findComponentSpecs = (searchFolder: string | undefined | false, integrationFolder: string | undefined | false, commonSearchOptions: CommonSearchOptions, specPattern: string | undefined) => { @@ -208,7 +205,7 @@ const findComponentSpecs = (searchFolder: string | undefined | false, integratio ] return findSpecsOfType(searchFolder, { ...commonSearchOptions, ignoreTestFiles }, specPattern) - .then(setTestType(SPEC_TYPES.COMPONENT)) + .then((val) => val.map((s) => ({ ...s, specType: SPEC_TYPES.COMPONENT }))) } const printFoundSpecs = (foundSpecs: Cypress.Spec[]) => { diff --git a/packages/server/package.json b/packages/server/package.json index 3cca5d98ed12..9f83d71295a3 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -98,7 +98,6 @@ "p-defer": "^3.0.0", "p-queue": "6.1.0", "pluralize": "8.0.0", - "ramda": "0.27.1", "randomstring": "1.1.5", "recast": "0.20.4", "resolve": "1.17.0", diff --git a/packages/server/test/integration/cli_spec.js b/packages/server/test/integration/cli_spec.js index 290e537f1bb3..11f5609bd532 100644 --- a/packages/server/test/integration/cli_spec.js +++ b/packages/server/test/integration/cli_spec.js @@ -1,7 +1,6 @@ require('../spec_helper') const _ = require('lodash') -const R = require('ramda') const cp = require('child_process') const pkg = require('../../package.json') const execa = require('execa') @@ -102,7 +101,7 @@ describe('CLI Interface', () => { beforeEach(() => { return execa('npm', ['-version']) - .then(R.prop('stdout')) + .then((val) => val.stdout) .then((version) => { npmVersion = version diff --git a/packages/server/test/integration/cypress_spec.js b/packages/server/test/integration/cypress_spec.js index 53b4aa11de9c..bfa5dc519ce6 100644 --- a/packages/server/test/integration/cypress_spec.js +++ b/packages/server/test/integration/cypress_spec.js @@ -1,7 +1,6 @@ /* eslint-disable no-restricted-properties */ require('../spec_helper') -const R = require('ramda') const _ = require('lodash') const path = require('path') const EE = require('events') @@ -1052,7 +1051,7 @@ describe('lib/cypress', () => { // when we work with the browsers we set a few extra flags const chrome = _.find(TYPICAL_BROWSERS, { name: 'chrome' }) - const launchedChrome = R.merge(chrome, { + const launchedChrome = _.defaults({}, chrome, { isHeadless: true, isHeaded: false, }) diff --git a/packages/server/test/unit/browsers/browsers_spec.js b/packages/server/test/unit/browsers/browsers_spec.js index 96235f1b1870..f6fa070ba35b 100644 --- a/packages/server/test/unit/browsers/browsers_spec.js +++ b/packages/server/test/unit/browsers/browsers_spec.js @@ -5,7 +5,7 @@ const utils = require(`${root}../lib/browsers/utils`) const snapshot = require('snap-shot-it') const normalizeBrowsers = (message) => { - return message.replace(/(found are: ).*/, '$1chrome, firefox, electron') + return message.replace(/(found on your system are:)(?:\n- .*)*/, '$1\n- chrome\n- firefox\n- electron') } // When we added component testing mode, we added the option for electron to be omitted diff --git a/packages/server/test/unit/config_spec.js b/packages/server/test/unit/config_spec.js index 4dfa915fb107..8ca85c8ad1e4 100644 --- a/packages/server/test/unit/config_spec.js +++ b/packages/server/test/unit/config_spec.js @@ -1,7 +1,6 @@ require('../spec_helper') const _ = require('lodash') -const R = require('ramda') const debug = require('debug')('test') const config = require(`${root}lib/config`) const errors = require(`${root}lib/errors`) @@ -1072,13 +1071,21 @@ describe('lib/config', () => { cfg.projectRoot = '/foo/bar/' return config.mergeDefaults(cfg, options) - .then(R.prop(prop)) + .then((val) => val[prop]) .then((result) => { expect(result).to.deep.eq(value) }) } }) + it('slowTestThreshold=10000 for e2e', function () { + return this.defaults('slowTestThreshold', 10000, {}, { testingType: 'e2e' }) + }) + + it('slowTestThreshold=250 for component', function () { + return this.defaults('slowTestThreshold', 250, {}, { testingType: 'component' }) + }) + it('port=null', function () { return this.defaults('port', null) }) @@ -1462,6 +1469,7 @@ describe('lib/config', () => { retries: { value: { runMode: 0, openMode: 0 }, from: 'default' }, screenshotOnRunFailure: { value: true, from: 'default' }, screenshotsFolder: { value: 'cypress/screenshots', from: 'default' }, + slowTestThreshold: { value: 10000, from: 'default' }, supportFile: { value: 'cypress/support', from: 'default' }, taskTimeout: { value: 60000, from: 'default' }, testFiles: { value: '**/*.*', from: 'default' }, @@ -1568,6 +1576,7 @@ describe('lib/config', () => { retries: { value: { runMode: 0, openMode: 0 }, from: 'default' }, screenshotOnRunFailure: { value: true, from: 'default' }, screenshotsFolder: { value: 'cypress/screenshots', from: 'default' }, + slowTestThreshold: { value: 10000, from: 'default' }, supportFile: { value: 'cypress/support', from: 'default' }, taskTimeout: { value: 60000, from: 'default' }, testFiles: { value: '**/*.*', from: 'default' }, @@ -2412,25 +2421,3 @@ describe('lib/config', () => { }) }) }) - -describe('lib/util/config', () => { - context('.isDefault', () => { - it('returns true if value is default value', () => { - settings = { baseUrl: null } - const defaults = { baseUrl: null } - const resolved = {} - const merged = config.setResolvedConfigValues(settings, defaults, resolved) - - expect(configUtil.isDefault(merged, 'baseUrl')).to.be.true - }) - - it('returns false if value is not default value', () => { - settings = { baseUrl: null } - const defaults = { baseUrl: 'http://localhost:8080' } - const resolved = {} - const merged = config.setResolvedConfigValues(settings, defaults, resolved) - - expect(configUtil.isDefault(merged, 'baseUrl')).to.be.false - }) - }) -}) diff --git a/packages/server/test/unit/files_spec.js b/packages/server/test/unit/files_spec.js index 7361badf75c8..ab0cc8bb9a18 100644 --- a/packages/server/test/unit/files_spec.js +++ b/packages/server/test/unit/files_spec.js @@ -41,6 +41,13 @@ describe('lib/files', () => { }) }) + // https://github.com/cypress-io/cypress/issues/1558 + it('explicit null encoding is sent to driver as a Buffer', function () { + return files.readFile(this.projectRoot, 'tests/_fixtures/ascii.foo', { encoding: null }).then(({ contents }) => { + expect(contents).to.eql(Buffer.from('\n')) + }) + }) + it('parses json to valid JS object', function () { return files.readFile(this.projectRoot, 'tests/_fixtures/users.json').then(({ contents }) => { expect(contents).to.eql([ @@ -75,6 +82,15 @@ describe('lib/files', () => { }) }) + // https://github.com/cypress-io/cypress/issues/1558 + it('explicit null encoding is written exactly as received', function () { + return files.writeFile(this.projectRoot, '.projects/write_file.txt', Buffer.from(''), { encoding: null }).then(() => { + return files.readFile(this.projectRoot, '.projects/write_file.txt', { encoding: null }).then(({ contents }) => { + expect(contents).to.eql(Buffer.from('')) + }) + }) + }) + it('overwrites existing file by default', function () { return files.writeFile(this.projectRoot, '.projects/write_file.txt', 'foo').then(() => { return files.readFile(this.projectRoot, '.projects/write_file.txt').then(({ contents }) => { diff --git a/packages/server/test/unit/fixture_spec.js b/packages/server/test/unit/fixture_spec.js index 9046a19f395c..7a80a57a0c63 100644 --- a/packages/server/test/unit/fixture_spec.js +++ b/packages/server/test/unit/fixture_spec.js @@ -18,6 +18,9 @@ describe('lib/fixture', () => { FixturesHelper.scaffold() this.todosPath = FixturesHelper.projectPath('todos') + this.read = (folder, image, encoding) => { + return fs.readFileAsync(path.join(folder, image), encoding) + } return config.get(this.todosPath).then((cfg) => { ({ fixturesFolder: this.fixturesFolder } = cfg) @@ -172,8 +175,8 @@ Expecting 'EOF', '}', ':', ',', ']', got 'STRING'\ return config.get(projectPath) .then((cfg) => { return fixture.get(cfg.fixturesFolder, 'foo') - .then((fixture) => { - expect(fixture).to.deep.eq({ 'bar': 'baz' }) + .then((result) => { + expect(result).to.deep.eq({ 'bar': 'baz' }) }) }) }) @@ -325,6 +328,15 @@ John,Chef,1982 }) }) + // https://github.com/cypress-io/cypress/issues/1558 + context('binary files', () => { + it('returns file as buffer regardless of extension when passed null encoding', function () { + return fixture.get(this.fixturesFolder, 'nested/fixture.js', { encoding: null }).then((index) => { + expect(index).to.eql(Buffer.from('{nested: "fixture"}')) + }) + }) + }) + context('file with unknown extension and encoding specified', () => { it('returns text encoded as specified', function () { return fixture.get(this.fixturesFolder, 'ascii.foo', { encoding: 'ascii' }).then((index) => { @@ -334,69 +346,64 @@ John,Chef,1982 }) context('image files', () => { - beforeEach(function () { - this.read = (folder, image, encoding) => { - return fs.readFileAsync(path.join(folder, image), encoding) - } - }) - - it('returns png as string', function () { - return this.read(this.fixturesFolder, 'images/flower.png', 'base64') - .then((str) => { + it('returns png as buffer', function () { + return this.read(this.fixturesFolder, 'images/flower.png') + .then((file) => { return fixture.get(this.fixturesFolder, 'images/flower.png') - .then((base64) => { - expect(base64).to.eq(str) + .then((result) => { + expect(result).to.eql(file) }) }) }) - it('returns jpg as string', function () { - return this.read(this.fixturesFolder, 'images/sample.jpg', 'base64') - .then((str) => { + it('returns jpg as buffer', function () { + return this.read(this.fixturesFolder, 'images/sample.jpg') + .then((file) => { return fixture.get(this.fixturesFolder, 'images/sample.jpg') - .then((base64) => { - expect(base64).to.eq(str) + .then((result) => { + expect(result).to.eql(file) }) }) }) - it('returns gif as string', function () { - return this.read(this.fixturesFolder, 'images/word.gif', 'base64') - .then((str) => { + it('returns gif as buffer', function () { + return this.read(this.fixturesFolder, 'images/word.gif') + .then((file) => { return fixture.get(this.fixturesFolder, 'images/word.gif') - .then((base64) => { - expect(base64).to.eq(str) + .then((result) => { + expect(result).to.eql(file) }) }) }) - it('returns tif as string', function () { - return this.read(this.fixturesFolder, 'images/sample.tif', 'base64') - .then((str) => { + it('returns tif as buffer', function () { + return this.read(this.fixturesFolder, 'images/sample.tif') + .then((file) => { return fixture.get(this.fixturesFolder, 'images/sample.tif') - .then((base64) => { - expect(base64).to.eq(str) + .then((result) => { + expect(result).to.eql(file) }) }) }) - it('returns png as binary', function () { + it('returns png as binary if that encoding is requested', function () { return this.read(this.fixturesFolder, 'images/flower.png', 'binary') - .then((bin) => { + .then((file) => { return fixture.get(this.fixturesFolder, 'images/flower.png', { encoding: 'binary' }) - .then((bin2) => { - expect(bin).to.eq(bin2) + .then((result) => { + expect(result).to.eq(file) }) }) }) }) context('zip files', () => { - it('returns zip as base64 string', function () { - return fixture.get(this.fixturesFolder, 'example.zip').then((base64) => { - const str = 'UEsDBAoAAAAAAK2zOUcAAAAAAAAAAAAAAAAEABAAemlwL1VYDAAGAwZWBgMGVvUBFABQSwMECgAAAAAAo7M5RwAAAAAAAAAAAAAAAAkAEAB6aXAvYS50eHRVWAwA8QIGVvECBlb1ARQAUEsDBAoAAAAAAKSzOUcAAAAAAAAAAAAAAAAJABAAemlwL2IudHh0VVgMAPMCBlbzAgZW9QEUAFBLAwQKAAAAAAClszlHAAAAAAAAAAAAAAAACQAQAHppcC9jLnR4dFVYDAD1AgZW9QIGVvUBFABQSwMECgAAAAAApbM5RwAAAAAAAAAAAAAAAAkAEAB6aXAvZC50eHRVWAwA9gIGVvYCBlb1ARQAUEsDBAoAAAAAAKazOUcAAAAAAAAAAAAAAAAJABAAemlwL2UudHh0VVgMAPgCBlb4AgZW9QEUAFBLAwQKAAAAAACnszlHAAAAAAAAAAAAAAAACQAQAHppcC9mLnR4dFVYDAD5AgZW+QIGVvUBFABQSwMECgAAAAAAqLM5RwAAAAAAAAAAAAAAAAkAEAB6aXAvZy50eHRVWAwA+wIGVvsCBlb1ARQAUEsDBAoAAAAAAKizOUcAAAAAAAAAAAAAAAAJABAAemlwL2gudHh0VVgMAPwCBlb8AgZW9QEUAFBLAwQKAAAAAACpszlHAAAAAAAAAAAAAAAACQAQAHppcC9pLnR4dFVYDAD9AgZW/QIGVvUBFABQSwMECgAAAAAAqrM5RwAAAAAAAAAAAAAAAAkAEAB6aXAvai50eHRVWAwA/wIGVv8CBlb1ARQAUEsDBAoAAAAAAK2zOUcAAAAAAAAAAAAAAAAJABAAemlwL2sudHh0VVgMAAYDBlYGAwZW9QEUAFBLAQIVAwoAAAAAAK2zOUcAAAAAAAAAAAAAAAAEAAwAAAAAAAAAAEDtQQAAAAB6aXAvVVgIAAYDBlYGAwZWUEsBAhUDCgAAAAAAo7M5RwAAAAAAAAAAAAAAAAkADAAAAAAAAAAAQKSBMgAAAHppcC9hLnR4dFVYCADxAgZW8QIGVlBLAQIVAwoAAAAAAKSzOUcAAAAAAAAAAAAAAAAJAAwAAAAAAAAAAECkgWkAAAB6aXAvYi50eHRVWAgA8wIGVvMCBlZQSwECFQMKAAAAAAClszlHAAAAAAAAAAAAAAAACQAMAAAAAAAAAABApIGgAAAAemlwL2MudHh0VVgIAPUCBlb1AgZWUEsBAhUDCgAAAAAApbM5RwAAAAAAAAAAAAAAAAkADAAAAAAAAAAAQKSB1wAAAHppcC9kLnR4dFVYCAD2AgZW9gIGVlBLAQIVAwoAAAAAAKazOUcAAAAAAAAAAAAAAAAJAAwAAAAAAAAAAECkgQ4BAAB6aXAvZS50eHRVWAgA+AIGVvgCBlZQSwECFQMKAAAAAACnszlHAAAAAAAAAAAAAAAACQAMAAAAAAAAAABApIFFAQAAemlwL2YudHh0VVgIAPkCBlb5AgZWUEsBAhUDCgAAAAAAqLM5RwAAAAAAAAAAAAAAAAkADAAAAAAAAAAAQKSBfAEAAHppcC9nLnR4dFVYCAD7AgZW+wIGVlBLAQIVAwoAAAAAAKizOUcAAAAAAAAAAAAAAAAJAAwAAAAAAAAAAECkgbMBAAB6aXAvaC50eHRVWAgA/AIGVvwCBlZQSwECFQMKAAAAAACpszlHAAAAAAAAAAAAAAAACQAMAAAAAAAAAABApIHqAQAAemlwL2kudHh0VVgIAP0CBlb9AgZWUEsBAhUDCgAAAAAAqrM5RwAAAAAAAAAAAAAAAAkADAAAAAAAAAAAQKSBIQIAAHppcC9qLnR4dFVYCAD/AgZW/wIGVlBLAQIVAwoAAAAAAK2zOUcAAAAAAAAAAAAAAAAJAAwAAAAAAAAAAECkgVgCAAB6aXAvay50eHRVWAgABgMGVgYDBlZQSwUGAAAAAAwADAAfAwAAjwIAAAAA' - - expect(base64).to.eq(str) + it('returns zip as buffer', function () { + return this.read(this.fixturesFolder, 'example.zip') + .then((file) => { + return fixture.get(this.fixturesFolder, 'example.zip').then((result) => { + expect(result).to.eql(file) + }) }) }) }) diff --git a/packages/server/test/unit/modes/run_spec.js b/packages/server/test/unit/modes/run_spec.js index f2121c9c8976..194f02b063f0 100644 --- a/packages/server/test/unit/modes/run_spec.js +++ b/packages/server/test/unit/modes/run_spec.js @@ -1,10 +1,10 @@ require('../../spec_helper') +const _ = require('lodash') const Promise = require('bluebird') const electron = require('electron') const stripAnsi = require('strip-ansi') const snapshot = require('snap-shot-it') -const R = require('ramda') const pkg = require('@packages/root') const { fs } = require(`${root}../lib/util/fs`) const user = require(`${root}../lib/user`) @@ -861,7 +861,7 @@ describe('lib/modes/run', () => { // for some reason I cannot stub property value using Sinon let version // save a copy of "true" experiments right away - const names = R.clone(experimental.names) + const names = _.cloneDeep(experimental.names) before(() => { // reset experiments names before each test diff --git a/packages/server/test/unit/reporter_spec.js b/packages/server/test/unit/reporter_spec.js index c84db90e43ce..5af7e89b044f 100644 --- a/packages/server/test/unit/reporter_spec.js +++ b/packages/server/test/unit/reporter_spec.js @@ -111,7 +111,6 @@ describe('lib/reporter', () => { it('recursively creates suites for fullTitle', function () { const args = this.reporter.parseArgs('fail', [this.testObj]) - console.log(args) expect(args[0]).to.eq('fail') const title = 'TodoMVC - React When page is initially opened should focus on the todo input field' diff --git a/packages/server/test/unit/socket_spec.js b/packages/server/test/unit/socket_spec.js index cc055b97ca5a..97df712735fa 100644 --- a/packages/server/test/unit/socket_spec.js +++ b/packages/server/test/unit/socket_spec.js @@ -456,6 +456,16 @@ describe('lib/socket', () => { return this.client.emit('backend:request', 'get:fixture', 'does-not-exist.txt', {}, cb) }) + + it('passes Buffers through intact', function (done) { + const cb = function (resp) { + expect(resp.response).to.eql(Buffer.from('[{"json": true}]')) + + return done() + } + + return this.client.emit('backend:request', 'get:fixture', 'foo', { encoding: null }, cb) + }) }) context('on(http:request)', () => { diff --git a/packages/server/test/unit/args_spec.js b/packages/server/test/unit/util/args_spec.js similarity index 99% rename from packages/server/test/unit/args_spec.js rename to packages/server/test/unit/util/args_spec.js index 78473d62b23f..02f158198d84 100644 --- a/packages/server/test/unit/args_spec.js +++ b/packages/server/test/unit/util/args_spec.js @@ -1,12 +1,12 @@ -require('../spec_helper') +require('../../spec_helper') const path = require('path') const os = require('os') const snapshot = require('snap-shot-it') const stripAnsi = require('strip-ansi') const minimist = require('minimist') -const argsUtil = require(`${root}lib/util/args`) -const getWindowsProxyUtil = require(`${root}lib/util/get-windows-proxy`) +const argsUtil = require(`${root}../lib/util/args`) +const getWindowsProxyUtil = require(`${root}../lib/util/get-windows-proxy`) const cwd = process.cwd() diff --git a/packages/server/test/unit/cache_buster_spec.js b/packages/server/test/unit/util/cache_buster_spec.js similarity index 85% rename from packages/server/test/unit/cache_buster_spec.js rename to packages/server/test/unit/util/cache_buster_spec.js index eb981877b1df..4c8ee580c128 100644 --- a/packages/server/test/unit/cache_buster_spec.js +++ b/packages/server/test/unit/util/cache_buster_spec.js @@ -1,6 +1,6 @@ -require('../spec_helper') +require('../../spec_helper') -const CacheBuster = require(`${root}lib/util/cache_buster`) +const CacheBuster = require(`${root}../lib/util/cache_buster`) describe('lib/cache_buster', () => { context('#get', () => { diff --git a/packages/server/test/unit/chrome_policy_check.js b/packages/server/test/unit/util/chrome_policy_check.js similarity index 94% rename from packages/server/test/unit/chrome_policy_check.js rename to packages/server/test/unit/util/chrome_policy_check.js index a576044ef6e6..449f39b681c5 100644 --- a/packages/server/test/unit/chrome_policy_check.js +++ b/packages/server/test/unit/util/chrome_policy_check.js @@ -1,8 +1,8 @@ -require('../spec_helper') +require('../../spec_helper') const _ = require('lodash') const { stripIndent } = require('common-tags') -const chromePolicyCheck = require(`${root}lib/util/chrome_policy_check`) +const chromePolicyCheck = require(`${root}../lib/util/chrome_policy_check`) describe('lib/util/chrome_policy_check', () => { context('.getRunner returns a function', () => { diff --git a/packages/server/test/unit/ci_provider_spec.js b/packages/server/test/unit/util/ci_provider_spec.js similarity index 99% rename from packages/server/test/unit/ci_provider_spec.js rename to packages/server/test/unit/util/ci_provider_spec.js index 5fbaf29d55da..77e2c1e12827 100644 --- a/packages/server/test/unit/ci_provider_spec.js +++ b/packages/server/test/unit/util/ci_provider_spec.js @@ -1,8 +1,8 @@ const mockedEnv = require('mocked-env') -require('../spec_helper') +require('../../spec_helper') -const ciProvider = require(`${root}lib/util/ci_provider`) +const ciProvider = require(`${root}../lib/util/ci_provider`) const expectsName = (name) => { expect(ciProvider.provider(), 'CI providers detected name').to.eq(name) diff --git a/packages/server/test/unit/coerce_spec.js b/packages/server/test/unit/util/coerce_spec.js similarity index 94% rename from packages/server/test/unit/coerce_spec.js rename to packages/server/test/unit/util/coerce_spec.js index d1e33d7246c2..b6b58a7898d6 100644 --- a/packages/server/test/unit/coerce_spec.js +++ b/packages/server/test/unit/util/coerce_spec.js @@ -1,7 +1,7 @@ -require('../spec_helper') +require('../../spec_helper') -const { coerce } = require(`${root}lib/util/coerce`) -const { getProcessEnvVars } = require(`${root}lib/util/config`) +const { coerce } = require(`${root}../lib/util/coerce`) +const { getProcessEnvVars } = require(`${root}../lib/util/config`) describe('lib/util/coerce', () => { beforeEach(function () { diff --git a/packages/server/test/unit/util/config_spec.js b/packages/server/test/unit/util/config_spec.js new file mode 100644 index 000000000000..aaa99ab53e32 --- /dev/null +++ b/packages/server/test/unit/util/config_spec.js @@ -0,0 +1,48 @@ +require('../../spec_helper') + +const configUtil = require(`${root}../lib/util/config`) + +describe('lib/util/config', () => { + context('.isDefault', () => { + it('returns true if value is default value', () => { + const options = { + resolved: { + baseUrl: { from: 'default' }, + }, + } + + expect(configUtil.isDefault(options, 'baseUrl')).to.be.true + }) + + it('returns false if value is not default value', () => { + const options = { + resolved: { + baseUrl: { from: 'cli' }, + }, + } + + expect(configUtil.isDefault(options, 'baseUrl')).to.be.false + }) + }) + + context('.getProcessEnvVars', () => { + it('returns process envs prefixed with cypress', () => { + const envs = { + CYPRESS_BASE_URL: 'value', + RANDOM_ENV: 'ignored', + } + + expect(configUtil.getProcessEnvVars(envs)).to.deep.eq({ + BASE_URL: 'value', + }) + }) + + it('does not return CYPRESS_RESERVED_ENV_VARS', () => { + const envs = { + CYPRESS_INTERNAL_ENV: 'value', + } + + expect(configUtil.getProcessEnvVars(envs)).to.deep.eq({}) + }) + }) +}) diff --git a/packages/server/test/unit/duration_spec.js b/packages/server/test/unit/util/duration_spec.js similarity index 88% rename from packages/server/test/unit/duration_spec.js rename to packages/server/test/unit/util/duration_spec.js index 251b567ee188..6c23bc939fd0 100644 --- a/packages/server/test/unit/duration_spec.js +++ b/packages/server/test/unit/util/duration_spec.js @@ -1,6 +1,6 @@ -require('../spec_helper') +require('../../spec_helper') -const duration = require(`${root}lib/util/duration`) +const duration = require(`${root}../lib/util/duration`) describe('lib/util/duration', () => { context('.format', () => { diff --git a/packages/server/test/unit/ensure_url_spec.ts b/packages/server/test/unit/util/ensure_url_spec.ts similarity index 95% rename from packages/server/test/unit/ensure_url_spec.ts rename to packages/server/test/unit/util/ensure_url_spec.ts index b80aa01171aa..47c8af1904e1 100644 --- a/packages/server/test/unit/ensure_url_spec.ts +++ b/packages/server/test/unit/util/ensure_url_spec.ts @@ -1,7 +1,7 @@ -import '../spec_helper' +import '../../spec_helper' import { connect, agent } from '@packages/network' -import { isListening } from '../../lib/util/ensure-url' +import { isListening } from '../../../lib/util/ensure-url' import sinon from 'sinon' import nock from 'nock' diff --git a/packages/server/test/unit/file_spec.js b/packages/server/test/unit/util/file_spec.js similarity index 97% rename from packages/server/test/unit/file_spec.js rename to packages/server/test/unit/util/file_spec.js index fded35dcebc5..f126b7238fd6 100644 --- a/packages/server/test/unit/file_spec.js +++ b/packages/server/test/unit/util/file_spec.js @@ -1,13 +1,13 @@ -require('../spec_helper') +require('../../spec_helper') const os = require('os') const path = require('path') const Promise = require('bluebird') const lockFile = Promise.promisifyAll(require('lockfile')) -const { fs } = require(`${root}lib/util/fs`) -const env = require(`${root}lib/util/env`) -const exit = require(`${root}lib/util/exit`) -const FileUtil = require(`${root}lib/util/file`) +const { fs } = require(`${root}../lib/util/fs`) +const env = require(`${root}../lib/util/env`) +const exit = require(`${root}../lib/util/exit`) +const FileUtil = require(`${root}../lib/util/file`) describe('lib/util/file', () => { beforeEach(function () { diff --git a/packages/server/test/unit/human_time_spec.js b/packages/server/test/unit/util/human_time_spec.js similarity index 93% rename from packages/server/test/unit/human_time_spec.js rename to packages/server/test/unit/util/human_time_spec.js index c61bd1148cda..d93710a31174 100644 --- a/packages/server/test/unit/human_time_spec.js +++ b/packages/server/test/unit/util/human_time_spec.js @@ -1,7 +1,7 @@ -require('../spec_helper') +require('../../spec_helper') const humanInterval = require('human-interval') -const humanTime = require(`${root}lib/util/human_time`) +const humanTime = require(`${root}../lib/util/human_time`) describe('lib/util/human_time', () => { context('.long', () => { diff --git a/packages/server/test/unit/newlines_spec.ts b/packages/server/test/unit/util/newlines_spec.ts similarity index 83% rename from packages/server/test/unit/newlines_spec.ts rename to packages/server/test/unit/util/newlines_spec.ts index a3050923d0b4..a5f06ca4aa3c 100644 --- a/packages/server/test/unit/newlines_spec.ts +++ b/packages/server/test/unit/util/newlines_spec.ts @@ -1,6 +1,6 @@ -import '../spec_helper' +import '../../spec_helper' -import newlines from '../../lib/util/newlines' +import newlines from '../../../lib/util/newlines' describe('lib/util/newlines', function () { it('inserts newline at each n char', function () { diff --git a/packages/server/test/unit/open_spec.js b/packages/server/test/unit/util/open_spec.js similarity index 92% rename from packages/server/test/unit/open_spec.js rename to packages/server/test/unit/util/open_spec.js index d69a2c01c78a..05d9d1bb0a72 100644 --- a/packages/server/test/unit/open_spec.js +++ b/packages/server/test/unit/util/open_spec.js @@ -1,7 +1,7 @@ -require('../spec_helper') +require('../../spec_helper') const cp = require('child_process') -const open = require(`${root}lib/util/open`) +const open = require(`${root}../lib/util/open`) const platform = (p) => { return Object.defineProperty(process, 'platform', { diff --git a/packages/server/test/unit/origin_spec.js b/packages/server/test/unit/util/origin_spec.js similarity index 85% rename from packages/server/test/unit/origin_spec.js rename to packages/server/test/unit/util/origin_spec.js index 15876e2d1541..e3ac7d15e27a 100644 --- a/packages/server/test/unit/origin_spec.js +++ b/packages/server/test/unit/util/origin_spec.js @@ -1,6 +1,6 @@ -require('../spec_helper') +require('../../spec_helper') -const origin = require(`${root}lib/util/origin`) +const origin = require(`${root}../lib/util/origin`) describe('lib/util/origin', () => { beforeEach(function () { diff --git a/packages/server/test/unit/path_helpers_spec.js b/packages/server/test/unit/util/path_helpers_spec.js similarity index 84% rename from packages/server/test/unit/path_helpers_spec.js rename to packages/server/test/unit/util/path_helpers_spec.js index 0704b9bbd960..86323723783d 100644 --- a/packages/server/test/unit/path_helpers_spec.js +++ b/packages/server/test/unit/util/path_helpers_spec.js @@ -1,6 +1,6 @@ -require('../spec_helper') +require('../../spec_helper') -const path_helpers = require(`${root}lib/util/path_helpers`) +const path_helpers = require(`${root}../lib/util/path_helpers`) describe('lib/util/path_helpers', () => { context('checkIfResolveChangedRootFolder', () => { diff --git a/packages/server/test/unit/profile_cleaner_spec.js b/packages/server/test/unit/util/profile_cleaner_spec.js similarity index 92% rename from packages/server/test/unit/profile_cleaner_spec.js rename to packages/server/test/unit/util/profile_cleaner_spec.js index 6fa33e71a952..b6af0812bc25 100644 --- a/packages/server/test/unit/profile_cleaner_spec.js +++ b/packages/server/test/unit/util/profile_cleaner_spec.js @@ -1,10 +1,10 @@ -require('../spec_helper') +require('../../spec_helper') const os = require('os') const path = require('path') -const { fs } = require(`${root}/lib/util/fs`) -const findProcess = require(`${root}lib/util/find_process`) -const profileCleaner = require(`${root}lib/util/profile_cleaner`) +const { fs } = require(`${root}../lib/util/fs`) +const findProcess = require(`${root}../lib/util/find_process`) +const profileCleaner = require(`${root}../lib/util/profile_cleaner`) const tmpDir = os.tmpdir() const pidProfilesFolder = path.join(tmpDir, 'pid-profiles') diff --git a/packages/server/test/unit/random_spec.js b/packages/server/test/unit/util/random_spec.js similarity index 88% rename from packages/server/test/unit/random_spec.js rename to packages/server/test/unit/util/random_spec.js index 4864243a7c58..7270577af187 100644 --- a/packages/server/test/unit/random_spec.js +++ b/packages/server/test/unit/util/random_spec.js @@ -1,7 +1,7 @@ -require('../spec_helper') +require('../../spec_helper') const randomstring = require('randomstring') -const random = require(`${root}lib/util/random`) +const random = require(`${root}../lib/util/random`) context('.id', () => { it('returns random.generate string with length 5 by default', () => { diff --git a/packages/server/test/unit/routes_util_spec.js b/packages/server/test/unit/util/routes_spec.js similarity index 93% rename from packages/server/test/unit/routes_util_spec.js rename to packages/server/test/unit/util/routes_spec.js index bcf0e0c78346..f491b6125794 100644 --- a/packages/server/test/unit/routes_util_spec.js +++ b/packages/server/test/unit/util/routes_spec.js @@ -1,6 +1,6 @@ -require('../spec_helper') +require('../../spec_helper') -const { apiRoutes, onRoutes } = require(`${root}/lib/util/routes`) +const { apiRoutes, onRoutes } = require(`${root}../lib/util/routes`) describe('lib/util/routes', () => { describe('api routes', () => { diff --git a/packages/server/test/unit/specs_spec.js b/packages/server/test/unit/util/specs_spec.js similarity index 94% rename from packages/server/test/unit/specs_spec.js rename to packages/server/test/unit/util/specs_spec.js index 2f72cfb4aaf9..dc7f7567f838 100644 --- a/packages/server/test/unit/specs_spec.js +++ b/packages/server/test/unit/util/specs_spec.js @@ -1,9 +1,9 @@ -require('../spec_helper') +require('../../spec_helper') -const R = require('ramda') +const _ = require('lodash') const path = require('path') -const config = require(`${root}lib/config`) -const specsUtil = require(`${root}lib/util/specs`).default +const config = require(`${root}../lib/config`) +const specsUtil = require(`${root}../lib/util/specs`).default const FixturesHelper = require('@tooling/system-tests/lib/fixtures') const debug = require('debug')('test') @@ -33,7 +33,7 @@ describe('lib/util/specs', () => { it('returns absolute filenames', function () { return specsUtil .findSpecs(this.config) - .then((R.forEach(checkFoundSpec))) + .then(((specs) => specs.forEach(checkFoundSpec))) }) it('handles fixturesFolder being false', function () { @@ -65,7 +65,7 @@ describe('lib/util/specs', () => { cfg.resolved.testingType = { value: 'component' } return specsUtil.findSpecs(cfg) - }).then(R.project(['relative', 'specType'])) + }).then((val) => val.map((spec) => _.pick(spec, ['relative', 'specType']))) .then((files) => { expect(files).to.deep.equal([ { diff --git a/packages/server/test/unit/stream_buffer_spec.js b/packages/server/test/unit/util/stream_buffer_spec.js similarity index 98% rename from packages/server/test/unit/stream_buffer_spec.js rename to packages/server/test/unit/util/stream_buffer_spec.js index bfb5db3da574..c7ae9eea1b72 100644 --- a/packages/server/test/unit/stream_buffer_spec.js +++ b/packages/server/test/unit/util/stream_buffer_spec.js @@ -1,11 +1,11 @@ -require('../spec_helper') +require('../../spec_helper') const _ = require('lodash') const fs = require('fs') const stream = require('stream') const Promise = require('bluebird') const { concatStream } = require('@packages/network') -const { streamBuffer } = require('../../lib/util/stream_buffer') +const { streamBuffer } = require('../../../lib/util/stream_buffer') function drain (stream) { return new Promise((resolve) => { diff --git a/packages/server/test/unit/suppress_warnings_spec.ts b/packages/server/test/unit/util/suppress_warnings_spec.ts similarity index 87% rename from packages/server/test/unit/suppress_warnings_spec.ts rename to packages/server/test/unit/util/suppress_warnings_spec.ts index 7509cf48dad3..bee28e6d04bb 100644 --- a/packages/server/test/unit/suppress_warnings_spec.ts +++ b/packages/server/test/unit/util/suppress_warnings_spec.ts @@ -1,4 +1,4 @@ -import '../spec_helper' +import '../../spec_helper' import { expect } from 'chai' import execa from 'execa' import proxyquire from 'proxyquire' @@ -6,7 +6,7 @@ import proxyquire from 'proxyquire' const ERROR_MESSAGE = 'Setting the NODE_TLS_REJECT_UNAUTHORIZED' const TLS_CONNECT = `require('tls').connect().on('error', ()=>{});` -const SUPPRESS_WARNING = `require('${__dirname}/../../lib/util/suppress_warnings').suppress();` +const SUPPRESS_WARNING = `require('${__dirname}/../../../lib/util/suppress_warnings').suppress();` describe('lib/util/suppress_warnings', function () { it('tls.connect emits warning if NODE_TLS_REJECT_UNAUTHORIZED=0 and not suppressed', function () { @@ -36,7 +36,7 @@ describe('lib/util/suppress_warnings', function () { const emitWarning = sinon.spy(process, 'emitWarning') // force typescript to always be non-requireable - const { suppress } = proxyquire('../../lib/util/suppress_warnings', {}) + const { suppress } = proxyquire('../../../lib/util/suppress_warnings', {}) suppress() diff --git a/packages/server/test/unit/terminal_spec.js b/packages/server/test/unit/util/terminal_spec.js similarity index 94% rename from packages/server/test/unit/terminal_spec.js rename to packages/server/test/unit/util/terminal_spec.js index 73e51e7a2e9e..3d8e6da471a2 100644 --- a/packages/server/test/unit/terminal_spec.js +++ b/packages/server/test/unit/util/terminal_spec.js @@ -1,11 +1,11 @@ -require('../spec_helper') +require('../../spec_helper') const snapshot = require('snap-shot-it') const stripAnsi = require('strip-ansi') const widestLine = require('widest-line') -const env = require(`${root}lib/util/env`) -const terminal = require(`${root}lib/util/terminal`) -const terminalSize = require(`${root}lib/util/terminal-size`) +const env = require(`${root}../lib/util/env`) +const terminal = require(`${root}../lib/util/terminal`) +const terminalSize = require(`${root}../lib/util/terminal-size`) const sanitizeSnapshot = (str) => { return snapshot(stripAnsi(str)) diff --git a/packages/server/test/unit/trash_spec.js b/packages/server/test/unit/util/trash_spec.js similarity index 96% rename from packages/server/test/unit/trash_spec.js rename to packages/server/test/unit/util/trash_spec.js index a8d4aecb0e59..953657a2b828 100644 --- a/packages/server/test/unit/trash_spec.js +++ b/packages/server/test/unit/util/trash_spec.js @@ -1,9 +1,9 @@ -require('../spec_helper') +require('../../spec_helper') const fs = require('fs') const os = require('os') const path = require('path') -const trash = require(`${root}lib/util/trash`) +const trash = require(`${root}../lib/util/trash`) const populateDirectories = function (basePath) { fs.mkdirSync(basePath) diff --git a/packages/server/test/unit/tty_spec.js b/packages/server/test/unit/util/tty_spec.js similarity index 95% rename from packages/server/test/unit/tty_spec.js rename to packages/server/test/unit/util/tty_spec.js index df66cc0493a6..277e9ff4bed2 100644 --- a/packages/server/test/unit/tty_spec.js +++ b/packages/server/test/unit/util/tty_spec.js @@ -1,8 +1,8 @@ -require('../spec_helper') +require('../../spec_helper') const tty = require('tty') -const ttyUtil = require(`${root}lib/util/tty`) -const terminalSize = require(`${root}lib/util/terminal-size`) +const ttyUtil = require(`${root}../lib/util/tty`) +const terminalSize = require(`${root}../lib/util/terminal-size`) const ttys = [process.stdin.isTTY, process.stdout.isTTY, process.stderr.isTTY] diff --git a/scripts/binary/build.js b/scripts/binary/build.js index 697e5a8bb7f3..6d11c608feed 100644 --- a/scripts/binary/build.js +++ b/scripts/binary/build.js @@ -10,7 +10,6 @@ const pluralize = require('pluralize') const execa = require('execa') const electron = require('@packages/electron') const debug = require('debug')('cypress:binary') -const R = require('ramda') const la = require('lazy-ass') const check = require('check-more-types') @@ -116,7 +115,11 @@ const buildCypressApp = function (platform, version, options = {}) { return packages.runAllBuild() // Promise.resolve() - .then(R.tap(logBuiltAllPackages)) + .then((val) => { + logBuiltAllPackages(val) + + return val + }) } const copyPackages = function () { @@ -343,7 +346,7 @@ require('./packages/server')\ console.log('in build folder %s', buildFolder) return execa('ls', ['-la', buildFolder]) - .then(R.prop('stdout')) + .then((val) => val.stdout) .then(console.log) } @@ -444,14 +447,16 @@ require('./packages/server')\ } const printDiskUsage = function (sizes) { - const bySize = R.sortBy(R.prop('1')) - - return console.log(bySize(R.toPairs(sizes))) + return console.log(_.sortBy(_.toPairs(sizes), 1)) } return execa('du', args) .then(parseDiskUsage) - .then(R.tap(printDiskUsage)) + .then((val) => { + printDiskUsage(val) + + return val + }) .then((sizes) => { return performanceTracking.track('test runner size', sizes) }) diff --git a/scripts/binary/bump.js b/scripts/binary/bump.js index 335dfbfd4132..42976a8b06c2 100644 --- a/scripts/binary/bump.js +++ b/scripts/binary/bump.js @@ -4,7 +4,6 @@ const bumpercar = require('@cypress/bumpercar') const path = require('path') const la = require('lazy-ass') const check = require('check-more-types') -const R = require('ramda') const { configFromEnvOrJsonFile, filenameToShellVariable } = require('@cypress/env-or-json-file') const makeEmptyGithubCommit = require('make-empty-github-commit') const parse = require('parse-github-repo-url') @@ -88,7 +87,7 @@ const getCiConfig = function () { return config } -const awaitEachProjectAndProvider = function (projects, fn, filter = R.identity) { +const awaitEachProjectAndProvider = function (projects, fn, filter = (val) => val) { const creds = getCiConfig() // configure a new Bumpercar @@ -119,7 +118,7 @@ const awaitEachProjectAndProvider = function (projects, fn, filter = R.identity) car = bumpercar.create({ providers }) - const filteredProjects = R.filter(filter, projects) + const filteredProjects = projects.filter(filter) if (check.empty(filteredProjects)) { console.log('⚠️ zero filtered projects left after filtering') @@ -136,26 +135,17 @@ const awaitEachProjectAndProvider = function (projects, fn, filter = R.identity) // do not trigger all projects if there is specific provider // for example appVeyor should be used for Windows testing const getFilterByProvider = function (providerName, platformName) { - let platformFilter; let providerFilter + return (val) => { + if (providerName && val.provider !== providerName) { + return false + } - if (providerName) { - console.log('only allow projects for provider', providerName) - providerFilter = R.propEq('provider', providerName) - } else { - providerFilter = R.identity - } + if (platformName && val.platform !== platformName) { + return false + } - if (platformName) { - console.log('only allow projects for platform', platformName) - platformFilter = R.propEq('platform', platformName) - } else { - platformFilter = R.identity + return val } - - // combined filter is when both filters pass - const projectFilter = R.allPass([providerFilter, platformFilter]) - - return projectFilter } module.exports = { @@ -199,7 +189,7 @@ module.exports = { } return awaitEachProjectAndProvider(PROJECTS, updateProject, projectFilter) - .then(R.always(result)) + .then(() => result) }, // triggers test projects on multiple CIs diff --git a/scripts/binary/index.js b/scripts/binary/index.js index 50c21ebcc1f5..79a689393d0b 100644 --- a/scripts/binary/index.js +++ b/scripts/binary/index.js @@ -12,7 +12,6 @@ const la = require('lazy-ass') const check = require('check-more-types') const debug = require('debug')('cypress:binary') const questionsRemain = require('@cypress/questions-remain') -const R = require('ramda') const rp = require('@cypress/request-promise') const zip = require('./zip') @@ -37,7 +36,7 @@ const fail = (str) => { return console.log(chalk.bgRed(` ${chalk.black(str)} `)) } -const zippedFilename = R.always(upload.zipName) +const zippedFilename = () => upload.zipName // goes through the list of properties and asks relevant question // resolves with all relevant options set diff --git a/scripts/binary/meta.js b/scripts/binary/meta.js index eb25b5e5bcda..4a89711b5617 100644 --- a/scripts/binary/meta.js +++ b/scripts/binary/meta.js @@ -1,8 +1,8 @@ const path = require('path') const la = require('lazy-ass') const check = require('check-more-types') -const R = require('ramda') const os = require('os') +const _ = require('lodash') // canonical platform names const platforms = { @@ -11,11 +11,11 @@ const platforms = { windows: 'win32', } -const isValidPlatform = check.oneOf(R.values(platforms)) +const isValidPlatform = check.oneOf(_.values(platforms)) const checkPlatform = (platform) => { return la(isValidPlatform(platform), - 'invalid build platform', platform, 'valid choices', R.values(platforms)) + 'invalid build platform', platform, 'valid choices', _.values(platforms)) } const buildRootDir = () => { diff --git a/scripts/binary/move-binaries.ts b/scripts/binary/move-binaries.ts index f2571664e171..180c27b402c2 100644 --- a/scripts/binary/move-binaries.ts +++ b/scripts/binary/move-binaries.ts @@ -1,3 +1,5 @@ +import _ from 'lodash' + import { s3helpers } from './s3-api' const debug = require('debug')('cypress:binary') import la from 'lazy-ass' @@ -5,7 +7,6 @@ import is from 'check-more-types' // using "arg" module for parsing CLI arguments // because it plays really nicely with TypeScript import arg from 'arg' -import { prop, sortBy, last, equals } from 'ramda' import pluralize from 'pluralize' // inquirer-confirm is missing type definition @@ -87,9 +88,9 @@ export const findBuildByCommit = (commit: commit, s3paths: string[]) => { // each path includes commit SHA and build number, let's pick the last build const parsedBuilds = matching.map(parseBuildPath) - const sortedBuilds = sortBy(prop('build'))(parsedBuilds) + const sortedBuilds = _.sortBy(parsedBuilds, 'build') - return prop('s3path', last(sortedBuilds)) + return _.last(sortedBuilds).s3path } /** @@ -141,14 +142,14 @@ export const moveBinaries = async (args = []) => { // found s3 paths with last build for same commit for all platforms const lastBuilds: Desktop[] = [] - let platforms: platformArch[] = uploadUtils.getValidPlatformArchs() + let platforms: platformArch[] = uploadUtils.getValidPlatformArchs() as platformArch[] if (options['--platformArch']) { const onlyPlatform = options['--platformArch'] console.log('only moving single platform %s', onlyPlatform) la(uploadUtils.isValidPlatformArch(onlyPlatform), 'invalid platform-arch', onlyPlatform) - platforms = platforms.filter(equals(onlyPlatform)) + platforms = platforms.filter((p) => p === onlyPlatform) } la(platforms.length, 'no platforms to move', platforms) @@ -193,7 +194,7 @@ export const moveBinaries = async (args = []) => { console.log('Copying %s for commit %s', pluralize('last build', lastBuilds.length, true), releaseOptions.commit) - console.log(lastBuilds.map(prop('s3zipPath')).join('\n')) + console.log(lastBuilds.map((v) => v.s3zipPath).join('\n')) try { await prompts.shouldCopy() diff --git a/scripts/binary/s3-api.ts b/scripts/binary/s3-api.ts index a862ce982a9e..52eca2f2c1af 100644 --- a/scripts/binary/s3-api.ts +++ b/scripts/binary/s3-api.ts @@ -2,10 +2,9 @@ const debug = require('debug')('cypress:binary') import la from 'lazy-ass' import is from 'check-more-types' import S3 from 'aws-sdk/clients/s3' -import { prop, values, all } from 'ramda' export const hasOnlyStringValues = (o) => { - return all(is.unemptyString, values(o)) + return Object.values(o).every((v) => is.unemptyString(v)) } /** @@ -67,7 +66,7 @@ export const s3helpers = { debug('AWS result in %s %s', bucket, prefix) debug('%o', result) - resolve(result.CommonPrefixes.map(prop('Prefix'))) + resolve(result.CommonPrefixes.map((val) => val.Prefix)) }) }) }, diff --git a/scripts/binary/upload-unique-binary.js b/scripts/binary/upload-unique-binary.js index e6b0fca2eed4..f2e381f2a368 100644 --- a/scripts/binary/upload-unique-binary.js +++ b/scripts/binary/upload-unique-binary.js @@ -8,8 +8,8 @@ const awspublish = require('gulp-awspublish') const rename = require('gulp-rename') const gulpDebug = require('gulp-debug') const gulp = require('gulp') -const R = require('ramda') const hasha = require('hasha') +const _ = require('lodash') const uploadUtils = require('./util/upload') const { @@ -147,9 +147,8 @@ const uploadUniqueBinary = function (args = []) { }) console.log('Upload unique binary options') - const pickOptions = R.pick(['file', 'version', 'hash']) - console.log(pickOptions(options)) + console.log(_.pick(options, ['file', 'version', 'hash'])) la(check.unemptyString(options.file), 'missing file to upload', options) la(isBinaryFile(options.file), diff --git a/scripts/binary/util/packages.js b/scripts/binary/util/packages.js index fb0390d4ab52..fc0cbd6a81c4 100644 --- a/scripts/binary/util/packages.js +++ b/scripts/binary/util/packages.js @@ -8,7 +8,6 @@ const retry = require('bluebird-retry') const la = require('lazy-ass') const check = require('check-more-types') const execa = require('execa') -const R = require('ramda') const prettyMs = require('pretty-ms') const pluralize = require('pluralize') const debug = require('debug')('cypress:binary') @@ -39,7 +38,7 @@ const createCLIExecutable = (command) => { return execa(command, args, { stdio: 'inherit', cwd, env }) // if everything is ok, resolve with nothing - .then(R.always(undefined)) + .then(() => undefined) .catch((result) => { const msg = `${commandToExecute} failed with exit code: ${result.code}` diff --git a/scripts/binary/zip.js b/scripts/binary/zip.js index a18fec3017d5..9aafe1cb4943 100644 --- a/scripts/binary/zip.js +++ b/scripts/binary/zip.js @@ -4,7 +4,6 @@ const execa = require('execa') const path = require('path') const la = require('lazy-ass') const fs = require('fs') -const R = require('ramda') const filesize = require('filesize') // prints disk usage numbers using "du" utility @@ -59,7 +58,7 @@ const macZip = (src, dest) => { return execa(zip, options) .then(onZipFinished) - .then(R.always(dest)) + .then(() => dest) .catch(onError) }) } @@ -100,8 +99,12 @@ const linuxZipAction = function (parentFolder, dest, relativeSource) { return execa(cmd, { shell: true }) .then(onZipFinished) - .then(R.always(dest)) - .then(R.tap(checkZipSize)) + .then(() => dest) + .then((val) => { + checkZipSize(val) + + return val + }) .catch(onError) } @@ -123,7 +126,7 @@ const renameFolder = function (src) { console.log(`renaming ${src} to ${renamed}`) return fs.promises.rename(src, renamed) - .then(R.always(renamed)) + .then(() => renamed) } // resolves with zipped filename @@ -136,7 +139,7 @@ const linuxZip = function (src, dest) { return renameFolder(src) .then((renamedSource) => { return printFileSizes(renamedSource) - .then(R.always(renamedSource)) + .then(() => renamedSource) }).then((renamedSource) => { console.log(`will zip folder ${renamedSource}`) const parentFolder = path.dirname(renamedSource) @@ -173,8 +176,12 @@ const windowsZipAction = function (src, dest) { return execa(cmd, { shell: true }) .then(onZipFinished) - .then(R.always(dest)) - .then(R.tap(checkZipSize)) + .then(() => dest) + .then((val) => { + checkZipSize(val) + + return val + }) .catch(onError) } diff --git a/scripts/unit/binary/bump-spec.js b/scripts/unit/binary/bump-spec.js index 7cdf183a031a..4ebc06e0bf89 100644 --- a/scripts/unit/binary/bump-spec.js +++ b/scripts/unit/binary/bump-spec.js @@ -1,6 +1,7 @@ const la = require('lazy-ass') const snapshot = require('snap-shot-it') -const R = require('ramda') +const _ = require('lodash') + const bump = require('../../binary/bump') /* eslint-env mocha */ @@ -19,10 +20,10 @@ describe('bump', () => { const projects = bump.remapProjects(bump._PROVIDERS) const filter = bump.getFilterByProvider() // should return ALL projects - const filtered = R.filter(filter, projects) + const filtered = projects.filter(filter) la( - R.equals(filtered, projects), + _.isEqual(filtered, projects), 'should have kept all projects', filtered, ) @@ -38,7 +39,7 @@ describe('bump', () => { ) const filter = bump.getFilterByProvider('circle', 'darwin') - const filtered = R.filter(filter, projects) + const filtered = projects.filter(filter) la(filtered.length, 'there should be at least a few projects', filtered) snapshot('should have just circle and darwin projects', filtered) diff --git a/system-tests/lib/performance.js b/system-tests/lib/performance.js index 23a423801673..87899bbb0f35 100644 --- a/system-tests/lib/performance.js +++ b/system-tests/lib/performance.js @@ -4,7 +4,6 @@ const pkg = require('@packages/root') const Promise = require('bluebird') const rp = require('@cypress/request-promise') const debug = require('debug')('cypress:performance') -const R = require('ramda') const API_URL = process.env.PERF_API_URL || 'http://localhost:2999/track' const API_KEY = process.env.PERF_API_KEY @@ -22,18 +21,17 @@ function track (type, data) { return commitInfo() .then((commitInformation) => { const ciInformation = ciProvider.commitParams() || {} - const merged = R.mergeWith(R.or, commitInformation, ciInformation) - const { sha, branch, author, message, timestamp } = merged + const timestamp = commitInformation.timestamp || ciInformation.timestamp const timestampISO = new Date(timestamp * 1000).toISOString() const body = { type, data: { 'package.json Version': pkg.version, - 'Commit SHA': sha, - 'Commit Branch': branch, - 'Commit Author': author, - 'Commit Message': message, + 'Commit SHA': commitInformation.sha || ciInformation.sha, + 'Commit Branch': commitInformation.branch || ciInformation.branch, + 'Commit Author': commitInformation.author || ciInformation.author, + 'Commit Message': commitInformation.message || ciInformation.message, 'Commit Timestamp': timestampISO, 'Build URL': process.env.CIRCLE_BUILD_URL, 'Build Platform': process.platform, diff --git a/system-tests/package.json b/system-tests/package.json index f88ad8abd1f6..2066201c578f 100644 --- a/system-tests/package.json +++ b/system-tests/package.json @@ -64,7 +64,6 @@ "multer": "1.4.2", "nock": "12.0.2", "proxyquire": "2.1.3", - "ramda": "0.27.1", "semver": "7.3.2", "sinon": "5.1.1", "snap-shot-it": "7.9.3", diff --git a/system-tests/projects/e2e/cypress/integration/slowTestThreshold_spec.js b/system-tests/projects/e2e/cypress/integration/slowTestThreshold_spec.js new file mode 100644 index 000000000000..eac2617bed87 --- /dev/null +++ b/system-tests/projects/e2e/cypress/integration/slowTestThreshold_spec.js @@ -0,0 +1,16 @@ +/* eslint-disable no-undef */ +describe('slowTestThreshold', () => { + it('passes inherited', () => { + cy.wait(5) + cy.wrap(true).should('be.true') + }) + + it('passes quickly', { slowTestThreshold: 10000 }, () => { + cy.wrap(true).should('be.true') + }) + + it('passes slowly', { slowTestThreshold: 1 }, () => { + cy.wait(5) + cy.wrap(true).should('be.true') + }) +}) diff --git a/system-tests/test/reporters_spec.js b/system-tests/test/reporters_spec.js index eb0b65b943f7..1db4b1472658 100644 --- a/system-tests/test/reporters_spec.js +++ b/system-tests/test/reporters_spec.js @@ -145,4 +145,21 @@ describe('e2e reporters', () => { reporterOptions: 'topLevelSuite=top suite,flowId=12345,useStdError=\'true\',useStdError=\'true\',recordHookFailures=\'true\',actualVsExpected=\'true\'', }) }) + + it('shows slow tests in yellow', function () { + return systemTests.exec(this, { + spec: 'slowTestThreshold_spec.js', + snapshot: false, + config: { + slowTestThreshold: 1, + }, + processEnv: { + MOCHA_COLORS: 1, + }, + }).then((result) => { + expect(result.stdout.match(/passes inherited(.*)/)[1]).to.contain('\u001b[33m') + expect(result.stdout.match(/passes quickly(.*)/)[1]).not.to.contain('\u001b[33m') + expect(result.stdout.match(/passes slowly(.*)/)[1]).to.contain('\u001b[33m') + }) + }) }) diff --git a/system-tests/test/screenshots_spec.js b/system-tests/test/screenshots_spec.js index ccec353c1687..8ba33b90a606 100644 --- a/system-tests/test/screenshots_spec.js +++ b/system-tests/test/screenshots_spec.js @@ -97,9 +97,6 @@ describe('e2e screenshots', () => { .then((sizes) => { // make sure all of the values are unique expect(sizes).to.deep.eq(_.uniq(sizes)) - - // png1 should not be within 1k of png2 - expect(sizes[0]).not.to.be.closeTo(sizes[1], 1000) }).then(() => { return Promise.all([ sizeOf(screenshot1), diff --git a/yarn.lock b/yarn.lock index 778f7b696b7c..faba1ca648d2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -33840,7 +33840,7 @@ ramda@0.27.0: resolved "https://registry.yarnpkg.com/ramda/-/ramda-0.27.0.tgz#915dc29865c0800bf3f69b8fd6c279898b59de43" integrity sha512-pVzZdDpWwWqEVVLshWUHjNwuVP7SfcmPraYuqocJp1yo2U1R7P+5QAfDhdItkuoGqIBnBYrtPp7rEPqDn9HlZA== -ramda@0.27.1, ramda@^0.27.1, ramda@~0.27.1: +ramda@0.27.1, ramda@^0.27.1: version "0.27.1" resolved "https://registry.yarnpkg.com/ramda/-/ramda-0.27.1.tgz#66fc2df3ef873874ffc2da6aa8984658abacf5c9" integrity sha512-PgIdVpn5y5Yns8vqb8FzBUEYn98V3xcPgawAkkgj0YJ0qDsnHCiNmZYfOGMgOvoB0eWFLpYbhxUR3mxfDIMvpw==