Skip to content

Commit

Permalink
use isBrowserGivenByCli only for run mode (#5)
Browse files Browse the repository at this point in the history
* Update modeOptions.ts

* Update index.ts

* Update ProjectLifecycleManager.ts
  • Loading branch information
alexsch01 authored Nov 3, 2024
1 parent c1fc1b2 commit 66d26b1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
6 changes: 3 additions & 3 deletions packages/data-context/src/data/ProjectLifecycleManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -315,14 +315,14 @@ export class ProjectLifecycleManager {
async setInitialActiveBrowser () {
const configBrowser = this.loadedFullConfig?.defaultBrowser

if (configBrowser && !this.ctx.modeOptions.isBrowserGivenByCli) {
if (this.ctx.isRunMode) {
if (configBrowser) {
if (this.ctx.isRunMode && !this.ctx.modeOptions.isBrowserGivenByCli) {
this.ctx.setModeOptionsBrowser(configBrowser)

return
}

this.ctx.coreData.cliBrowser = configBrowser
this.ctx.coreData.cliBrowser ??= configBrowser
}

if (this.ctx.coreData.cliBrowser) {
Expand Down
3 changes: 1 addition & 2 deletions packages/server/lib/modes/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ export = (mode, options) => {
return require('./smoke_test').run(options)
}

options.isBrowserGivenByCli = options.browser !== undefined

if (mode === 'run') {
_.defaults(options, {
socketId: random.id(10),
Expand All @@ -20,6 +18,7 @@ export = (mode, options) => {
quiet: false,
morgan: false,
report: true,
isBrowserGivenByCli: options.browser !== undefined,
})
}

Expand Down
2 changes: 1 addition & 1 deletion packages/types/src/modeOptions.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
export interface CommonModeOptions {
_?: (string | null)[] | null
invokedFromCli: boolean
isBrowserGivenByCli: boolean
userNodePath?: string
userNodeVersion?: string
configFile?: string | null
Expand All @@ -25,6 +24,7 @@ export interface RunModeOptions extends CommonModeOptions {
parallel?: boolean | null
ciBuildId?: string | null
tag?: (string)[] | null
isBrowserGivenByCli: boolean
}

export type TestingType = 'e2e' | 'component'
Expand Down

0 comments on commit 66d26b1

Please sign in to comment.