Skip to content

Commit

Permalink
Merge branch 'develop' into tgriesser/spike/spike
Browse files Browse the repository at this point in the history
* develop:
  chore: fix changlelog section parsing and reference right ENV (#25633)
  feat: Debug page [IATR] (#25488)
  fix(deps): update dependency underscore.string to v3.3.6 🌟 (#25574)
  chore: Use upstream cypress-testing-library again (#25548)
  fix: match alternate edge version string format (#25457)
  chore: update name for graphql batch operations (#25610)
  chore: clean up config for external contibutors (#25552)
  chore: fix childProcess.execSync encoding (#25625)
  chore: update next-version to handle using the next bump package.json… (#25599)
  chore: update packages/example deployment script and cleanup package/example (#25091)
  fix: allow version 9 of the babel-loader peer dependency (#25569)
  docs: remove cypress-example-todomvc-redux from release-process (#25613)
  chore: bump version and remove misleading changelog entry (#25612)
  • Loading branch information
tgriesser committed Jan 31, 2023
2 parents ef52e26 + 6f1653c commit a0259e6
Show file tree
Hide file tree
Showing 223 changed files with 14,903 additions and 885 deletions.
9 changes: 2 additions & 7 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,7 @@ jobs:
cancel_build () {
echo "Canceling the CI build..."
curl --request POST \
--url https://circleci.com/api/v2/workflow/$CIRCLE_WORKFLOW_ID/cancel \
--header "Circle-Token: ${CIRCLE_TOKEN}"
sleep 30 # Give cancellation a chance to run. This script then won't continue running.
exit 1 # If cancellation didn't run for some reason, fail the build.
circleci-agent step halt
}
TRIGGER_INSTRUCTIONS="to trigger CI , include 'run ci' in the commit message or click the 'Trigger Pipeline' button in the CircleCI UI."
Expand Down Expand Up @@ -71,5 +67,4 @@ workflows:
# the setup-workflow workflow is always triggered.
setup-workflow:
jobs:
- verify-ci-should-run:
context: workflow-setup
- verify-ci-should-run
4 changes: 2 additions & 2 deletions .circleci/workflows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ mainBuildFilters: &mainBuildFilters
only:
- develop
- /^release\/\d+\.\d+\.\d+$/
- 'mschile/chrome_memory_fix'
- 'emily/next-version'

# usually we don't build Mac app - it takes a long time
# but sometimes we want to really confirm we are doing the right thing
Expand Down Expand Up @@ -130,7 +130,7 @@ commands:
- run:
name: Check current branch to persist artifacts
command: |
if [[ "$CIRCLE_BRANCH" != "develop" && "$CIRCLE_BRANCH" != "release/"* && "$CIRCLE_BRANCH" != "mschile/chrome_memory_fix" ]]; then
if [[ "$CIRCLE_BRANCH" != "develop" && "$CIRCLE_BRANCH" != "release/"* && "$CIRCLE_BRANCH" != "emily/next-version" ]]; then
echo "Not uploading artifacts or posting install comment for this branch."
circleci-agent step halt
fi
Expand Down
21 changes: 19 additions & 2 deletions cli/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,29 @@
<!-- See the ../guides/writing-the-cypress-changelog.md for details on writing the changelog. -->
## 12.5.0

_Released 01/31/2023 (PENDING)_

**Features:**

- Easily debug failed CI test runs right from your local Cypress app with the new Debug page, powered by Cypress Cloud. For more details, see the [Debug documentation](https://on.cypress.io/debug-page). Addressed in [#25488](/~https://github.com/cypress-io/cypress/pull/25488).

**Bugfixes:**

- Fixed an issue where alternative Microsoft Edge Beta, Canary, and Dev binary versions were not being discovered by Cypress.
Fixes [#25455](/~https://github.com/cypress-io/cypress/issues/25455).

**Dependency Updates:**

- Upgraded [`underscore.string`](/~https://github.com/esamattis/underscore.string/blob/HEAD/CHANGELOG.markdown) from `3.3.5` to `3.3.6` to reference rebuilt assets after security patch to fix regular expression DDOS exploit.
Fixed in [#25574](/~https://github.com/cypress-io/cypress/pull/25574).

## 12.4.1

_Released 01/26/2023_
_Released 01/27/2023_

**Bugfixes:**

- Fixed a regression from Cypress [12.4.0](https://docs.cypress.io/guides/references/changelog#12-4-0) where Cypress was not exiting properly when running multiple Component Testing specs in `electron` in `run` mode. Fixes [#25568](/~https://github.com/cypress-io/cypress/issues/25568).
- Fixed an issue where alternative Microsoft Edge Beta and Canary binary names were not being discovered by Cypress. Fixes [#25455](/~https://github.com/cypress-io/cypress/issues/25455).

**Dependency Updates:**

Expand Down
6 changes: 3 additions & 3 deletions cli/lib/tasks/cache.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@ const clear = () => {

const prune = () => {
const cacheDir = state.getCacheDir()
const currentVersion = util.pkgVersion()
const checkedInBinaryVersion = util.pkgVersion()

let deletedBinary = false

return fs.readdirAsync(cacheDir)
.then((versions) => {
return Bluebird.all(versions.map((version) => {
if (version !== currentVersion) {
if (version !== checkedInBinaryVersion) {
deletedBinary = true

const versionDir = join(cacheDir, version)
Expand All @@ -51,7 +51,7 @@ const prune = () => {
})
.then(() => {
if (deletedBinary) {
logger.always(`Deleted all binary caches except for the ${currentVersion} binary cache.`)
logger.always(`Deleted all binary caches except for the ${checkedInBinaryVersion} binary cache.`)
} else {
logger.always(`No binary caches found to prune.`)
}
Expand Down
8 changes: 4 additions & 4 deletions cli/test/lib/tasks/cache_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,14 +136,14 @@ describe('lib/tasks/cache', () => {
it('deletes cache binaries for all version but the current one', async () => {
await cache.prune()

const currentVersion = util.pkgVersion()
const checkedInBinaryVersion = util.pkgVersion()

const files = await fs.readdir('/.cache/Cypress')

expect(files.length).to.eq(1)

files.forEach((file) => {
expect(file).to.eq(currentVersion)
expect(file).to.eq(checkedInBinaryVersion)
})

defaultSnapshot()
Expand All @@ -155,14 +155,14 @@ describe('lib/tasks/cache', () => {
await fs.removeAsync(dir)
await cache.prune()

const currentVersion = util.pkgVersion()
const checkedInBinaryVersion = util.pkgVersion()

const files = await fs.readdirAsync('/.cache/Cypress')

expect(files.length).to.eq(1)

files.forEach((file) => {
expect(file).to.eq(currentVersion)
expect(file).to.eq(checkedInBinaryVersion)
})

defaultSnapshot()
Expand Down
1 change: 0 additions & 1 deletion guides/release-process.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,6 @@ In the following instructions, "X.Y.Z" is used to denote the [next version of Cy
23. Check all `cypress-test-*` and `cypress-example-*` repositories, and if there is a branch named `x.y.z` for testing the features or fixes from the newly published version `x.y.z`, update that branch to refer to the newly published NPM version in `package.json`. Then, get the changes approved and merged into that project's main branch. For projects without a `x.y.z` branch, you can go to the Renovate dependency issue and check the box next to `Update dependency cypress to X.Y.Z`. It will automatically create a PR. Once it passes, you can merge it. Try updating at least the following projects:
- [cypress-example-todomvc](/~https://github.com/cypress-io/cypress-example-todomvc/issues/99)
- [cypress-example-todomvc-redux](/~https://github.com/cypress-io/cypress-example-todomvc-redux/issues/1)
- [cypress-realworld-app](/~https://github.com/cypress-io/cypress-realworld-app/issues/41)
- [cypress-example-recipes](/~https://github.com/cypress-io/cypress-example-recipes/issues/225)
- [cypress-fiddle](/~https://github.com/cypress-io/cypress-fiddle/issues/5)
Expand Down
8 changes: 6 additions & 2 deletions npm/create-cypress-tests/scripts/example.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,13 @@ program
await fs.remove(destinationPath)
await fs.copy(exampleFolder, destinationPath, { recursive: true })

console.log(`✅ Example was successfully created at ${chalk.cyan(destination)}`)
console.log(`✅ E2E Examples were successfully created at ${chalk.cyan(destination)}`)

await fs.copy(path.join(__dirname, 'example-tsconfig.json'), path.join(destination, 'tsconfig.json'))
await fs.copy(path.join(__dirname, 'examples', 'cypress'), path.join(destination))

console.log(`✅ Cypress Setup was successfully created at ${chalk.cyan(destination)}`)

await fs.copy(path.join(__dirname, 'examples', 'tsconfig.json'), path.join(destination, 'tsconfig.json'))

console.log(`✅ tsconfig.json was created for ${chalk.cyan(destination)}`)
})
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// ***********************************************************
// This example support/component.js is processed and
// loaded automatically before your test files.
//
// This is a great place to put global configuration and
// behavior that modifies Cypress.
//
// You can change the location of this file or turn off
// automatically serving support files with the
// 'supportFile' configuration option.
//
// You can read more here:
// https://on.cypress.io/configuration
// ***********************************************************

// Import commands.js using ES2015 syntax:
import './commands'

// Alternatively you can use CommonJS syntax:
// require('./commands')
20 changes: 20 additions & 0 deletions npm/create-cypress-tests/scripts/examples/cypress/support/e2e.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// ***********************************************************
// This example support/e2e.js is processed and
// loaded automatically before your test files.
//
// This is a great place to put global configuration and
// behavior that modifies Cypress.
//
// You can change the location of this file or turn off
// automatically serving support files with the
// 'supportFile' configuration option.
//
// You can read more here:
// https://on.cypress.io/configuration
// ***********************************************************

// Import commands.js using ES2015 syntax:
import './commands'

// Alternatively you can use CommonJS syntax:
// require('./commands')
2 changes: 1 addition & 1 deletion npm/webpack-preprocessor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"peerDependencies": {
"@babel/core": "^7.0.1",
"@babel/preset-env": "^7.0.0",
"babel-loader": "^8.0.2",
"babel-loader": "^8.0.2 || ^9",
"webpack": "^4 || ^5"
},
"files": [
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cypress",
"version": "12.4.0",
"version": "12.4.1",
"description": "Cypress is a next generation front end testing tool built for the modern web",
"private": true,
"scripts": {
Expand Down
30 changes: 7 additions & 23 deletions packages/app/cypress/e2e/cypress-in-cypress-run-mode.cy.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
import { CY_IN_CY_SIMULATE_RUN_MODE } from '@packages/types/src/constants'

describe('Cypress In Cypress - run mode', { viewportWidth: 1200 }, () => {
it('e2e run mode spec runner header is correct', () => {
cy.scaffoldProject('cypress-in-cypress')
cy.findBrowsers()
cy.openProject('cypress-in-cypress')
cy.startAppServer()
cy.visitApp()

simulateRunModeInUI()
cy.visitApp(`/specs/runner?file=cypress/e2e/dom-content.spec.js&${CY_IN_CY_SIMULATE_RUN_MODE}`)

cy.contains('dom-content.spec').click()
cy.waitForSpecToFinish()

cy.findByTestId('aut-url').should('be.visible')
Expand All @@ -33,17 +32,14 @@ describe('Cypress In Cypress - run mode', { viewportWidth: 1200 }, () => {
// cy.percySnapshot() // TODO: restore when Percy CSS is fixed. See /~https://github.com/cypress-io/cypress/issues/23435
})

// TODO: fix flaky test /~https://github.com/cypress-io/cypress/issues/23306
it('component testing run mode spec runner header is correct', { retries: 15 }, () => {
it('component testing run mode spec runner header is correct', () => {
cy.scaffoldProject('cypress-in-cypress')
cy.findBrowsers()
cy.openProject('cypress-in-cypress')
cy.startAppServer('component')
cy.visitApp()
simulateRunModeInUI()
cy.contains('TestComponent.spec').click()
cy.waitForSpecToFinish()
cy.visitApp(`/specs/runner?file=src/TestComponent.spec.jsx&${CY_IN_CY_SIMULATE_RUN_MODE}`)

cy.waitForSpecToFinish()
cy.findByTestId('aut-url').should('not.exist')
cy.findByTestId('playground-activator').should('not.exist')

Expand Down Expand Up @@ -81,9 +77,7 @@ describe('Cypress In Cypress - run mode', { viewportWidth: 1200 }, () => {
})
})

cy.visitApp()
simulateRunModeInUI()
cy.contains('dom-content.spec').click()
cy.visitApp(`/specs/runner?file=cypress/e2e/dom-content.spec.js&${CY_IN_CY_SIMULATE_RUN_MODE}`)

cy.contains('http://localhost:4455/cypress/e2e/dom-content.html').should('be.visible')
cy.findByLabelText('Stats').should('not.exist')
Expand All @@ -92,13 +86,3 @@ describe('Cypress In Cypress - run mode', { viewportWidth: 1200 }, () => {
cy.findByTestId('sidebar').should('not.exist')
})
})

function simulateRunModeInUI () {
// this simulates run mode enough for this test
cy.window().then((win) => {
win.__CYPRESS_MODE__ = 'run'
cy.get('body').then(($el) => {
$el.find('[data-cy="sidebar"]')?.remove()
})
})
}
Loading

0 comments on commit a0259e6

Please sign in to comment.