Skip to content

Commit

Permalink
Merge branch 'develop' into tgriesser/feat/UNIFY-1774-auto-source-web…
Browse files Browse the repository at this point in the history
…pack

* develop:
  test(launchpad): skip failure due to recaptcha on windows, enable more windows jobs (#21620)
  docs: add "Steps to test" to PR template (#21606)
  feat: (origin) handle waiting for aliased intercepts (#21579)
  fix: handle git watch error (#21600)
  fix: Successfully create new specs files that do not have a known extension (#21593)
  chore: release 9.7.0
  fix: do not allow experimentalSessionAndOrigin to be available in CT … (#21588)
  chore: sort the frameworks select dropdown in a more logical way (#21553)
  Trigger Build
  fix: disable ct testing when run via binary (#21540)
  chore: Update Chrome (beta) to 102.0.5005.61 (#21556)
  chore: release @cypress/react-v5.12.5
  fix: add support for Next.js v12.1.6 (#21516)
  chore: release @cypress/schematic-v1.7.0
  feat(cypress/schematic): add headed option and other fixes (#21415)
  chore: release @cypress/vite-dev-server-v2.2.3
  fix: handle specs with white space in vite-dev-server (#21386)
  Empty commit
  • Loading branch information
tgriesser committed May 25, 2022
2 parents 5a2bf40 + e6b2466 commit 50e6d4c
Show file tree
Hide file tree
Showing 90 changed files with 1,574 additions and 335 deletions.
6 changes: 6 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ If the change is not user-facing, write "n/a".
- Any implementation details to explain?
-->

### Steps to test
<!--
For non-trivial behavior changes, list the steps that a reviewer should follow to validate the new behavior.
This is not meant to be the only testing performed by a reviewer, just the "happy path" that leads to the new behavior.
-->

### How has the user experience changed?
<!-- Provide before and after examples of the change.
Screenshots or GIFs are preferred. -->
Expand Down
2 changes: 1 addition & 1 deletion browser-versions.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"chrome:beta": "102.0.5005.49",
"chrome:beta": "102.0.5005.61",
"chrome:stable": "101.0.4951.64"
}
34 changes: 17 additions & 17 deletions circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,22 +46,20 @@ macWorkflowFilters: &mac-workflow-filters
or:
- equal: [ develop, << pipeline.git.branch >> ]
- equal: [ '10.0-release', << pipeline.git.branch >> ]
- equal: [ 'tbiethman/issue-21236', << pipeline.git.branch >> ]
- matches:
pattern: "-release$"
value: << pipeline.git.branch >>

windowsWorkflowFilters: &windows-workflow-filters
when:
or:
- equal: [ develop, << pipeline.git.branch >> ]
- equal: [ '10.0-release', << pipeline.git.branch >> ]
- matches:
pattern: "-release$"
value: << pipeline.git.branch >>
- matches:
pattern: "win*"
value: << pipeline.git.branch >>
# windows is slow in CI, so we only run a certain set of tests on each commit
# add your branch to this list to run the full Windows build on your PR
fullWindowsWorkflowFilters: &full-windows-workflow-filters
filters:
branches:
only:
- develop
- '10.0-release'
- '*-release'
- 'win*'

executors:
# the Docker image with Cypress dependencies and Chrome browser
Expand Down Expand Up @@ -1723,14 +1721,14 @@ jobs:
yarn workspace @cypress/schematic build:all
working_directory: npm/cypress-schematic
- run:
name: Launch
name: Run unit tests
command: |
yarn launch:test
yarn test
working_directory: npm/cypress-schematic
- run:
name: Run unit tests
name: Launch Sandbox and Install Schematic
command: |
yarn test
yarn launch:test12
working_directory: npm/cypress-schematic
- store-npm-logs

Expand Down Expand Up @@ -2572,19 +2570,22 @@ windows-workflow: &windows-workflow
- windows-build

- lint:
<<: *full-windows-workflow-filters
name: windows-lint
executor: windows
requires:
- windows-build

- unit-tests:
<<: *full-windows-workflow-filters
name: windows-unit-tests
executor: windows
resource_class: windows.medium
requires:
- windows-build

- create-build-artifacts:
<<: *full-windows-workflow-filters
name: windows-create-build-artifacts
executor: windows
resource_class: windows.medium
Expand All @@ -2609,4 +2610,3 @@ workflows:
<<: *mac-workflow-filters
windows:
<<: *windows-workflow
<<: *windows-workflow-filters
2 changes: 1 addition & 1 deletion cli/types/cypress.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3043,7 +3043,7 @@ declare namespace Cypress {
viteConfig?: Omit<Exclude<PickConfigOpt<'viteConfig'>, undefined>, 'base' | 'root'>
}

interface ComponentConfigOptions<ComponentDevServerOpts = any> extends Omit<CoreConfigOptions, 'baseUrl'> {
interface ComponentConfigOptions<ComponentDevServerOpts = any> extends Omit<CoreConfigOptions, 'baseUrl' | 'experimentalSessionAndOrigin'> {
devServer: DevServerFn<ComponentDevServerOpts> | DevServerConfigOptions
devServerConfig?: ComponentDevServerOpts
}
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.7.0](https://github.com/cypress-io/cypress/compare/@cypress/schematic-v1.6.0...@cypress/schematic-v1.7.0) (2022-05-11)


### Features

* **cypress/schematic:** add headed option and other fixes ([#21415](https://github.com/cypress-io/cypress/issues/21415)) ([8de7594](https://github.com/cypress-io/cypress/commit/8de7594446e398048a3693066f043d2d7be903f6))

# [@cypress/schematic-v1.6.0](https://github.com/cypress-io/cypress/compare/@cypress/schematic-v1.5.3...@cypress/schematic-v1.6.0) (2021-11-10)


Expand Down
41 changes: 40 additions & 1 deletion npm/cypress-schematic/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</a>
</p>

Add this schematic to quickly get up and running with [Cypress](https://cypress.io) in your Angular project.
Add this schematic to quickly get up and running with [Cypress](https://cypress.io) in your Angular project.

___

Expand All @@ -27,13 +27,18 @@

✅ Optional: prompt you to add or update the default `ng e2e` command to use Cypress.

## Requirements

- Angular 12+

## Usage ⏯

Install the schematic:

```shell
ng add @cypress/schematic
```

To run Cypress in `open` mode within your project:

```shell script
Expand Down Expand Up @@ -171,6 +176,40 @@ You may want to specify a custom reporter. Cypress works with any reporters buil

Read our docs to learn more about working with [reporters](https://on.cypress.io/reporters).

### Running the builder with a different baseUrl

You can specify a `baseUrl` that is different than the one in `cypress.json`. To do this, add `baseUrl` to `configurations` like the following:

```json
"cypress-open": {
"builder": "@cypress/schematic:cypress",
"options": {
"devServerTarget": "{project-name}:serve",
"watch": true,
"headless": false
},
"configurations": {
"production": {
"devServerTarget": "{project-name}:serve:production"
},
"local-dev": {
"devServerTarget": "{project-name}:serve:development",
"baseUrl": "http://localhost:4002"
},
"another-env": {
"devServerTarget": "{project-name}:serve:development",
"baseUrl": "http://localhost:4004"
}
}
}
```

In order to prevent the application from building, add the following to the end of your command:

```shell
--dev-server-target=''
```

## Generator Options

### Specify Filename (bypassing CLI prompt)
Expand Down
30 changes: 18 additions & 12 deletions npm/cypress-schematic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,25 @@
"build:test": "tsc -p tsconfig.spec.json",
"build:all": "tsc -p tsconfig.json && tsc -p tsconfig.spec.json",
"build:watch": "tsc -p tsconfig.json --watch",
"clean": "git checkout HEAD -- sandbox && git clean -f -d sandbox",
"launch": "yarn link:sandbox && cd sandbox && ng add @cypress/schematic && cd ..",
"launch:test": "yarn link:sandbox && cd sandbox && ng add @cypress/schematic --e2eUpdate=true && cd ..",
"link:sandbox": "yarn link && cd sandbox && yarn link @cypress/schematic",
"clean12": "git checkout HEAD -- sandbox12 && git clean -f -d sandbox12",
"launch12": "yarn link:sandbox12 && cd sandbox12 && ng add @cypress/schematic && cd ..",
"launch:test12": "yarn link:sandbox12 && cd sandbox12 && ng add @cypress/schematic --e2eUpdate=true && cd ..",
"link:sandbox12": "yarn link && cd sandbox12 && yarn link @cypress/schematic",
"test": "mocha -r @packages/ts/register --reporter mocha-multi-reporters --reporter-options configFile=../../mocha-reporter-config.json src/**/*.spec.ts",
"test:e2e:sandbox": "cd sandbox && ng run sandbox:cypress-run",
"unlink:sandbox": "cd sandbox && yarn unlink @cypress/schematic && cd .. && yarn unlink"
"test:e2e:sandbox12": "cd sandbox12 && ng run sandbox:cypress-run",
"unlink:sandbox12": "cd sandbox12 && yarn unlink @cypress/schematic && cd .. && yarn unlink"
},
"dependencies": {
"@angular-devkit/architect": "^0.1202.10",
"@angular-devkit/core": "^12.2.10",
"@angular-devkit/schematics": "^12.2.10",
"@schematics/angular": "^12.2.10",
"@angular-devkit/core": "^12.2.17",
"@angular-devkit/schematics": "^12.2.17",
"@schematics/angular": "^12.2.17",
"jsonc-parser": "^3.0.0",
"rxjs": "~6.6.0"
},
"devDependencies": {
"@angular-devkit/schematics-cli": "^12.2.10",
"@angular/cli": "^12",
"@angular-devkit/schematics-cli": "^12.2.17",
"@angular/cli": "^12.2.17",
"@types/chai-enzyme": "0.6.7",
"@types/mocha": "8.0.3",
"@types/node": "^12.11.1",
Expand All @@ -36,6 +36,10 @@
"mocha": "3.5.3",
"typescript": "~4.2.4"
},
"peerDependencies": {
"@angular/cli": ">=12",
"@angular/core": ">=12"
},
"license": "MIT",
"repository": {
"type": "git",
Expand All @@ -48,7 +52,9 @@
"schematics",
"cypress",
"e2e",
"testing"
"testing",
"angular",
"automation"
],
"publishConfig": {
"access": "public"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export interface CypressBuilderOptions extends JsonObject {
env: Record<string, string>
quiet: boolean
exit: boolean
headed: boolean
headless: boolean
key: string
parallel: boolean
Expand Down
21 changes: 14 additions & 7 deletions npm/cypress-schematic/src/builders/cypress/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ import { CypressBuilderOptions } from './cypressBuilderOptions'
type CypressOptions = Partial<CypressCommandLine.CypressRunOptions> &
Partial<CypressCommandLine.CypressOpenOptions>;

type StartDevServerProps = {
devServerTarget: string
watch: boolean
context: any
}

function runCypress (
options: CypressBuilderOptions,
context: BuilderContext,
Expand All @@ -40,10 +46,12 @@ function runCypress (
}),
switchMap((options: CypressBuilderOptions) => {
return (options.devServerTarget
? startDevServer(options.devServerTarget, options.watch, context)
? startDevServer({ devServerTarget: options.devServerTarget, watch: options.watch, context }).pipe(
map((devServerBaseUrl: string) => options.baseUrl || devServerBaseUrl),
)
: of(options.baseUrl)
).pipe(
concatMap((baseUrl: string) => initCypress({ ...options, baseUrl })),
concatMap((devServerBaseUrl: string) => initCypress({ ...options, devServerBaseUrl })),
options.watch ? tap(noop) : first(),
catchError((error) => {
return of({ success: false }).pipe(
Expand Down Expand Up @@ -89,11 +97,10 @@ function initCypress (userOptions: CypressBuilderOptions): Observable<BuilderOut
)
}

export function startDevServer (
devServerTarget: string,
watch: boolean,
context: any,
): Observable<string> {
export function startDevServer ({
devServerTarget,
watch,
context }: StartDevServerProps): Observable<string> {
const overrides = {
watch,
}
Expand Down
7 changes: 7 additions & 0 deletions npm/react/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# [@cypress/react-v5.12.5](https://github.com/cypress-io/cypress/compare/@cypress/react-v5.12.4...@cypress/react-v5.12.5) (2022-05-17)


### Bug Fixes

* add support for Next.js v12.1.6 ([#21516](https://github.com/cypress-io/cypress/issues/21516)) ([72ed33c](https://github.com/cypress-io/cypress/commit/72ed33c4eaa4823366fb47f212f0c5e609fa2cf0))

# [@cypress/react-v5.12.4](https://github.com/cypress-io/cypress/compare/@cypress/react-v5.12.3...@cypress/react-v5.12.4) (2022-03-03)


Expand Down
Loading

0 comments on commit 50e6d4c

Please sign in to comment.