Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/server/lib/project-base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ export class ProjectBase extends EE {
})
}

if (!cfg.isTextTerminal && this.testingType === 'e2e') {
if ((!cfg.isTextTerminal || process.env.CYPRESS_INTERNAL_SIMULATE_OPEN_MODE) && this.testingType === 'e2e') {
const studioLifecycleManager = new StudioLifecycleManager()

studioLifecycleManager.initializeStudioManager({
Expand Down
16 changes: 16 additions & 0 deletions packages/server/test/unit/project_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ let ctx
describe('lib/project-base', () => {
beforeEach(async function () {
delete process.env.CYPRESS_LOCAL_STUDIO_PATH
delete process.env.CYPRESS_INTERNAL_SIMULATE_OPEN_MODE

ctx = getCtx()
Fixtures.scaffold()
Expand Down Expand Up @@ -646,6 +647,21 @@ This option will not have an effect in Some-other-name. Tests that rely on web s

expect(this.project.ctx.coreData.studioLifecycleManager).to.not.be.undefined
})

it('creates studio lifecycle manager when CYPRESS_INTERNAL_SIMULATE_OPEN_MODE is set even in text terminal mode', async function () {
this.project.cfg.isTextTerminal = true
process.env.CYPRESS_INTERNAL_SIMULATE_OPEN_MODE = '1'

sinon.stub(this.project, 'saveState').resolves()
sinon.stub(process, 'chdir')

await this.project.open()

expect(this.project.ctx.coreData.studioLifecycleManager).to.not.be.undefined

// Clean up environment variable
delete process.env.CYPRESS_INTERNAL_SIMULATE_OPEN_MODE
})
})
})

Expand Down
Loading