Skip to content

Commit

Permalink
misc: (studio) add support for url routing (#31205)
Browse files Browse the repository at this point in the history
* update url with studio params

* updates

* spec updates

* adding tests

* updating changelog

* skip adding visit log during start

* update url support

* cy origin tests

* fix tests

* updates

* update origin test

* add a wait

* update

* pr updates

---------

Co-authored-by: Jennifer Shehane <jennifer@cypress.io>
  • Loading branch information
mschile and jennifer-shehane authored Mar 11, 2025
1 parent 5ff7e37 commit b9103af
Show file tree
Hide file tree
Showing 19 changed files with 1,132 additions and 184 deletions.
1 change: 1 addition & 0 deletions cli/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ _Released 3/11/2025 (PENDING)_
**Misc:**

- Additional CLI options will be displayed in the terminal for some Cloud error messages. Addressed in [#31211](https://github.com/cypress-io/cypress/pull/31211).
- Updated Cypress Studio with url routing to support maintaining state when reloading. Addresses [#31000](https://github.com/cypress-io/cypress/issues/31000) and [#30996](https://github.com/cypress-io/cypress/issues/30996).

**Dependency Updates:**

Expand Down
4 changes: 4 additions & 0 deletions packages/app/cypress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,13 @@ export default defineConfig({
framework: 'vue',
},
},
hosts: {
'foobar.com': '127.0.0.1',
},
'e2e': {
experimentalRunAllSpecs: true,
experimentalStudio: true,
experimentalOriginDependencies: true,
baseUrl: 'http://localhost:5555',
supportFile: 'cypress/e2e/support/e2eSupport.ts',
async setupNodeEvents (on, config) {
Expand Down
25 changes: 18 additions & 7 deletions packages/app/cypress/e2e/studio/helper.ts
Original file line number Diff line number Diff line change
@@ -1,25 +1,36 @@
export function launchStudio () {
export function launchStudio ({ specName = 'spec.cy.js', createNewTest = false, cliArgs = [''] } = {}) {
cy.scaffoldProject('experimental-studio')
cy.openProject('experimental-studio')
cy.openProject('experimental-studio', cliArgs)
cy.startAppServer('e2e')
cy.visitApp()
cy.specsPageIsVisible()
cy.get(`[data-cy-row="spec.cy.js"]`).click()
cy.get(`[data-cy-row="${specName}"]`).click()

cy.waitForSpecToFinish()

// Should not show "Studio Commands" until we've started a new Studio session.
cy.get('[data-cy="hook-name-studio commands"]').should('not.exist')

cy
.contains('visits a basic html page')
.closest('.runnable-wrapper')
if (createNewTest) {
cy.contains('studio functionality').as('item')
} else {
cy.contains('visits a basic html page').as('item')
}

cy.get('@item')
.closest('.runnable-wrapper').as('runnable-wrapper')
.realHover()

cy.get('@runnable-wrapper')
.findByTestId('launch-studio')
.click()

// Studio re-executes spec before waiting for commands - wait for the spec to finish executing.
cy.waitForSpecToFinish()

cy.get('[data-cy="hook-name-studio commands"]').should('exist')
if (createNewTest) {
cy.get('span.runnable-title').contains('New Test').should('exist')
} else {
cy.get('[data-cy="hook-name-studio commands"]').should('exist')
}
}
Loading

5 comments on commit b9103af

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on b9103af Mar 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the linux x64 version of the Test Runner.

Learn more about this pre-release build at https://on.cypress.io/advanced-installation#Install-pre-release-version

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/14.2.0/linux-x64/develop-b9103af3fd8a97cd7b268be32b926b0ef543555e/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on b9103af Mar 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the linux arm64 version of the Test Runner.

Learn more about this pre-release build at https://on.cypress.io/advanced-installation#Install-pre-release-version

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/14.2.0/linux-arm64/develop-b9103af3fd8a97cd7b268be32b926b0ef543555e/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on b9103af Mar 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the darwin arm64 version of the Test Runner.

Learn more about this pre-release build at https://on.cypress.io/advanced-installation#Install-pre-release-version

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/14.2.0/darwin-arm64/develop-b9103af3fd8a97cd7b268be32b926b0ef543555e/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on b9103af Mar 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the darwin x64 version of the Test Runner.

Learn more about this pre-release build at https://on.cypress.io/advanced-installation#Install-pre-release-version

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/14.2.0/darwin-x64/develop-b9103af3fd8a97cd7b268be32b926b0ef543555e/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on b9103af Mar 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the win32 x64 version of the Test Runner.

Learn more about this pre-release build at https://on.cypress.io/advanced-installation#Install-pre-release-version

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/14.2.0/win32-x64/develop-b9103af3fd8a97cd7b268be32b926b0ef543555e/cypress.tgz

Please sign in to comment.