Skip to content

Commit

Permalink
Merge pull request #28263 from cypress-io/update/test-burn-in
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanthemanuel authored Nov 7, 2023
2 parents 3225c00 + e27ad96 commit f75d65e
Show file tree
Hide file tree
Showing 101 changed files with 105,612 additions and 102,604 deletions.
2 changes: 1 addition & 1 deletion .circleci/cache-version.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Bump this version to force CI to re-create the cache from scratch.

10-25-23.1
11-07-23.1
35 changes: 17 additions & 18 deletions .circleci/workflows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ mainBuildFilters: &mainBuildFilters
- 'update-v8-snapshot-cache-on-develop'
- 'feature/test-burn-in'
- 'publish-binary'
- 'ryanm/fix/better-sqlite3'
- 'em/shallow-checkout'

# 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 All @@ -46,7 +46,6 @@ macWorkflowFilters: &darwin-workflow-filters
- equal: [ 'feature/test-burn-in', << pipeline.git.branch >> ]
- equal: [ 'chore/update_webpack_deps_to_latest_webpack4_compat', << pipeline.git.branch >> ]
- equal: [ 'lerna-optimize-tasks', << pipeline.git.branch >> ]
- equal: [ 'ryanm/fix/better-sqlite3', << pipeline.git.branch >> ]
- matches:
pattern: /^release\/\d+\.\d+\.\d+$/
value: << pipeline.git.branch >>
Expand All @@ -63,7 +62,6 @@ linuxArm64WorkflowFilters: &linux-arm64-workflow-filters
- equal: [ 'chore/update_webpack_deps_to_latest_webpack4_compat', << pipeline.git.branch >> ]
- equal: [ 'chore/bump_loaders_and_optimize_webpack', << pipeline.git.branch >> ]
- equal: [ 'lerna-optimize-tasks', << pipeline.git.branch >> ]
- equal: [ 'ryanm/fix/better-sqlite3', << pipeline.git.branch >> ]
- matches:
pattern: /^release\/\d+\.\d+\.\d+$/
value: << pipeline.git.branch >>
Expand All @@ -89,7 +87,7 @@ windowsWorkflowFilters: &windows-workflow-filters
- equal: [ 'feature/test-burn-in', << pipeline.git.branch >> ]
- equal: [ 'chore/update_webpack_deps_to_latest_webpack4_compat', << pipeline.git.branch >> ]
- equal: [ 'lerna-optimize-tasks', << pipeline.git.branch >> ]
- equal: [ 'ryanm/fix/better-sqlite3', << pipeline.git.branch >> ]
- equal: [ 'em/shallow-checkout', << pipeline.git.branch >> ]
- matches:
pattern: /^release\/\d+\.\d+\.\d+$/
value: << pipeline.git.branch >>
Expand Down Expand Up @@ -256,8 +254,6 @@ commands:
root: ~/
paths:
- cypress
- .ssh
- node_modules # contains the npm i -g modules

install_cache_helpers_dependencies:
steps:
Expand Down Expand Up @@ -487,12 +483,9 @@ commands:
# https://discuss.circleci.com/t/switch-nodejs-version-on-machine-executor-solved/26675/2
description: Install Node version matching .node-version
steps:
# installing NVM will use git+ssh, so update known_hosts
- update_known_hosts
- run:
name: Install Node
command: |
node_version=$(cat .node-version)
source ./scripts/ensure-node.sh
echo "Installing Yarn"
npm install yarn --location=global # ensure yarn is installed with the correct node engine
Expand Down Expand Up @@ -1351,14 +1344,27 @@ jobs:
default: false
resource_class: << parameters.resource_class >>
steps:
- checkout
- update_known_hosts
- when:
condition:
equal: [ *windows-executor, << parameters.executor >> ]
steps: # issue with ssh keys on windows
- checkout
- unless:
condition:
equal: [ *windows-executor, << parameters.executor >> ]
steps:
- run:
name: checkout
command: git clone -b "$CIRCLE_BRANCH" "$CIRCLE_REPOSITORY_URL" . --depth 1
- install-required-node
- verify-build-setup:
executor: << parameters.executor >>
- persist_to_workspace:
root: ~/
paths:
- cypress
- .ssh
- .nvm # mac / linux
- ProgramData/nvm # windows
- caching-dependency-installer:
Expand Down Expand Up @@ -2229,13 +2235,6 @@ jobs:
- clone-repo-and-checkout-branch:
repo: cypress-example-kitchensink
- install-required-node
- run:
name: Remove cypress.json
description: Remove cypress.json in case it exists
working_directory: /tmp/cypress-example-kitchensink
environment:
CYPRESS_INTERNAL_FORCE_SCAFFOLD: "1"
command: rm -rf cypress.json
- run:
name: Install prod dependencies
command: yarn --production --ignore-engines
Expand Down Expand Up @@ -3623,4 +3622,4 @@ workflows:
<<: *darwin-workflow-filters
windows:
<<: *windows-workflow
<<: *windows-workflow-filters
<<: *windows-workflow-filters
24 changes: 22 additions & 2 deletions cli/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,27 @@
<!-- See the ../guides/writing-the-cypress-changelog.md for details on writing the changelog. -->
## 13.4.1

_Released 11/7/2023 (PENDING)_

**Features:**

- Adds Component Testing support for Angular version 17. Addresses [#28153](https://github.com/cypress-io/cypress/issues/28153).

**Bugfixes:**

- Fixed an issue where clicking a link to download a file could cause a page load timeout when the download attribute was missing. Note: download behaviors in experimental Webkit are still an issue. Fixes [#14857](https://github.com/cypress-io/cypress/issues/14857).
- Fixed an issue to account for canceled and failed downloads to correctly reflect these status in Command log as a download failure where previously it would be pending. Fixed in [#28222](https://github.com/cypress-io/cypress/pull/28222).
- Fixed an issue determining visibility when an element is hidden by an ancestor with a shared edge. Fixes [#27514](https://github.com/cypress-io/cypress/issues/27514).
- We now pass a flag to Chromium browsers to disable Chrome translation, both the manual option and the popup prompt, when a page with a differing language is detected. Fixes [#28225](https://github.com/cypress-io/cypress/issues/28225).
- Fixed an issue where in chromium based browsers, global style updates can trigger flooding of font face requests in DevTools and Test Replay. This can affect performance due to the flooding of messages in CDP. Fixes [#28150](https://github.com/cypress-io/cypress/issues/28150) and [#28215](https://github.com/cypress-io/cypress/issues/28215).
- Fixed an issue with 'other' targets (e.g. pdf documents embedded in an object tag) not fully loading. Fixes [#28228](https://github.com/cypress-io/cypress/issues/28228) and [#28162](https://github.com/cypress-io/cypress/issues/28162).
- Fixed an issue where network requests made from tabs/windows other than the main Cypress tab would be delayed. Fixes [#28113](https://github.com/cypress-io/cypress/issues/28113).
- Stopped processing CDP events at the end of a spec when Test Isolation is off and Test Replay is enabled. Addressed in [#28213](https://github.com/cypress-io/cypress/pull/28213).
- Fixed a regression in [`13.3.3`](https://docs.cypress.io/guides/references/changelog/13.3.3) where Cypress would hang on loading shared workers when using `cy.reload` to reload the page. Fixes [#28248](https://github.com/cypress-io/cypress/issues/28248).

## 13.4.0

_Released 10/27/2023_
_Released 10/30/2023_

**Features:**

Expand Down Expand Up @@ -75,7 +95,7 @@ _Released 09/12/2023_
**Bugfixes:**

- Edge cases where `cy.intercept()` would not properly intercept and asset response bodies would not properly be captured for Test Replay have been addressed. Addressed in [#27771](https://github.com/cypress-io/cypress/pull/27771).
- Fixed an issue where `enter`, `keyup`, and `space` events were not triggering `click` events properly in some versions of Firefox. Addressed in [#27715](https://github.com/cypress-io/cypress/pull/27715).
- Fixed an issue where `enter`, `keyup`, and `space` events were not triggering `click` events properly in some versions of Firefox. Addressed in [#27715](https://github.com/cypress-io/cypress/pull/27715).
- Fixed a regression in `13.0.0` where tests using Basic Authorization can potentially hang indefinitely on chromium browsers. Addressed in [#27781](https://github.com/cypress-io/cypress/pull/27781).
- Fixed a regression in `13.0.0` where component tests using an intercept that matches all requests can potentially hang indefinitely. Addressed in [#27788](https://github.com/cypress-io/cypress/pull/27788).

Expand Down
2 changes: 1 addition & 1 deletion cli/types/cypress-npm-api.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ declare module 'cypress' {
* recommend wrapping your config object with `defineConfig()`
* @example
* module.exports = defineConfig({
* viewportWith: 400
* viewportWidth: 400
* })
*
* @see ../types/cypress-npm-api.d.ts
Expand Down
9 changes: 7 additions & 2 deletions cli/types/cypress.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6021,7 +6021,11 @@ declare namespace Cypress {
(fn: (currentSubject: Subject) => void): Chainable<Subject>
}

interface BrowserLaunchOptions {
interface AfterBrowserLaunchDetails {
webSocketDebuggerUrl: string
}

interface BeforeBrowserLaunchOptions {
extensions: string[]
preferences: { [key: string]: any }
args: string[]
Expand Down Expand Up @@ -6102,12 +6106,13 @@ declare namespace Cypress {
}

interface PluginEvents {
(action: 'after:browser:launch', fn: (browser: Browser, browserLaunchDetails: AfterBrowserLaunchDetails) => void | Promise<void>): void
(action: 'after:run', fn: (results: CypressCommandLine.CypressRunResult | CypressCommandLine.CypressFailedRunResult) => void | Promise<void>): void
(action: 'after:screenshot', fn: (details: ScreenshotDetails) => void | AfterScreenshotReturnObject | Promise<AfterScreenshotReturnObject>): void
(action: 'after:spec', fn: (spec: Spec, results: CypressCommandLine.RunResult) => void | Promise<void>): void
(action: 'before:run', fn: (runDetails: BeforeRunDetails) => void | Promise<void>): void
(action: 'before:spec', fn: (spec: Spec) => void | Promise<void>): void
(action: 'before:browser:launch', fn: (browser: Browser, browserLaunchOptions: BrowserLaunchOptions) => void | BrowserLaunchOptions | Promise<BrowserLaunchOptions>): void
(action: 'before:browser:launch', fn: (browser: Browser, afterBrowserLaunchOptions: BeforeBrowserLaunchOptions) => void | Promise<void> | BeforeBrowserLaunchOptions | Promise<BeforeBrowserLaunchOptions>): void
(action: 'file:preprocessor', fn: (file: FileObject) => string | Promise<string>): void
(action: 'dev-server:start', fn: (file: DevServerConfig) => Promise<ResolvedDevServerConfig>): void
(action: 'task', tasks: Tasks): void
Expand Down
43 changes: 35 additions & 8 deletions npm/webpack-dev-server/cypress/e2e/angular.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,13 @@
/// <reference path="../support/e2e.ts" />
import type { ProjectFixtureDir } from '@tooling/system-tests/lib/fixtureDirs'

const WEBPACK_ANGULAR: ProjectFixtureDir[] = ['angular-13', 'angular-14', 'angular-15', 'angular-16', 'angular-16.1']
const WEBPACK_ANGULAR: ProjectFixtureDir[] = [
'angular-13',
'angular-14',
'angular-15',
'angular-16',
'angular-17',
]

// Add to this list to focus on a particular permutation
const ONLY_PROJECTS: ProjectFixtureDir[] = []
Expand Down Expand Up @@ -46,7 +52,9 @@ for (const project of WEBPACK_ANGULAR) {
cy.contains('app.component.cy.ts').click()
cy.waitForSpecToFinish({ passCount: 1 }, 60000)

cy.get('li.command').first().within(() => {
cy.get('li.command')
.first()
.within(() => {
cy.get('.command-method').should('contain', 'mount')
cy.get('.command-message').should('contain', 'AppComponent')
})
Expand All @@ -60,7 +68,11 @@ for (const project of WEBPACK_ANGULAR) {
cy.withCtx(async (ctx) => {
await ctx.actions.file.writeFileInProject(
ctx.path.join('src', 'app', 'app.component.html'),
(await ctx.file.readFileInProject(ctx.path.join('src', 'app', 'app.component.html'))).replace('Hello World', 'Hello Cypress'),
(
await ctx.file.readFileInProject(
ctx.path.join('src', 'app', 'app.component.html'),
)
).replace('Hello World', 'Hello Cypress'),
)
})

Expand All @@ -69,7 +81,11 @@ for (const project of WEBPACK_ANGULAR) {
cy.withCtx(async (ctx) => {
await ctx.actions.file.writeFileInProject(
ctx.path.join('src', 'app', 'app.component.html'),
(await ctx.file.readFileInProject(ctx.path.join('src', 'app', 'app.component.html'))).replace('Hello Cypress', 'Hello World'),
(
await ctx.file.readFileInProject(
ctx.path.join('src', 'app', 'app.component.html'),
)
).replace('Hello Cypress', 'Hello World'),
)
})

Expand All @@ -84,17 +100,26 @@ for (const project of WEBPACK_ANGULAR) {

// Create compilation error
cy.withCtx(async (ctx) => {
const componentFilePath = ctx.path.join('src', 'app', 'app.component.ts')
const componentFilePath = ctx.path.join(
'src',
'app',
'app.component.ts',
)

await ctx.actions.file.writeFileInProject(
componentFilePath,
(await ctx.file.readFileInProject(componentFilePath)).replace('class', 'classaaaaa'),
(
await ctx.file.readFileInProject(componentFilePath)
).replace('class', 'classaaaaa'),
)
})

// The test should fail and the stack trace should appear in the command log
cy.waitForSpecToFinish({ failCount: 1 }, 60000)
cy.contains('The following error originated from your test code, not from Cypress.').should('exist')
cy.contains(
'The following error originated from your test code, not from Cypress.',
).should('exist')

cy.get('.test-err-code-frame').should('be.visible')
})

Expand All @@ -105,7 +130,9 @@ for (const project of WEBPACK_ANGULAR) {
cy.withCtx(async (ctx) => {
await ctx.actions.file.writeFileInProject(
ctx.path.join('src', 'app', 'new.component.cy.ts'),
await ctx.file.readFileInProject(ctx.path.join('src', 'app', 'app.component.cy.ts')),
await ctx.file.readFileInProject(
ctx.path.join('src', 'app', 'app.component.cy.ts'),
),
)
})

Expand Down
3 changes: 3 additions & 0 deletions packages/app/cypress.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { defineConfig } from 'cypress'
import { initGitRepoForTestProject, resetGitRepoForTestProject } from './cypress/tasks/git'
import { writeMochaEventSnapshot, readMochaEventSnapshot } from './cypress/tasks/mochaEvents'

export default defineConfig({
projectId: 'ypt4pf',
Expand Down Expand Up @@ -44,6 +45,8 @@ export default defineConfig({
on('task', {
initGitRepoForTestProject,
resetGitRepoForTestProject,
writeMochaEventSnapshot,
readMochaEventSnapshot,
})

return await e2ePluginSetup(on, config)
Expand Down
Loading

0 comments on commit f75d65e

Please sign in to comment.