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 #66442

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

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

Warning

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

UI Coverage  45.56%
  Untested elements 185  
  Tested elements 159  
Accessibility  97.97%
  Failed rules  4 critical   8 serious   2 moderate   2 minor
  Failed elements 101  

Tests for review

Failed  cypress/e2e/studio/studio.cy.ts • 1 failed test • app-e2e

View Output

Test Artifacts
Cypress Studio > updates an existing test with assertions Test Replay Screenshots
Flakiness  issues/28527.cy.ts • 1 flaky test • 5x-driver-chrome

View Output

Test Artifacts
issue 28527 > fails and then retries and verifies about:blank is not displayed Test Replay Screenshots
Flakiness  commands/waiting.cy.js • 2 flaky tests • 5x-driver-chrome:beta

View Output

Test Artifacts
... > errors > throws when route is never resolved Test Replay
... > errors > throws when waiting for 2nd response to route Test Replay
Flakiness  e2e/origin/config_env.cy.ts • 1 flaky test • 5x-driver-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  issues/28527.cy.ts • 1 flaky test • 5x-driver-chrome:beta

View Output

Test Artifacts
issue 28527 > fails and then retries and verifies about:blank is not displayed Test Replay Screenshots
Flakiness  issues/28527.cy.ts • 1 flaky test • 5x-driver-electron

View Output

Test Artifacts
issue 28527 > fails and then retries and verifies about:blank is not displayed Test Replay Screenshots

The first 5 flaky specs are shown, see all 8 specs in Cypress Cloud.

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.

1 participant