Skip to content

Commit b3ccd12

Browse files
Merge branch 'develop' into ryanm/fix/rename-exclude-from-ai
2 parents 050c872 + b1ec294 commit b3ccd12

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

packages/server/lib/project-base.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -497,6 +497,9 @@ export class ProjectBase extends EE {
497497

498498
const studio = await this.ctx.coreData.studioLifecycleManager?.getStudio()
499499

500+
// Update the session id in the studio manager
501+
studio?.updateSessionId(cloudStudioSessionId)
502+
500503
if (this.spec && studio?.protocolManager) {
501504
telemetryManager.mark(INITIALIZATION_MARK_NAMES.CAN_ACCESS_STUDIO_AI_START)
502505
const canAccessStudioAI = await studio?.canAccessStudioAI(this.browser) ?? false

packages/server/test/unit/project_spec.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -813,6 +813,7 @@ This option will not have an effect in Some-other-name. Tests that rely on web s
813813
const mockBeforeSpec = sinon.stub()
814814
const mockAccessStudioAI = sinon.stub().resolves(true)
815815
const mockCaptureStudioEvent = sinon.stub().resolves()
816+
const mockUpdateSessionId = sinon.stub()
816817

817818
this.project.spec = {}
818819

@@ -832,6 +833,8 @@ This option will not have an effect in Some-other-name. Tests that rely on web s
832833
dbPath: 'test-db-path',
833834
}
834835

836+
studioManager.updateSessionId = mockUpdateSessionId
837+
835838
const studioLifecycleManager = new StudioLifecycleManager()
836839

837840
this.project.ctx.coreData.studioLifecycleManager = studioLifecycleManager
@@ -878,6 +881,8 @@ This option will not have an effect in Some-other-name. Tests that rely on web s
878881
name: 'chrome',
879882
})
880883

884+
expect(mockUpdateSessionId.getCall(0).args[0]).to.be.a.uuid()
885+
881886
expect(browsers.connectProtocolToBrowser).to.be.calledWith({
882887
browser: this.project.browser,
883888
foundBrowsers: this.project.options.browsers,
@@ -905,6 +910,7 @@ This option will not have an effect in Some-other-name. Tests that rely on web s
905910
const mockBeforeSpec = sinon.stub()
906911
const mockAccessStudioAI = sinon.stub().resolves(true)
907912
const mockCaptureStudioEvent = sinon.stub().resolves()
913+
const mockUpdateSessionId = sinon.stub()
908914

909915
this.project.spec = {}
910916

@@ -924,6 +930,8 @@ This option will not have an effect in Some-other-name. Tests that rely on web s
924930
dbPath: 'test-db-path',
925931
}
926932

933+
studioManager.updateSessionId = mockUpdateSessionId
934+
927935
const studioLifecycleManager = new StudioLifecycleManager()
928936

929937
this.project.ctx.coreData.studioLifecycleManager = studioLifecycleManager
@@ -962,6 +970,7 @@ This option will not have an effect in Some-other-name. Tests that rely on web s
962970
const { cloudStudioSessionId } = await studioInitPromise
963971

964972
expect(cloudStudioSessionId).to.equal('existing-session-id')
973+
expect(mockUpdateSessionId).to.be.calledOnceWith('existing-session-id')
965974
})
966975

967976
it('calls resetBrowserState during onStudioInit when AI is enabled', async function () {

0 commit comments

Comments
 (0)