Skip to content

Commit 38d860c

Browse files
Merge branch '10.0-release' into merge-develop-4-12
2 parents 7f369ae + 001a724 commit 38d860c

File tree

12 files changed

+69
-25
lines changed

12 files changed

+69
-25
lines changed

.github/CODEOWNERS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@
3434
/packages/net-stubbing/ @cypress-io/end-to-end
3535
/packages/network/ @cypress-io/end-to-end
3636
/packages/proxy/ @cypress-io/end-to-end
37+
/packages/data-context/ @tgriesser
38+
/packages/graphql/ @tgriesser
3739
/packages/reporter/ @cypress-io/end-to-end
3840
/packages/resolve-dist/ @cypress-io/end-to-end
3941
/packages/rewriter/ @cypress-io/end-to-end

cli/types/cypress.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3001,11 +3001,11 @@ declare namespace Cypress {
30013001

30023002
type DevServerConfigObject = {
30033003
bundler: 'webpack'
3004-
framework: 'react'
3004+
framework: 'react' | 'vue' | 'vue-cli' | 'nuxt' | 'create-react-app'
30053005
webpackConfig?: PickConfigOpt<'webpackConfig'>
30063006
} | {
30073007
bundler: 'vite'
3008-
framework: 'react'
3008+
framework: 'react' | 'vue'
30093009
viteConfig?: Omit<Exclude<PickConfigOpt<'viteConfig'>, undefined>, 'base' | 'root'>
30103010
}
30113011

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
"test-watch": "lerna exec yarn test-watch --ignore \"'@packages/{driver,root,static,web-config}'\"",
6868
"type-check": "yarn lerna exec yarn type-check --scope @tooling/system-tests && node scripts/type_check",
6969
"verify:mocha:results": "node ./scripts/verify_mocha_results",
70-
"watch": "yarn gulp dev:watch",
70+
"watch": "yarn gulp watch",
7171
"prepare": "husky install"
7272
},
7373
"dependencies": {

packages/app/README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@ This is the front-end for the Cypress App.
44

55
## Development
66

7-
1. `yarn dev` (inside of `packages/app`)
8-
2. It will open launchpad
9-
3. Select Component or E2E Testing
10-
3. Open chrome (or another browser)
11-
4. It will show the new Vite powered app
7+
1. `yarn watch` (inside of root)
8+
2. `yarn cypress:open` (inside of `packages/app`)
9+
3. It will open launchpad
10+
4. Select Component or E2E Testing
11+
5. Open chrome (or another browser)
12+
6. It will show the new Vite powered app
1213

1314
## How the App works
1415

packages/data-context/src/DataContext.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ export class DataContext {
427427
await this.lifecycleManager.initializeRunMode(this.coreData.currentTestingType)
428428
} else if (this._config.mode === 'open') {
429429
await this.initializeOpenMode()
430-
if (this.coreData.currentTestingType && await this.lifecycleManager.waitForInitializeSuccess()) {
430+
if (this.coreData.currentProject && this.coreData.currentTestingType && await this.lifecycleManager.waitForInitializeSuccess()) {
431431
this.lifecycleManager.setAndLoadCurrentTestingType(this.coreData.currentTestingType)
432432
this.lifecycleManager.scaffoldFilesIfNecessary()
433433
}

packages/data-context/src/data/ProjectLifecycleManager.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,10 @@ export class ProjectLifecycleManager {
332332
}
333333

334334
async waitForInitializeSuccess (): Promise<boolean> {
335+
if (!this._configManager) {
336+
return false
337+
}
338+
335339
if (this._configManager?.isLoadingConfigFile) {
336340
try {
337341
await this.initializeConfig()
@@ -516,6 +520,7 @@ export class ProjectLifecycleManager {
516520
this._configManager = undefined
517521
}
518522

523+
this.ctx.coreData.currentProjectGitInfo?.destroy()
519524
this.ctx.project.destroy()
520525
this._currentTestingType = null
521526
this._cachedInitialConfig = undefined

packages/launchpad/README.md

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,25 @@ For the best development experience, you will want to use VS Code with the [Vola
4141

4242
```bash
4343
## from repo root
44-
yarn dev
44+
yarn watch
4545
```
4646

47-
This starts Vite in watch mode. It also starts the GraphQL Server. You can access it on `http://localhost:52200/graphql`.
47+
This starts Vite in watch mode, and any code-generation scripts that need to be running in the background to support our environment.
48+
49+
In a seprate terminal, run:
50+
51+
```bash
52+
## from repo root
53+
yarn cypress:open
54+
```
55+
56+
This starts the GraphQL Server, and opens Cypress. By running this separate from the `yarn watch`, you can kill & respawn the Cypress binary without the overhead of the watch processes you'd see by running `yarn dev`.
57+
58+
You can access the GraphQL inspector on `http://localhost:52200/graphql`.
4859

4960
![graphql](../graphql/gql.png)
5061

51-
If you notice your IDE has not updated and is showing errors, even after `yarn watch` has run, you might need to reopen your IDE. With the amount of code generation running, sometimes the IDE does not recognize that the code has changed.
62+
If you notice your IDE has not updated and is showing errors, even after `yarn watch` has run, you might need to reload your IDE. With the amount of code generation running, sometimes the IDE does not recognize that the code has changed.
5263

5364
## Testing
5465

packages/launchpad/cypress/e2e/global-mode.cy.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ describe('Launchpad: Global Mode', () => {
6262
})
6363

6464
describe('when projects have been added', () => {
65-
const setupAndValidateProjectsList = (projectList) => {
66-
cy.openGlobalMode()
65+
const setupAndValidateProjectsList = (projectList, globalModeOptions?: string[] | undefined) => {
66+
cy.openGlobalMode(globalModeOptions)
6767
projectList.forEach((projectName) => {
6868
cy.addProject(projectName)
6969
})
@@ -96,6 +96,14 @@ describe('Launchpad: Global Mode', () => {
9696
cy.get('[data-cy="project-card"]').should('not.exist')
9797
})
9898

99+
it('takes the user to the next step when clicking on a project card when passing testing type on the command line', () => {
100+
const projectList = ['todos']
101+
102+
setupAndValidateProjectsList(projectList, ['--e2e'])
103+
cy.get('[data-cy="project-card"]').click()
104+
cy.get('[data-cy="project-card"]').should('not.exist')
105+
})
106+
99107
it('updates most-recently opened project list when returning from next step', () => {
100108
const projectList = ['todos', 'ids', 'cookies', 'plugin-empty']
101109

scripts/gulp/gulpfile.ts

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import { exitAfterAll } from './tasks/gulpRegistry'
1919
import { execSync } from 'child_process'
2020
import { webpackRunner } from './tasks/gulpWebpack'
2121
import { e2eTestScaffold, e2eTestScaffoldWatch } from './tasks/gulpE2ETestScaffold'
22+
import dedent from 'dedent'
2223

2324
if (process.env.CYPRESS_INTERNAL_VITE_DEV) {
2425
process.env.CYPRESS_INTERNAL_VITE_APP_PORT ??= '3333'
@@ -60,6 +61,8 @@ gulp.task(
6061
webpackRunner,
6162
gulp.series(
6263
makePathMap,
64+
// Before dev, fetch the latest "remote" schema from the Cypress dashboard
65+
syncRemoteGraphQL,
6366
gulp.parallel(
6467
viteClean,
6568
e2eTestScaffoldWatch,
@@ -73,13 +76,26 @@ gulp.task(
7376
viteApp,
7477
viteLaunchpad,
7578
),
76-
77-
// And we're finally ready for electron, watching for changes in
78-
// /graphql to auto-restart the server
7979
),
8080
),
8181
)
8282

83+
gulp.task(
84+
'watch',
85+
gulp.series(
86+
'dev:watch',
87+
// And we're finally ready for electron, watching for changes in
88+
// /graphql to auto-restart the server
89+
async function logInfo () {
90+
console.log(dedent`
91+
"yarn watch" is complete, and is now watching your files for code-generation updates.
92+
93+
In a separate terminal, run "yarn cypress:open" to start Cypress
94+
`)
95+
},
96+
),
97+
)
98+
8399
gulp.task(
84100
'dev',
85101
gulp.series(
@@ -88,9 +104,6 @@ gulp.task(
88104
// And we're finally ready for electron, watching for changes in
89105
// /graphql to auto-restart the server
90106
startCypressWatch,
91-
92-
// Before dev, fetch the latest "remote" schema from the Cypress dashboard
93-
syncRemoteGraphQL,
94107
),
95108
)
96109

system-tests/project-fixtures/cra/cypress.config.js renamed to system-tests/project-fixtures/cra/cypress.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { defineConfig } from 'cypress'
22

3-
module.exports = defineConfig({
3+
export default defineConfig({
44
component: {
55
devServer: {
66
framework: 'create-react-app',

0 commit comments

Comments
 (0)