Skip to content

chore: (studio) set up infrastructure for cypress in cypress tests for cloud studio #31621

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
May 5, 2025

Conversation

ryanthemanuel
Copy link
Collaborator

@ryanthemanuel ryanthemanuel commented May 1, 2025

Additional details

This PR adds infrastructure to support cypress in cypress testing. See the README for specifics.

Steps to test

How has the user experience changed?

PR Tasks

Copy link

cypress bot commented May 1, 2025

cypress    Run #62124

Run Properties:  status check passed Passed #62124  •  git commit b5b84847ef: Revert "extract cloud env to a constant"
Project cypress
Branch Review ryanm/internal/cy-in-cy-cloud-studio
Run status status check passed Passed #62124
Run duration 12m 10s
Commit git commit b5b84847ef: Revert "extract cloud env to a constant"
Committer Ryan Manuel
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 4
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 225
View all changes introduced in this branch ↗︎
UI Coverage  62.5%
  Untested elements 31  
  Tested elements 55  
Accessibility  96.2%
  Failed rules  0 critical   4 serious   1 moderate   0 minor
  Failed elements 197  

@ryanthemanuel ryanthemanuel changed the title internal: (studio) set up infrastructure for cypress in cypress tests for cloud studio chore: (studio) set up infrastructure for cypress in cypress tests for cloud studio May 2, 2025
@ryanthemanuel ryanthemanuel self-assigned this May 2, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR sets up the infrastructure to support Cypress in Cypress tests for cloud Studio. Key changes include updating the environment variable logic to prioritize CYPRESS_CONFIG_ENV, adding new Cypress commands and helper functions to simulate studio and cloud interactions, and updating tests and documentation.

Reviewed Changes

Copilot reviewed 9 out of 10 changed files in this pull request and generated no comments.

Show a summary per file
File Description
packages/server/lib/project-base.ts Updated environment variable logic to prioritize CYPRESS_CONFIG_ENV over CYPRESS_INTERNAL_ENV
packages/server/lib/cloud/api/studio/get_and_initialize_studio_manager.ts Updated environment variable logic to prioritize CYPRESS_CONFIG_ENV over CYPRESS_INTERNAL_ENV
packages/server/lib/StudioLifecycleManager.ts Updated environment variable logic to prioritize CYPRESS_CONFIG_ENV over CYPRESS_INTERNAL_ENV
packages/frontend-shared/cypress/support/e2e.ts Added interfaces and Cypress commands for mocking cloud studio requests and full snapshot behavior
packages/frontend-shared/cypress/fixtures/dummy-protocol.js Added a dummy protocol file for inner Cypress tests
packages/frontend-shared/cypress/e2e/e2ePluginSetup.ts Extended task setup to support studio mocks and cleared cloud studio-related env variables and mocks
packages/app/cypress/e2e/studio/studio.cy.ts Added a new e2e test to validate the cloud studio session with AI enabled
guides/studio-development.md / guides/README.md Updated documentation to include studio development and protocol instructions
Files not reviewed (1)
  • packages/frontend-shared/package.json: Language not supported
Comments suppressed due to low confidence (3)

packages/server/lib/project-base.ts:410

  • This update prioritizes CYPRESS_CONFIG_ENV over CYPRESS_INTERNAL_ENV for determining the cloud environment. Please ensure that this change is documented in the related configuration guides.
const cloudEnv = (process.env.CYPRESS_CONFIG_ENV || process.env.CYPRESS_INTERNAL_ENV || 'production') as 'development' | 'staging' | 'production'

packages/server/lib/cloud/api/studio/get_and_initialize_studio_manager.ts:128

  • The updated environment variable logic here mirrors the change in project-base.ts, ensuring consistent behavior across modules. Verify that any references to the environment configuration in documentation and tests are updated accordingly.
const cloudEnv = (process.env.CYPRESS_CONFIG_ENV || process.env.CYPRESS_INTERNAL_ENV || 'production') as 'development' | 'staging' | 'production'

packages/server/lib/StudioLifecycleManager.ts:55

  • The change to use CYPRESS_CONFIG_ENV first in the environment variable check promotes consistency. Ensure that any developer-facing materials reflect this new priority for configuring the cloud environment.
const cloudEnv = (process.env.CYPRESS_CONFIG_ENV || process.env.CYPRESS_INTERNAL_ENV || 'production') as 'development' | 'staging' | 'production'

Copy link
Contributor

@mabela416 mabela416 left a comment

Choose a reason for hiding this comment

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

Nice updates to the readmes/guides

@ryanthemanuel ryanthemanuel merged commit acaaf30 into develop May 5, 2025
95 checks passed
@ryanthemanuel ryanthemanuel deleted the ryanm/internal/cy-in-cy-cloud-studio branch May 5, 2025 13:01
@cypress-bot
Copy link
Contributor

cypress-bot bot commented May 6, 2025

Released in 14.3.3.

This comment thread has been locked. If you are still experiencing this issue after upgrading to
Cypress v14.3.3, please open a new issue.

@cypress-bot cypress-bot bot locked as resolved and limited conversation to collaborators May 6, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants