Skip to content

Conversation

@cacieprins
Copy link
Contributor

  • Closes

Additional details

Browser process spawning was a little unwieldy. This applies the stranger fig pattern by:

  • writing tests for packages/launcher/lib/launch.ts (renamed from browsers.ts to match its export) that focus on its side effects rather than implementation
  • extracting platform specific behavior (darwin arm64) and using template methods for the rest of the platforms
  • using the factory pattern to select which platform to create

Several of the platform classes are empty as placeholders for browser detection logic, and should be expanded as strangler fig is applied to detect and detectByPath. Once the public interface here is strangled, we should consider whether the public interface for @packages/launcher still fits its requirements, or if there are better patterns to expose.

Steps to test

How has the user experience changed?

PR Tasks

@cacieprins cacieprins force-pushed the chore/launcher-launch-refactor branch from 6e623b6 to c238b66 Compare October 9, 2025 19:23
debug('launching browser %o', { browser, url })

// We shouldn't need to check this, because FoundBrowser.path is
// not optional.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Lots of places explicitly coerce unknown POJOs to FoundBrowser, though, so it's important to keep it

import { removeDuplicateBrowsers } from '@packages/data-context/src/sources/BrowserDataSource'
import { knownBrowsers } from './known-browsers'
import * as darwinHelper from './darwin'
import * as darwinHelper from './darwinHelpers'
Copy link
Contributor Author

Choose a reason for hiding this comment

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

These were renamed because intellisense was complaining that

/lib/darwin/index.ts was too similar to /lib/platforms/Darwin.ts 🤷

@cypress
Copy link

cypress bot commented Oct 14, 2025

cypress    Run #66926

Run Properties:  status check failed Failed #66926  •  git commit 115cbde0ae: Merge branch 'develop' into chore/launcher-launch-refactor
Project cypress
Branch Review chore/launcher-launch-refactor
Run status status check failed Failed #66926
Run duration 16m 14s
Commit git commit 115cbde0ae: Merge branch 'develop' into chore/launcher-launch-refactor
Committer Cacie Prins
View all properties for this run ↗︎

Test results
Tests that failed  Failures 8
Tests that were flaky  Flaky 4
Tests that did not run due to a developer annotating a test with .skip  Pending 947
Tests that did not run due to a failure in a mocha hook  Skipped 4
Tests that passed  Passing 14076
View all changes introduced in this branch ↗︎

Warning

Partial Report: The results for the Application Quality reports may be incomplete.

UI Coverage  45.48%
  Untested elements 188  
  Tested elements 161  
Accessibility  97.98%
  Failed rules  4 critical   8 serious   2 moderate   2 minor
  Failed elements 101  

Tests for review

Failed  commands/connectors.cy.js • 0 failed tests • 5x-driver-electron

View Output

Test Artifacts
Failed  dom/visibility.cy.ts • 0 failed tests • 5x-driver-electron

View Output

Test Artifacts
Failed  commands/actions/type_errors.cy.ts • 0 failed tests • 5x-driver-electron

View Output

Test Artifacts
Failed  commands/actions/trigger.cy.ts • 0 failed tests • 5x-driver-electron

View Output

Test Artifacts
Failed  e2e/origin/commands/actions.cy.ts • 0 failed tests • 5x-driver-electron

View Output

Test Artifacts

The first 5 failed specs are shown, see all 810 specs in Cypress Cloud.

Flakiness  e2e/origin/config_env.cy.ts • 1 flaky test • 5x-driver-inject-document-domain-chrome

View Output

Test Artifacts
cy.origin- Cypress.config() > serializable > overwrites different values in secondary if one exists in the primary Test Replay
Flakiness  e2e/origin/config_env.cy.ts • 1 flaky test • 5x-driver-inject-document-domain-chrome:beta

View Output

Test Artifacts
cy.origin- Cypress.config() > serializable > overwrites different values in secondary if one exists in the primary Test Replay
Flakiness  commands/net_stubbing.cy.ts • 1 flaky test • 5x-driver-firefox

View Output

Test Artifacts
... > stops waiting when an xhr request is canceled
    </td>
  </tr></table>
Flakiness  next.cy.ts • 1 flaky test • webpack-dev-server

View Output

Test Artifacts
Working with next-14 > should allow import of global styles in support file Test Replay Screenshots

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants