mirror of
https://github.com/cypress-io/cypress.git
synced 2026-04-24 07:59:12 -05:00
Merge branch 'develop' into feature-multidomain
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
{
|
||||
"chrome:beta": "100.0.4896.46",
|
||||
"chrome:stable": "99.0.4844.82"
|
||||
"chrome:beta": "100.0.4896.56",
|
||||
"chrome:stable": "99.0.4844.84"
|
||||
}
|
||||
|
||||
@@ -76,7 +76,7 @@ In the following instructions, "X.Y.Z" is used to denote the [next version of Cy
|
||||
|
||||
5. Once the `develop` branch is passing for all test projects with the new changes and the `linux-x64` binary is present at `https://cdn.cypress.io/beta/binary/X.Y.Z/linux-x64/<sha>/cypress.zip`, and the `linux-x64` cypress npm package is present at `https://cdn.cypress.io/beta/binary/X.Y.Z/linux-x64/<sha>/cypress.tgz`, publishing can proceed.
|
||||
|
||||
6. Log into AWS SSO with `aws sso login --profile <name_of_profile>`. The release scripts assumes you are using the `production` profile. If you have setup your credentials under a different profile, be sure to set the `AWS_PROFILE` environment variable.
|
||||
6. [Set up](https://cypress-io.atlassian.net/wiki/spaces/INFRA/pages/1534853121/AWS+SSO+Cypress) an AWS SSO profile with the [Team-CypressApp-Prod](https://cypress-io.atlassian.net/wiki/spaces/INFRA/pages/1534853121/AWS+SSO+Cypress#Team-CypressApp-Prod) role. The release scripts assumes the name of your profile is `production`. If you have setup your credentials under a different profile, be sure to set the `AWS_PROFILE` environment variable. Log into AWS SSO with `aws sso login --profile <name_of_profile>`.
|
||||
|
||||
7. Use the `prepare-release-artifacts` script (Mac/Linux only) to prepare the latest commit to a stable release. When you run this script, the following happens:
|
||||
* the binaries for `<commit sha>` are moved from `beta` to the `desktop` folder for `<new target version>` in S3
|
||||
|
||||
@@ -1,3 +1,10 @@
|
||||
# [@cypress/webpack-dev-server-v1.8.3](https://github.com/cypress-io/cypress/compare/@cypress/webpack-dev-server-v1.8.2...@cypress/webpack-dev-server-v1.8.3) (2022-03-15)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **webpack-dev-server:** do not encodeUri in loader ([#20575](https://github.com/cypress-io/cypress/issues/20575)) ([1b152fc](https://github.com/cypress-io/cypress/commit/1b152fca1b9ed9894cf7a5b2a964c856f73fc685)), closes [#20593](https://github.com/cypress-io/cypress/issues/20593)
|
||||
|
||||
# [@cypress/webpack-dev-server-v1.8.2](https://github.com/cypress-io/cypress/compare/@cypress/webpack-dev-server-v1.8.1...@cypress/webpack-dev-server-v1.8.2) (2022-03-03)
|
||||
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ const makeImport = (file: Cypress.Cypress['spec'], filename: string, chunkName:
|
||||
const magicComments = chunkName ? `/* webpackChunkName: "${chunkName}" */` : ''
|
||||
|
||||
return `"${filename}": {
|
||||
shouldLoad: () => document.location.pathname.includes("${encodeURI(file.absolute)}"),
|
||||
shouldLoad: () => decodeURI(document.location.pathname).includes("${file.absolute}"),
|
||||
load: () => import("${file.absolute}" ${magicComments}),
|
||||
chunkName: "${chunkName}",
|
||||
}`
|
||||
|
||||
@@ -8,12 +8,12 @@ import { webpackDevServerFacts } from '../src/webpackDevServerFacts'
|
||||
|
||||
import { defineDevServerConfig, devServer, startDevServer } from '../'
|
||||
|
||||
const requestSpecFile = (port: number) => {
|
||||
const requestSpecFile = (file: string, port: number) => {
|
||||
return new Promise((res) => {
|
||||
const opts = {
|
||||
host: 'localhost',
|
||||
port,
|
||||
path: '/test/fixtures/foo.spec.js',
|
||||
path: encodeURI(file),
|
||||
}
|
||||
|
||||
const callback = (response: EventEmitter) => {
|
||||
@@ -41,13 +41,15 @@ const webpackConfig = {
|
||||
|
||||
}
|
||||
|
||||
const specs: Cypress.Cypress['spec'][] = [
|
||||
{
|
||||
name: `${root}/test/fixtures/foo.spec.js`,
|
||||
relative: `${root}/test/fixtures/foo.spec.js`,
|
||||
absolute: `${root}/test/fixtures/foo.spec.js`,
|
||||
},
|
||||
]
|
||||
const createSpecs = (name: string): Cypress.Cypress['spec'][] => {
|
||||
return [
|
||||
{
|
||||
name: `${root}/test/fixtures/${name}`,
|
||||
relative: `${root}/test/fixtures/${name}`,
|
||||
absolute: `${root}/test/fixtures/${name}`,
|
||||
},
|
||||
]
|
||||
}
|
||||
|
||||
const config = {
|
||||
projectRoot: root,
|
||||
@@ -62,12 +64,12 @@ describe('#startDevServer', () => {
|
||||
webpackConfig,
|
||||
options: {
|
||||
config,
|
||||
specs,
|
||||
specs: createSpecs('foo.spec.js'),
|
||||
devServerEvents: new EventEmitter(),
|
||||
},
|
||||
})
|
||||
|
||||
const response = await requestSpecFile(port as number)
|
||||
const response = await requestSpecFile('/test/fixtures/foo.spec.js', port as number)
|
||||
|
||||
expect(response).to.eq('const foo = () => {}\n')
|
||||
|
||||
@@ -76,13 +78,89 @@ describe('#startDevServer', () => {
|
||||
})
|
||||
})
|
||||
|
||||
it('serves specs in directory with [] chars via a webpack dev server', async () => {
|
||||
const { port, close } = await startDevServer({
|
||||
webpackConfig,
|
||||
options: {
|
||||
config,
|
||||
specs: createSpecs('[foo]/bar.spec.js'),
|
||||
devServerEvents: new EventEmitter(),
|
||||
},
|
||||
})
|
||||
|
||||
const response = await requestSpecFile('/test/fixtures/[foo]/bar.spec.js', port as number)
|
||||
|
||||
expect(response).to.eq(`it('this is a spec with a path containing []', () => {})\n`)
|
||||
|
||||
return new Promise((res) => {
|
||||
close(() => res())
|
||||
})
|
||||
})
|
||||
|
||||
it('serves specs in directory with non English chars via a webpack dev server', async () => {
|
||||
const { port, close } = await startDevServer({
|
||||
webpackConfig,
|
||||
options: {
|
||||
config,
|
||||
specs: createSpecs('サイプレス.spec.js'),
|
||||
devServerEvents: new EventEmitter(),
|
||||
},
|
||||
})
|
||||
|
||||
const response = await requestSpecFile('/test/fixtures/サイプレス.spec.js', port as number)
|
||||
|
||||
expect(response).to.eq(`it('サイプレス', () => {})\n`)
|
||||
|
||||
return new Promise((res) => {
|
||||
close(() => res())
|
||||
})
|
||||
})
|
||||
|
||||
it('serves specs in directory with ... in the file name via a webpack dev server', async () => {
|
||||
const { port, close } = await startDevServer({
|
||||
webpackConfig,
|
||||
options: {
|
||||
config,
|
||||
specs: createSpecs('[...bar].spec.js'),
|
||||
devServerEvents: new EventEmitter(),
|
||||
},
|
||||
})
|
||||
|
||||
const response = await requestSpecFile('/test/fixtures/[...bar].spec.js', port as number)
|
||||
|
||||
expect(response).to.eq(`it('...bar', () => {})\n`)
|
||||
|
||||
return new Promise((res) => {
|
||||
close(() => res())
|
||||
})
|
||||
})
|
||||
|
||||
it('serves a file with spaces via a webpack dev server', async () => {
|
||||
const { port, close } = await startDevServer({
|
||||
webpackConfig,
|
||||
options: {
|
||||
config,
|
||||
specs: createSpecs('foo bar.spec.js'),
|
||||
devServerEvents: new EventEmitter(),
|
||||
},
|
||||
})
|
||||
|
||||
const response = await requestSpecFile('/test/fixtures/foo bar.spec.js', port as number)
|
||||
|
||||
expect(response).to.eq(`it('this is a spec with a path containing a space', () => {})\n`)
|
||||
|
||||
return new Promise((res) => {
|
||||
close(() => res())
|
||||
})
|
||||
})
|
||||
|
||||
it('emits dev-server:compile:success event on successful compilation', async () => {
|
||||
const devServerEvents = new EventEmitter()
|
||||
const { close } = await startDevServer({
|
||||
webpackConfig,
|
||||
options: {
|
||||
config,
|
||||
specs,
|
||||
specs: createSpecs('foo.spec.js'),
|
||||
devServerEvents,
|
||||
},
|
||||
})
|
||||
@@ -137,7 +215,7 @@ describe('#startDevServer', () => {
|
||||
webpackConfig,
|
||||
options: {
|
||||
config,
|
||||
specs,
|
||||
specs: createSpecs('foo.spec.js'),
|
||||
devServerEvents,
|
||||
},
|
||||
})
|
||||
@@ -172,13 +250,13 @@ describe('#startDevServer', () => {
|
||||
const { port, close } = await devServer(
|
||||
{
|
||||
config,
|
||||
specs,
|
||||
specs: createSpecs('foo.spec.js'),
|
||||
devServerEvents,
|
||||
},
|
||||
defineDevServerConfig({ webpackConfig }),
|
||||
)
|
||||
|
||||
const response = await requestSpecFile(port as number)
|
||||
const response = await requestSpecFile('/test/fixtures/foo.spec.js', port as number)
|
||||
|
||||
expect(response).to.eq('const foo = () => {}\n')
|
||||
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
it('...bar', () => {})
|
||||
@@ -0,0 +1 @@
|
||||
it('this is a spec with a path containing []', () => {})
|
||||
@@ -0,0 +1 @@
|
||||
it('this is a spec with a path containing a space', () => {})
|
||||
@@ -0,0 +1 @@
|
||||
it('サイプレス', () => {})
|
||||
@@ -45,7 +45,7 @@ export const iframesController = {
|
||||
// attach header data for webservers
|
||||
// to properly intercept and serve assets from the correct src root
|
||||
// TODO: define a contract for dev-server plugins to configure this behavior
|
||||
req.headers.__cypress_spec_path = req.params[0]
|
||||
req.headers.__cypress_spec_path = encodeURI(req.params[0])
|
||||
req.url = `${config.devServerPublicPathRoute}/index.html`
|
||||
|
||||
// user the node proxy here instead of the network proxy
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
const minimist = require('minimist')
|
||||
const shelljs = require('shelljs')
|
||||
const { execSync } = require('child_process')
|
||||
|
||||
const args = minimist(process.argv.slice(2))
|
||||
|
||||
@@ -15,13 +15,13 @@ if (!/^\d+\.\d+\.\d+$/.test(args.version)) {
|
||||
const log = (...args) => console.log('🏗', ...args)
|
||||
|
||||
const exec = args['dry-run'] ?
|
||||
(...args) => log('Dry run, not executing:', ...args)
|
||||
: (...args) => shelljs.exec(...args)
|
||||
(...args) => log('Dry run, not executing:', args[0])
|
||||
: (...args) => execSync(...args)
|
||||
|
||||
log('Running `move-binaries`...')
|
||||
exec(`node ./scripts/binary.js move-binaries --sha ${args.sha} --version ${args.version}`)
|
||||
exec(`node ./scripts/binary.js move-binaries --sha ${args.sha} --version ${args.version}`, { stdio: 'inherit' })
|
||||
|
||||
const prereleaseNpmUrl = `https://cdn.cypress.io/beta/npm/${args.version}/linux-x64/develop-${args.sha}/cypress.tgz`
|
||||
|
||||
log('Running `create-stable-npm-package`...')
|
||||
exec(`./scripts/create-stable-npm-package.sh ${prereleaseNpmUrl}`)
|
||||
exec(`./scripts/create-stable-npm-package.sh ${prereleaseNpmUrl}`, { stdio: 'inherit' })
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
{}
|
||||
@@ -0,0 +1 @@
|
||||
it('...bar', () => {})
|
||||
@@ -0,0 +1,5 @@
|
||||
describe('this test is in a directory with [] in the path', () => {
|
||||
it('works great!', () => {
|
||||
expect(1).to.eq(1)
|
||||
})
|
||||
})
|
||||
@@ -0,0 +1,5 @@
|
||||
describe('this test is in a file with space in the path', () => {
|
||||
it('works great!', () => {
|
||||
expect(1).to.eq(1)
|
||||
})
|
||||
})
|
||||
@@ -0,0 +1 @@
|
||||
it('サイプレス', () => {})
|
||||
@@ -0,0 +1,10 @@
|
||||
const { startDevServer } = require('@cypress/webpack-dev-server')
|
||||
|
||||
module.exports = (on, config) => {
|
||||
on('dev-server:start', (options) => {
|
||||
return startDevServer({
|
||||
options,
|
||||
webpackConfig: {},
|
||||
})
|
||||
})
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"webpack": "^4"
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,13 @@
|
||||
import systemTests from '../lib/system-tests'
|
||||
|
||||
describe('@cypress/webpack-dev-server', function () {
|
||||
systemTests.setup()
|
||||
|
||||
systemTests.it('successfully loads and runs all specs', {
|
||||
project: 'webpack-dev-server',
|
||||
testingType: 'component',
|
||||
spec: '**/*',
|
||||
browser: 'chrome',
|
||||
expectedExitCode: 0,
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user