Skip to content

Commit 6c3b69e

Browse files
Merge branch 'develop' into feat/cy-prompt
2 parents 30e48d1 + 0fbb215 commit 6c3b69e

File tree

35 files changed

+154
-116
lines changed

35 files changed

+154
-116
lines changed

.circleci/workflows.yml

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

3-
chrome-stable-version: &chrome-stable-version "137.0.7151.68"
4-
chrome-beta-version: &chrome-beta-version "138.0.7204.15"
3+
chrome-stable-version: &chrome-stable-version "137.0.7151.103"
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/browser-tools@2.0.0
8+
browser-tools: circleci/browser-tools@2.1.1
99

1010
defaults: &defaults
1111
parallelism: 1
@@ -582,11 +582,6 @@ commands:
582582
description: whether or not to install google chrome for testing
583583
type: boolean
584584
default: false
585-
google-chrome-for-testing-channel:
586-
description: Google Chrome for Testing channel to install
587-
type: string
588-
# can be stable, beta, dev, or canary
589-
default: stable
590585
google-chrome-for-testing-version:
591586
description: Google Chrome for Testing version to install
592587
type: string
@@ -639,13 +634,13 @@ commands:
639634
equal: [ true, << parameters.install-chrome-for-testing >> ]
640635
steps:
641636
- run:
642-
name: Install Chrome for Testing and link it to google-chrome
637+
name: Install unzip
643638
command: |
644-
INSTALL_OUTPUT=$(npx @puppeteer/browsers install chrome@<<parameters.google-chrome-version>> --path /tmp/chrome-for-testing)
645-
DOWNLOAD_DIR=$(echo "$INSTALL_OUTPUT" | grep -o '\/.*\/chrome-linux64')
646-
mv $DOWNLOAD_DIR /opt/chrome-for-testing
647-
ln -fs /opt/chrome-for-testing/chrome /usr/local/bin/chrome
648-
rm -rf /tmp/chrome-for-testing
639+
apt-get update && apt-get install -y unzip
640+
- browser-tools/install_chrome_for_testing:
641+
version: << parameters.google-chrome-for-testing-version >>
642+
install_chromedriver: false
643+
649644
# 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.
650645
#
651646
# 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

npm/vite-dev-server/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
},
2323
"devDependencies": {
2424
"chai": "^4.3.6",
25+
"cross-env": "7.0.3",
2526
"decache": "^4.6.2",
2627
"dedent": "^0.7.0",
2728
"mocha": "^9.2.2",

npm/webpack-dev-server/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
"@types/speed-measure-webpack-plugin": "^1.3.4",
3636
"@types/webpack-bundle-analyzer": "4.7.0",
3737
"chai": "^4.3.6",
38+
"cross-env": "7.0.3",
3839
"dedent": "^0.7.0",
3940
"mocha": "^9.2.2",
4041
"proxyquire": "2.1.3",

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,6 @@
166166
"gulp-debug": "4.0.0",
167167
"gulp-rename": "1.4.0",
168168
"hasha": "5.0.0",
169-
"http-server": "0.12.3",
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/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
"classnames": "^2.5.1",
5959
"combine-properties": "0.1.0",
6060
"concurrently": "^6.2.0",
61-
"cross-env": "6.0.3",
61+
"cross-env": "7.0.3",
6262
"cypress-plugin-tab": "1.0.5",
6363
"cypress-real-events": "1.14.0",
6464
"dayjs": "^1.9.3",

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)