Skip to content

Commit 968dabb

Browse files
Merge branch 'develop' into release/15.0.0
2 parents 32313ca + 79469f5 commit 968dabb

File tree

19 files changed

+126
-131
lines changed

19 files changed

+126
-131
lines changed

.circleci/workflows.yml

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
version: 2.1
22

33
chrome-stable-version: &chrome-stable-version "137.0.7151.103"
4-
chrome-beta-version: &chrome-beta-version "138.0.7204.15"
4+
chrome-beta-version: &chrome-beta-version "138.0.7204.23"
55
firefox-stable-version: &firefox-stable-version "137.0"
66

77
orbs:
8-
browser-tools: circleci/[email protected].0
8+
browser-tools: circleci/[email protected].1
99

1010
defaults: &defaults
1111
parallelism: 1
@@ -578,11 +578,6 @@ commands:
578578
description: whether or not to install google chrome for testing
579579
type: boolean
580580
default: false
581-
google-chrome-for-testing-channel:
582-
description: Google Chrome for Testing channel to install
583-
type: string
584-
# can be stable, beta, dev, or canary
585-
default: stable
586581
google-chrome-for-testing-version:
587582
description: Google Chrome for Testing version to install
588583
type: string
@@ -635,13 +630,13 @@ commands:
635630
equal: [ true, << parameters.install-chrome-for-testing >> ]
636631
steps:
637632
- run:
638-
name: Install Chrome for Testing and link it to google-chrome
633+
name: Install unzip
639634
command: |
640-
INSTALL_OUTPUT=$(npx @puppeteer/browsers install chrome@<<parameters.google-chrome-version>> --path /tmp/chrome-for-testing)
641-
DOWNLOAD_DIR=$(echo "$INSTALL_OUTPUT" | grep -o '\/.*\/chrome-linux64')
642-
mv $DOWNLOAD_DIR /opt/chrome-for-testing
643-
ln -fs /opt/chrome-for-testing/chrome /usr/local/bin/chrome
644-
rm -rf /tmp/chrome-for-testing
635+
apt-get update && apt-get install -y unzip
636+
- browser-tools/install_chrome_for_testing:
637+
version: << parameters.google-chrome-for-testing-version >>
638+
install_chromedriver: false
639+
645640
# This code builds better-sqlite3 on Debian 10 (Buster). This is necessary because Debian 10 has the oldest glibc version (2.28) that we support.
646641
#
647642
# Since this is running Docker remote (because the job running the command may not be using an executor with the appropriate glibc version), we need to

cli/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ _Released 07/01/2025 (PENDING)_
2626

2727
## 14.5.0
2828

29-
_Released 6/17/2025 (PENDING)_
29+
_Released 6/17/2025_
3030

3131
**Features:**
3232

cli/lib/util.js

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ const _ = require('lodash')
22
const arch = require('arch')
33
const os = require('os')
44
const ospath = require('ospath')
5-
const crypto = require('crypto')
5+
const hasha = require('hasha')
66
const la = require('lazy-ass')
77
const is = require('check-more-types')
88
const tty = require('tty')
@@ -30,31 +30,11 @@ const getosAsync = Promise.promisify(getos)
3030

3131
/**
3232
* Returns SHA512 of a file
33-
*
34-
* Implementation lifted from https://github.com/sindresorhus/hasha
35-
* but without bringing that dependency (since hasha is Node v8+)
3633
*/
3734
const getFileChecksum = (filename) => {
3835
la(is.unemptyString(filename), 'expected filename', filename)
3936

40-
const hashStream = () => {
41-
const s = crypto.createHash('sha512')
42-
43-
s.setEncoding('hex')
44-
45-
return s
46-
}
47-
48-
return new Promise((resolve, reject) => {
49-
const stream = fs.createReadStream(filename)
50-
51-
stream.on('error', reject)
52-
.pipe(hashStream())
53-
.on('error', reject)
54-
.on('finish', function () {
55-
resolve(this.read())
56-
})
57-
})
37+
return hasha.fromFile(filename, { algorithm: 'sha512' })
5838
}
5939

6040
const getFileSize = (filename) => {

cli/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
"figures": "^3.2.0",
4747
"fs-extra": "^9.1.0",
4848
"getos": "^3.2.1",
49+
"hasha": "5.2.2",
4950
"is-installed-globally": "~0.4.0",
5051
"lazy-ass": "^1.6.0",
5152
"listr2": "^3.8.3",
@@ -91,7 +92,6 @@
9192
"dependency-check": "4.1.0",
9293
"dtslint": "4.2.1",
9394
"execa-wrap": "1.4.0",
94-
"hasha": "5.2.2",
9595
"mocha": "6.2.2",
9696
"mock-fs": "5.4.0",
9797
"mocked-env": "1.3.2",

package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "cypress",
3-
"version": "14.4.1",
3+
"version": "14.5.0",
44
"description": "Cypress is a next generation front end testing tool built for the modern web",
55
"private": true,
66
"scripts": {
@@ -165,8 +165,7 @@
165165
"gulp-awspublish": "8.0.0",
166166
"gulp-debug": "4.0.0",
167167
"gulp-rename": "1.4.0",
168-
"hasha": "5.0.0",
169-
"http-server": "0.12.3",
168+
"hasha": "5.2.2",
170169
"human-interval": "1.0.0",
171170
"husky": "7.0.2",
172171
"inquirer": "8.2.4",

packages/app/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ This is the front-end for the Cypress App.
1717
Cypress has two modes: `run` and `open`. We want run mode to be as light and fast as possible, since this is the mode used to run on CI machines, etc. Run mode has minimal UI showing only what is necessary. Open mode is the interactive experience.
1818

1919
- **`open`** mode is driven using GraphQL and urql. It shows the full Cypress app, include the top nav, side nav, spec list, etc. You can change between testing types, check your latest runs on Cypress Cloud, update settings, etc.
20-
- **`run`** mode is does not rely on GraphQL. This is so we can be as performant as possible. It only renders the "runner" part of the UI, which is comprised of the command log, Spec Runner header, and AUT iframe.
20+
- **`run`** mode does not rely on GraphQL. This is so we can be as performant as possible. It only renders the "runner" part of the UI, which is comprised of the command log, Spec Runner header, and AUT iframe.
2121

2222
The two modes are composed using the same logic, but have slightly different components. You can see where the differences are in `Runner.vue`(src/pages/Specs/Runner.vue). Notice that `<SpecRunnerOpenMode>` receives a `gql` prop, since it uses GraphQL, and `<SpecRunnerRunMode>` does not.
2323

packages/app/cypress/e2e/runs.cy.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -564,8 +564,9 @@ describe('App: Runs', { viewportWidth: 1200 }, () => {
564564
})
565565

566566
cy.visitApp('/runs')
567+
cy.findByText(defaultMessages.runs.errors.unauthorized.button).should('be.visible')
567568
cy.findByText(defaultMessages.runs.errors.unauthorized.button).click()
568-
cy.findByText(defaultMessages.runs.errors.unauthorizedRequested.button).should('exist')
569+
cy.findByText(defaultMessages.runs.errors.unauthorizedRequested.button).should('be.visible')
569570
})
570571
})
571572

packages/app/cypress/e2e/studio/studio-cloud.cy.ts

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,4 +227,35 @@ describe('studio functionality', () => {
227227
// verify studio is still open
228228
cy.findByTestId('studio-panel').should('be.visible')
229229
})
230+
231+
it('does not record studio commands when cloud studio is enabled', () => {
232+
launchStudio({ enableCloudStudio: true })
233+
234+
cy.findByTestId('studio-panel').should('be.visible')
235+
236+
// Attempt to perform actions that would normally be recorded in regular studio
237+
// but should NOT be recorded in when cloud studio is enabled because event listeners are not attached
238+
cy.getAutIframe().within(() => {
239+
cy.get('p').contains('Count is 0')
240+
241+
// Try to click the increment button - this should NOT be recorded
242+
// because cloud studio event listeners should not be attached
243+
cy.get('#increment').realClick().then(() => {
244+
cy.get('p').contains('Count is 1')
245+
})
246+
})
247+
248+
// Verify that no legacy studio commands were recorded
249+
cy.get('.command-is-studio').should('not.exist')
250+
251+
// Verify that the actual DOM interactions still work (button was clicked, counter incremented)
252+
// but they just weren't recorded by the legacy studio event listeners
253+
cy.getAutIframe().within(() => {
254+
cy.get('p').should('contain', 'Count is 1')
255+
})
256+
257+
cy.findByTestId('studio-panel').should('be.visible')
258+
259+
cy.get('[data-cy="studio-toolbar"]').should('not.exist')
260+
})
230261
})

packages/app/src/runner/SpecRunnerOpenMode.vue

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@
102102
<StudioPanel
103103
v-if="shouldShowStudioPanel"
104104
data-cy="studio-panel"
105+
:cloud-studio-session-id="studioStore.cloudStudioSessionId"
105106
:can-access-studio-a-i="studioStore.canAccessStudioAI"
106107
:on-studio-panel-close="handleStudioPanelClose"
107108
:event-manager="eventManager"
@@ -269,6 +270,8 @@ useSubscription({ query: StudioStatus_ChangeDocument }, (_, data) => {
269270
})
270271
271272
const cloudStudioRequested = computed(() => {
273+
studioStore.setCloudStudioRequested(props.gql.cloudStudioRequested || false)
274+
272275
return props.gql.cloudStudioRequested
273276
})
274277

packages/app/src/runner/event-manager.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -283,27 +283,29 @@ export class EventManager {
283283
this.studioStore.setSuiteId(suiteId)
284284
this.studioStore.setShowUrlPrompt(showUrlPrompt)
285285

286-
this.ws.emit('studio:init', ({ canAccessStudioAI, error }) => {
286+
this.ws.emit('studio:init', ({ canAccessStudioAI, cloudStudioSessionId, error }) => {
287287
if (error) {
288288
// eslint-disable-next-line no-console
289289
console.error(error)
290290
}
291291

292292
this.studioStore.setCanAccessStudioAI(canAccessStudioAI)
293+
this.studioStore.setCloudStudioSessionId(cloudStudioSessionId)
293294
studioInit()
294295
})
295296
}
296297

297298
this.reporterBus.on('studio:init:test', (testId) => {
298299
this.studioStore.setTestId(testId)
299300

300-
this.ws.emit('studio:init', ({ canAccessStudioAI, error }) => {
301+
this.ws.emit('studio:init', ({ canAccessStudioAI, cloudStudioSessionId, error }) => {
301302
if (error) {
302303
// eslint-disable-next-line no-console
303304
console.error(error)
304305
}
305306

306307
this.studioStore.setCanAccessStudioAI(canAccessStudioAI)
308+
this.studioStore.setCloudStudioSessionId(cloudStudioSessionId)
307309
studioInit()
308310
})
309311
})

0 commit comments

Comments
 (0)