Skip to content

Commit

Permalink
Merge pull request #23628 from cypress-io/develop
Browse files Browse the repository at this point in the history
  • Loading branch information
mike-plummer authored Aug 30, 2022
2 parents 02e5b24 + 95b6849 commit c750eea
Show file tree
Hide file tree
Showing 452 changed files with 27,463 additions and 12,832 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/add_to_triage_project.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Add issue/PR to project

on:
issues:
types:
- opened
pull_request:
types:
- opened

jobs:
add-to-triage-project:
name: Add to triage project
runs-on: ubuntu-latest
steps:
- uses: actions/add-to-project@v0.3.0
with:
project-url: https://github.com/orgs/cypress-io/projects/9
github-token: ${{ secrets.ADD_TO_PROJECT_TOKEN }}

2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
// Volar is the main extension that powers Vue's language features.
// These are commented out because they slow down node development
// "volar.autoCompleteRefs": false,
"volar.takeOverMode.enabled": true,
"volar.takeOverMode.enabled": "auto",

"editor.tabSize": 2,
}
4 changes: 2 additions & 2 deletions browser-versions.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"chrome:beta": "105.0.5195.19",
"chrome:stable": "104.0.5112.79"
"chrome:beta": "105.0.5195.28",
"chrome:stable": "104.0.5112.101"
}
24 changes: 14 additions & 10 deletions circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ macWorkflowFilters: &darwin-workflow-filters
or:
- equal: [ develop, << pipeline.git.branch >> ]
- equal: [ 'tbiethman/22272-globbing-working-dir', << pipeline.git.branch >> ]
- equal: [ 'skip-or-fix-flaky-tests-2', << pipeline.git.branch >> ]
- matches:
pattern: "-release$"
value: << pipeline.git.branch >>
Expand All @@ -45,6 +46,7 @@ linuxArm64WorkflowFilters: &linux-arm64-workflow-filters
or:
- equal: [ develop, << pipeline.git.branch >> ]
- equal: [ "lmiller/experimental-single-tab-component-testing", << pipeline.git.branch >> ]
- equal: [ 'skip-or-fix-flaky-tests-2', << pipeline.git.branch >> ]
- matches:
pattern: "-release$"
value: << pipeline.git.branch >>
Expand All @@ -65,6 +67,7 @@ windowsWorkflowFilters: &windows-workflow-filters
- equal: [ develop, << pipeline.git.branch >> ]
- equal: [ linux-arm64, << pipeline.git.branch >> ]
- equal: [ 'marktnoonan/windows-path-fix', << pipeline.git.branch >> ]
- equal: [ 'skip-or-fix-flaky-tests-2', << pipeline.git.branch >> ]
- matches:
pattern: "-release$"
value: << pipeline.git.branch >>
Expand All @@ -78,6 +81,7 @@ executors:
resource_class: medium
environment:
PLATFORM: linux
CI_DOCKER: "true"

# Docker image with non-root "node" user
non-root-docker-user:
Expand Down Expand Up @@ -128,7 +132,7 @@ commands:
- run:
name: Check current branch to persist artifacts
command: |
if [[ "$CIRCLE_BRANCH" != "develop" && "$CIRCLE_BRANCH" != "tbiethman/22272-globbing-working-dir" ]]; then
if [[ "$CIRCLE_BRANCH" != "develop" && "$CIRCLE_BRANCH" != "tbiethman/23380-root-spec-pattern" ]]; then
echo "Not uploading artifacts or posting install comment for this branch."
circleci-agent step halt
fi
Expand Down Expand Up @@ -1200,8 +1204,10 @@ jobs:
- run:
name: Check env canaries on Linux
command: |
# Windows/Mac M1 CircleCI does not have a way to pull per-job env
[[ $PLATFORM == 'linux' ]] && node ./scripts/circle-env.js --check-canaries || true
# only Docker has the required env data for this
if [[ $CI_DOCKER == 'true' ]]; then
node ./scripts/circle-env.js --check-canaries
fi
- build-and-persist
- store-npm-logs

Expand Down Expand Up @@ -1825,7 +1831,6 @@ jobs:

npm-react:
<<: *defaults
parallelism: 8
steps:
- restore_cached_workspace
- run:
Expand Down Expand Up @@ -2314,7 +2319,7 @@ linux-x64-workflow: &linux-x64-workflow
requires:
- build
- percy-finalize:
context: test-runner:poll-circle-workflow
context: [test-runner:poll-circle-workflow, test-runner:percy]
required_env_var: PERCY_TOKEN # skips job if not defined (external PR)
requires:
- build
Expand Down Expand Up @@ -2379,11 +2384,10 @@ linux-x64-workflow: &linux-x64-workflow
context: test-runner:cypress-record-key
requires:
- build
# TODO: Fix keyboard tests to fix the majority of these tests before re-enabling
# - driver-integration-tests-webkit:
# context: test-runner:cypress-record-key
# requires:
# - build
- driver-integration-tests-webkit:
context: test-runner:cypress-record-key
requires:
- build
- driver-integration-tests-chrome-experimentalSessionAndOrigin:
context: test-runner:cypress-record-key
requires:
Expand Down
3 changes: 2 additions & 1 deletion cli/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@ vue
vue2
react*
mount-utils
angular
angular
svelte
8 changes: 7 additions & 1 deletion cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@
"react",
"vue2",
"react18",
"angular"
"angular",
"svelte"
],
"bin": {
"cypress": "bin/cypress"
Expand Down Expand Up @@ -155,6 +156,11 @@
"import": "./angular/dist/index.js",
"require": "./angular/dist/index.js",
"types": "./angular/dist/index.d.ts"
},
"./svelte": {
"import": "./svelte/dist/cypress-svelte.esm-bundler.js",
"require": "./svelte/dist/cypress-svelte.cjs.js",
"types": "./svelte/dist/index.d.ts"
}
},
"workspaces": {
Expand Down
1 change: 1 addition & 0 deletions cli/scripts/post-build.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const npmModulesToCopy = [
'vue',
'vue2',
'angular',
'svelte',
]

npmModulesToCopy.forEach((folder) => {
Expand Down
4 changes: 3 additions & 1 deletion cli/types/cypress-type-helpers.d.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
// type helpers
type Nullable<T> = T | null
declare namespace Cypress {
type Nullable<T> = T | null
}
47 changes: 43 additions & 4 deletions cli/types/cypress.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/// <reference path="./cypress-npm-api.d.ts" />
/// <reference path="./cypress-eventemitter.d.ts" />
/// <reference path="./cypress-type-helpers.d.ts" />

declare namespace Cypress {
type FileContents = string | any[] | object
Expand Down Expand Up @@ -2866,10 +2867,15 @@ declare namespace Cypress {
*/
experimentalModifyObstructiveThirdPartyCode: boolean
/**
* Generate and save commands directly to your test suite by interacting with your app as an end user would.
* Enables AST-based JS/HTML rewriting. This may fix issues caused by the existing regex-based JS/HTML replacement algorithm.
* @default false
*/
experimentalSourceRewriting: boolean
/**
* Generate and save commands directly to your test suite by interacting with your app as an end user would.
* @default false
*/
experimentalStudio: boolean
/**
* Number of times to retry a failed test.
* If a number is set, tests will retry in both runMode and openMode.
Expand Down Expand Up @@ -3047,19 +3053,32 @@ declare namespace Cypress {

type PickConfigOpt<T> = T extends keyof DefineDevServerConfig ? DefineDevServerConfig[T] : any

interface AngularDevServerProjectConfig {
root: string,
sourceRoot: string,
buildOptions: Record<string, any>
}

type DevServerFn<ComponentDevServerOpts = any> = (cypressDevServerConfig: DevServerConfig, devServerConfig: ComponentDevServerOpts) => ResolvedDevServerConfig | Promise<ResolvedDevServerConfig>

type DevServerConfigOptions = {
bundler: 'webpack'
framework: 'react' | 'vue' | 'vue-cli' | 'nuxt' | 'create-react-app' | 'next' | 'angular'
framework: 'react' | 'vue' | 'vue-cli' | 'nuxt' | 'create-react-app' | 'next' | 'svelte'
webpackConfig?: PickConfigOpt<'webpackConfig'>
} | {
bundler: 'vite'
framework: 'react' | 'vue'
framework: 'react' | 'vue' | 'svelte'
viteConfig?: Omit<Exclude<PickConfigOpt<'viteConfig'>, undefined>, 'base' | 'root'>
} | {
bundler: 'webpack',
framework: 'angular',
webpackConfig?: PickConfigOpt<'webpackConfig'>,
options?: {
projectConfig: AngularDevServerProjectConfig
}
}

interface ComponentConfigOptions<ComponentDevServerOpts = any> extends Omit<CoreConfigOptions, 'baseUrl' | 'experimentalSessionAndOrigin'> {
interface ComponentConfigOptions<ComponentDevServerOpts = any> extends Omit<CoreConfigOptions, 'baseUrl' | 'experimentalSessionAndOrigin' | 'experimentalStudio'> {
devServer: DevServerFn<ComponentDevServerOpts> | DevServerConfigOptions
devServerConfig?: ComponentDevServerOpts
/**
Expand Down Expand Up @@ -5783,6 +5802,26 @@ declare namespace Cypress {
* cy.clock().invoke('restore')
*/
restore(): void
/**
* Change the time without invoking any timers.
*
* Default value with no argument or undefined is 0.
*
* This can be useful if you need to change the time by an hour
* while there is a setInterval registered that may otherwise run thousands
* of times.
* @see https://on.cypress.io/clock
* @example
* cy.clock()
* cy.visit('/')
* ...
* cy.clock().then(clock => {
* clock.setSystemTime(60 * 60 * 1000)
* })
* // or use this shortcut
* cy.clock().invoke('setSystemTime', 60 * 60 * 1000)
*/
setSystemTime(now?: number | Date): void
}

interface Cookie {
Expand Down
18 changes: 18 additions & 0 deletions cli/types/tests/cypress-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -682,6 +682,24 @@ namespace CypressClockTests {
})
// restoring the clock shortcut
cy.clock().invoke('restore')
// setting system time with no argument
cy.clock().then(clock => {
clock.setSystemTime()
})
// setting system time with timestamp
cy.clock().then(clock => {
clock.setSystemTime(1000)
})
// setting system time with date object
cy.clock().then(clock => {
clock.setSystemTime(new Date(2019, 3, 2))
})
// setting system time with no argument and shortcut
cy.clock().invoke('setSystemTime')
// setting system time with timestamp and shortcut
cy.clock().invoke('setSystemTime', 1000)
// setting system time with date object and shortcut
cy.clock().invoke('setSystemTime', new Date(2019, 3, 2))
}

namespace CypressContainsTests {
Expand Down
13 changes: 6 additions & 7 deletions npm/angular/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,18 @@
"main": "dist/index.js",
"scripts": {
"prebuild": "rimraf dist",
"build": "rollup -c rollup.config.js",
"build": "rollup -c rollup.config.mjs",
"postbuild": "node ../../scripts/sync-exported-npm-with-cli.js",
"build-prod": "yarn build",
"check-ts": "tsc --noEmit"
},
"dependencies": {},
"devDependencies": {
"@angular/common": "^14.0.6",
"@angular/core": "^14.0.6",
"@angular/platform-browser-dynamic": "^14.0.6",
"@rollup/plugin-node-resolve": "^11.1.1",
"rollup-plugin-typescript2": "^0.29.0",
"typescript": "~4.2.3",
"@angular/common": "^14.2.0",
"@angular/core": "^14.2.0",
"@angular/platform-browser-dynamic": "^14.2.0",
"@cypress/mount-utils": "0.0.0-development",
"typescript": "^4.7.4",
"zone.js": "~0.11.4"
},
"peerDependencies": {
Expand Down
61 changes: 0 additions & 61 deletions npm/angular/rollup.config.js

This file was deleted.

14 changes: 14 additions & 0 deletions npm/angular/rollup.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { createEntries } from '@cypress/mount-utils/create-rollup-entry.mjs'

const config = {
external: [
'@angular/core',
'@angular/core/testing',
'@angular/common',
'@angular/platform-browser-dynamic/testing',
'zone.js',
'zone.js/testing',
],
}

export default createEntries({ formats: ['es'], input: 'src/index.ts', config })
Loading

0 comments on commit c750eea

Please sign in to comment.