Skip to content

Commit

Permalink
Merge branch 'develop' into issue-4233-click-sticky-element
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmunechika committed Nov 2, 2021
2 parents 1d0f1f7 + 26e4f92 commit 5aa6dc7
Show file tree
Hide file tree
Showing 54 changed files with 715 additions and 681 deletions.
2 changes: 2 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
10 changes: 5 additions & 5 deletions circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -960,7 +960,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,
Expand Down Expand Up @@ -1189,9 +1189,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:
Expand Down Expand Up @@ -2049,7 +2049,7 @@ linux-workflow: &linux-workflow
requires:
- build

- desktop-gui-integration-tests-2x:
- desktop-gui-integration-tests-7x:
requires:
- build
- desktop-gui-component-tests:
Expand Down Expand Up @@ -2119,7 +2119,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
Expand Down
16 changes: 10 additions & 6 deletions cli/lib/cli.js
Original file line number Diff line number Diff line change
@@ -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')
Expand Down Expand Up @@ -279,12 +278,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 = {
Expand Down
3 changes: 1 addition & 2 deletions cli/lib/errors.js
Original file line number Diff line number Diff line change
@@ -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')

Expand Down Expand Up @@ -241,7 +240,7 @@ const CYPRESS_RUN_BINARY = {

function addPlatformInformation (info) {
return util.getPlatformInfo().then((platform) => {
return merge(info, { platform })
return { ...info, platform }
})
}

Expand Down
15 changes: 10 additions & 5 deletions cli/lib/exec/info.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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('<redacted>'),
})
const maskSensitiveVariables = (obj) => {
const masked = { ...obj }

if (masked.CYPRESS_RECORD_KEY) {
masked.CYPRESS_RECORD_KEY = '<redacted>'
}

return masked
}

methods.findCypressEnvironmentVariables = () => {
const isCyVariable = (val, key) => key.startsWith('CYPRESS_')

return R.pickBy(isCyVariable)(process.env)
return _.pickBy(process.env, isCyVariable)
}

const formatCypressVariables = () => {
Expand Down
5 changes: 3 additions & 2 deletions cli/lib/logger.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
const R = require('ramda')
const chalk = require('chalk')

let logs = []
Expand Down Expand Up @@ -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 = () => {
Expand Down
7 changes: 3 additions & 4 deletions cli/lib/tasks/state.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down Expand Up @@ -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,
Expand Down
17 changes: 9 additions & 8 deletions cli/lib/util.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
const _ = require('lodash')
const R = require('ramda')
const os = require('os')
const ospath = require('ospath')
const crypto = require('crypto')
Expand Down Expand Up @@ -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)
}

/**
Expand Down Expand Up @@ -229,11 +227,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)

Expand Down
1 change: 0 additions & 1 deletion cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
3 changes: 1 addition & 2 deletions cli/test/lib/build_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 () {
Expand Down
8 changes: 3 additions & 5 deletions cli/test/lib/cypress_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'))
Expand All @@ -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 () {
Expand Down Expand Up @@ -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
Expand All @@ -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', () => {
Expand Down
7 changes: 7 additions & 0 deletions npm/cypress-schematic/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# [@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)


Expand Down
9 changes: 9 additions & 0 deletions npm/react/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)


Expand Down
19 changes: 19 additions & 0 deletions npm/react/plugins/next/checkSWC.ts
Original file line number Diff line number Diff line change
@@ -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
}
3 changes: 3 additions & 0 deletions npm/react/plugins/next/findNextWebpackConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -38,6 +39,8 @@ async function getNextWebpackConfig (config) {

debug('resolved next.js webpack config %o', nextWebpackConfig)

checkSWC(nextWebpackConfig, config)

return nextWebpackConfig
}

Expand Down
7 changes: 7 additions & 0 deletions npm/vue/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)


Expand Down
2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,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",
Expand Down Expand Up @@ -173,7 +172,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",
Expand Down
4 changes: 2 additions & 2 deletions packages/driver/src/cy/commands/xhr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -103,7 +103,7 @@ type XHRConsoleProps = {
const startXhrServer = (cy, state, config) => {
const logs = {}

server = $Server.create({
server = new Server({
xhrUrl: config('xhrUrl'),
stripOrigin,

Expand Down
Loading

0 comments on commit 5aa6dc7

Please sign in to comment.