Skip to content

Commit 17a70cb

Browse files
authored
Merge branch '10.0-release' into alejandro/fix/ct-cli-viewport
2 parents 9508dfb + 09ab40d commit 17a70cb

File tree

16 files changed

+679
-2450
lines changed

16 files changed

+679
-2450
lines changed

browser-versions.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
22
"chrome:beta": "100.0.4896.60",
3-
"chrome:stable": "99.0.4844.84"
3+
"chrome:stable": "100.0.4896.60"
44
}

circle.yml

Lines changed: 41 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ mainBuildFilters: &mainBuildFilters
2929
only:
3030
- develop
3131
- 10.0-release
32+
- 10.0-use-contexts
3233

3334
# usually we don't build Mac app - it takes a long time
3435
# but sometimes we want to really confirm we are doing the right thing
@@ -38,6 +39,7 @@ macWorkflowFilters: &mac-workflow-filters
3839
or:
3940
- equal: [ develop, << pipeline.git.branch >> ]
4041
- equal: [ '10.0-release', << pipeline.git.branch >> ]
42+
- equal: [ 10.0-use-contexts, << pipeline.git.branch >> ]
4143
- matches:
4244
pattern: "-release$"
4345
value: << pipeline.git.branch >>
@@ -47,6 +49,7 @@ windowsWorkflowFilters: &windows-workflow-filters
4749
or:
4850
- equal: [ develop, << pipeline.git.branch >> ]
4951
- equal: [ '10.0-release', << pipeline.git.branch >> ]
52+
- equal: [ 10.0-use-contexts, << pipeline.git.branch >> ]
5053
- matches:
5154
pattern: "-release$"
5255
value: << pipeline.git.branch >>
@@ -419,9 +422,9 @@ commands:
419422
echo Current working directory is $PWD
420423
echo Total containers $CIRCLE_NODE_TOTAL
421424
422-
if [[ -v PACKAGES_RECORD_KEY ]]; then
425+
if [[ -v MAIN_RECORD_KEY ]]; then
423426
# internal PR
424-
CYPRESS_RECORD_KEY=$PACKAGES_RECORD_KEY \
427+
CYPRESS_RECORD_KEY=$MAIN_RECORD_KEY \
425428
yarn cypress:run --record --parallel --group 5x-driver-<<parameters.browser>> --browser <<parameters.browser>>
426429
else
427430
# external PR
@@ -1416,7 +1419,7 @@ jobs:
14161419
- run:
14171420
command: |
14181421
CYPRESS_KONFIG_ENV=production \
1419-
CYPRESS_RECORD_KEY=$PACKAGES_RECORD_KEY \
1422+
CYPRESS_RECORD_KEY=$MAIN_RECORD_KEY \
14201423
PERCY_PARALLEL_NONCE=$CIRCLE_SHA1 \
14211424
PERCY_ENABLE=${PERCY_TOKEN:-0} \
14221425
PERCY_PARALLEL_TOTAL=-1 \
@@ -1440,7 +1443,7 @@ jobs:
14401443
- run:
14411444
command: |
14421445
CYPRESS_KONFIG_ENV=production \
1443-
CYPRESS_RECORD_KEY=$PACKAGES_RECORD_KEY \
1446+
CYPRESS_RECORD_KEY=$MAIN_RECORD_KEY \
14441447
yarn cypress:run --record --parallel --group ui-components
14451448
working_directory: packages/ui-components
14461449
- verify-mocha-results
@@ -1553,7 +1556,6 @@ jobs:
15531556
- run:
15541557
name: Run tests
15551558
# will use PERCY_TOKEN environment variable if available
1556-
#
15571559
command: |
15581560
CYPRESS_KONFIG_ENV=production \
15591561
PERCY_PARALLEL_NONCE=$CIRCLE_SHA1 \
@@ -1629,26 +1631,26 @@ jobs:
16291631
command: yarn workspace @cypress/eslint-plugin-dev test
16301632

16311633
npm-cypress-schematic:
1632-
<<: *defaults
1633-
resource_class: small
1634-
steps:
1635-
- restore_cached_workspace
1636-
- run:
1637-
name: Build + Install
1638-
command: |
1639-
yarn workspace @cypress/schematic build:all
1640-
working_directory: npm/cypress-schematic
1641-
- run:
1642-
name: Launch
1643-
command: |
1644-
yarn launch:test
1645-
working_directory: npm/cypress-schematic
1646-
- run:
1647-
name: Run unit tests
1648-
command: |
1649-
yarn test
1650-
working_directory: npm/cypress-schematic
1651-
- store-npm-logs
1634+
<<: *defaults
1635+
resource_class: small
1636+
steps:
1637+
- restore_cached_workspace
1638+
- run:
1639+
name: Build + Install
1640+
command: |
1641+
yarn workspace @cypress/schematic build:all
1642+
working_directory: npm/cypress-schematic
1643+
- run:
1644+
name: Launch
1645+
command: |
1646+
yarn launch:test
1647+
working_directory: npm/cypress-schematic
1648+
- run:
1649+
name: Run unit tests
1650+
command: |
1651+
yarn test
1652+
working_directory: npm/cypress-schematic
1653+
- store-npm-logs
16521654

16531655
npm-release:
16541656
<<: *defaults
@@ -1675,7 +1677,7 @@ jobs:
16751677
- run:
16761678
name: Check current branch to persist artifacts
16771679
command: |
1678-
if [[ "$CIRCLE_BRANCH" != "develop" && "$CIRCLE_BRANCH" != "marktnoonan/backmerge-develop-3-8-22" && "$CIRCLE_BRANCH" != "10.0-release" ]]; then
1680+
if [[ "$CIRCLE_BRANCH" != "develop" && "$CIRCLE_BRANCH" != "10.0-use-contexts" && "$CIRCLE_BRANCH" != "10.0-release" ]]; then
16791681
echo "Not uploading artifacts or posting install comment for this branch."
16801682
circleci-agent step halt
16811683
fi
@@ -2148,6 +2150,7 @@ linux-workflow: &linux-workflow
21482150
- build
21492151
# unit, integration and e2e tests
21502152
- cli-visual-tests:
2153+
context: test-runner:percy
21512154
requires:
21522155
- build
21532156
- unit-tests:
@@ -2188,46 +2191,52 @@ linux-workflow: &linux-workflow
21882191
requires:
21892192
- system-tests-node-modules-install
21902193
- driver-integration-tests-chrome:
2194+
context: test-runner:cypress-record-key
21912195
requires:
21922196
- build
21932197
- driver-integration-tests-chrome-beta:
2198+
context: test-runner:cypress-record-key
21942199
requires:
21952200
- build
21962201
- driver-integration-tests-firefox:
2202+
context: test-runner:cypress-record-key
21972203
requires:
21982204
- build
21992205
- driver-integration-tests-electron:
2206+
context: test-runner:cypress-record-key
22002207
requires:
22012208
- build
22022209
- run-frontend-shared-component-tests-chrome:
2203-
context: test-runner:launchpad-tests
2210+
context: [test-runner:launchpad-tests, test-runner:percy]
22042211
percy: true
22052212
requires:
22062213
- build
22072214
- run-launchpad-integration-tests-chrome:
2208-
context: test-runner:launchpad-tests
2215+
context: [test-runner:launchpad-tests, test-runner:percy]
22092216
percy: true
22102217
requires:
22112218
- build
22122219
- run-launchpad-component-tests-chrome:
2213-
context: test-runner:launchpad-tests
2220+
context: [test-runner:launchpad-tests, test-runner:percy]
22142221
percy: true
22152222
requires:
22162223
- build
22172224
- run-app-integration-tests-chrome:
2218-
context: test-runner:launchpad-tests
2225+
context: [test-runner:launchpad-tests, test-runner:percy]
22192226
percy: true
22202227
requires:
22212228
- build
22222229
- run-app-component-tests-chrome:
2223-
context: test-runner:launchpad-tests
2230+
context: [test-runner:launchpad-tests, test-runner:percy]
22242231
percy: true
22252232
requires:
22262233
- build
22272234
- reporter-integration-tests:
2235+
context: [test-runner:cypress-record-key, test-runner:percy]
22282236
requires:
22292237
- build
22302238
- ui-components-integration-tests:
2239+
context: test-runner:cypress-record-key
22312240
requires:
22322241
- build
22332242
- npm-webpack-dev-server:
@@ -2243,6 +2252,7 @@ linux-workflow: &linux-workflow
22432252
requires:
22442253
- build
22452254
- npm-design-system:
2255+
context: test-runner:percy
22462256
requires:
22472257
- build
22482258
- npm-vue:

packages/app/src/runner/SpecRunnerHeaderOpenMode.vue

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -171,26 +171,6 @@ fragment SpecRunnerHeader_Browser on Browser {
171171
}
172172
`
173173
174-
gql`
175-
mutation SpecRunnerHeader_SetBrowser($browserId: ID!, $specPath: String!) {
176-
launchpadSetBrowser(id: $browserId) {
177-
id
178-
currentBrowser {
179-
id
180-
displayName
181-
majorVersion
182-
}
183-
browsers {
184-
id
185-
isSelected
186-
}
187-
}
188-
launchOpenProject(specPath: $specPath) {
189-
id
190-
}
191-
}
192-
`
193-
194174
const { t } = useI18n()
195175
196176
const autStore = useAutStore()

packages/data-context/src/actions/DataEmitterActions.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ abstract class DataEmitterEvents {
2828
this._emit('cloudViewerChange')
2929
}
3030

31+
/**
32+
* Emitted when the browserStatus field has changed due to the browser
33+
* having opened or closed.
34+
*/
3135
browserStatusChange () {
3236
this._emit('browserStatusChange')
3337
}

packages/data-context/test/unit/sources/GitDataSource.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,19 +46,19 @@ describe('GitDataSource', () => {
4646
ctx.git.gitInfo(xhrSpec),
4747
])
4848

49-
expect(created.lastModifiedHumanReadable).to.match(/(a few|[0-9]) second?s ago/)
49+
expect(created.lastModifiedHumanReadable).to.match(/(a few|[0-9]) seconds? ago/)
5050
expect(created.statusType).to.eql('created')
5151
// do not want to set this explicitly in the test, since it can mess up your local git instance
5252
expect(created.author).not.to.be.undefined
5353
expect(created.lastModifiedTimestamp).not.to.be.undefined
5454

55-
expect(unmodified.lastModifiedHumanReadable).to.match(/(a few|[0-9]) second?s ago/)
55+
expect(unmodified.lastModifiedHumanReadable).to.match(/(a few|[0-9]) seconds? ago/)
5656
expect(unmodified.statusType).to.eql('unmodified')
5757
// do not want to set this explicitly in the test, since it can mess up your local git instance
5858
expect(unmodified.author).not.to.be.undefined
5959
expect(unmodified.lastModifiedTimestamp).not.to.be.undefined
6060

61-
expect(modified.lastModifiedHumanReadable).to.match(/(a few|[0-9]) second?s ago/)
61+
expect(modified.lastModifiedHumanReadable).to.match(/(a few|[0-9]) seconds? ago/)
6262
expect(modified.statusType).to.eql('modified')
6363
// do not want to set this explicitly in the test, since it can mess up your local git instance
6464
expect(modified.author).not.to.be.undefined

packages/driver/cypress/e2e/commands/querying/root.cy.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,16 @@ describe('src/cy/commands/querying', () => {
3535
cy.root().should('have.class', 'foo').and('have.class', 'bar')
3636
})
3737

38+
// https://github.com/cypress-io/cypress/issues/19985
39+
it('respects timeout option', (done) => {
40+
cy.on('fail', (err) => {
41+
expect(err.message).to.not.contain('4000ms')
42+
done()
43+
})
44+
45+
cy.root({ timeout: 50 }).should('contain', 'root world')
46+
})
47+
3848
describe('.log', () => {
3949
beforeEach(function () {
4050
this.logs = []

packages/driver/src/cy/commands/querying/root.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,10 @@ export default (Commands, Cypress, cy, state) => {
2929
return log(withinSubject)
3030
}
3131

32-
return cy.now('get', 'html', { log: false }).then(log)
32+
return cy.now('get', 'html', {
33+
log: false,
34+
timeout: options.timeout,
35+
}).then(log)
3336
},
3437
})
3538
}

packages/launchpad/cypress/e2e/choose-a-browser.cy.ts

Lines changed: 36 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import type { FoundBrowser } from '@packages/types/src'
2+
13
describe('Choose a Browser Page', () => {
24
beforeEach(() => {
35
cy.scaffoldProject('launchpad')
@@ -174,8 +176,8 @@ describe('Choose a Browser Page', () => {
174176

175177
cy.get('h1').should('contain', 'Choose a Browser')
176178

177-
cy.withCtx((ctx) => {
178-
ctx.actions.project.launchProject = sinon.spy()
179+
cy.withCtx((ctx, o) => {
180+
ctx.actions.project.launchProject = o.sinon.spy()
179181
})
180182

181183
cy.intercept('mutation-OpenBrowser_LaunchProject', cy.stub().as('launchProject'))
@@ -217,8 +219,8 @@ describe('Choose a Browser Page', () => {
217219

218220
cy.intercept('mutation-OpenBrowser_FocusActiveBrowserWindow').as('focusBrowser')
219221

220-
cy.withCtx((ctx) => {
221-
sinon.spy(ctx.actions.browser, 'focusActiveBrowserWindow')
222+
cy.withCtx((ctx, o) => {
223+
o.sinon.spy(ctx.actions.browser, 'focusActiveBrowserWindow')
222224
})
223225

224226
cy.get('@focusButton').click()
@@ -238,9 +240,9 @@ describe('Choose a Browser Page', () => {
238240
})
239241

240242
cy.openProject('launchpad', ['--e2e'])
241-
cy.withCtx((ctx) => {
243+
cy.withCtx((ctx, o) => {
242244
ctx.project.setRelaunchBrowser(true)
243-
ctx.actions.project.launchProject = sinon.stub()
245+
ctx.actions.project.launchProject = o.sinon.stub()
244246
})
245247

246248
cy.visitLaunchpad()
@@ -251,6 +253,34 @@ describe('Choose a Browser Page', () => {
251253
expect(ctx.actions.project.launchProject).to.have.been.called
252254
})
253255
})
256+
257+
it('subscribes to changes to browserStatus/currentBrowser through the browserStatusUpdated subscription', () => {
258+
cy.openProject('launchpad', ['--e2e'])
259+
260+
cy.visitLaunchpad()
261+
262+
cy.get('h1').should('contain', 'Choose a Browser')
263+
264+
cy.findByRole('radio', { name: 'Chrome v1', checked: true }).as('chromeItem')
265+
266+
cy.contains('button', 'Start E2E Testing in Chrome').should('be.visible').click()
267+
268+
cy.withCtx((ctx) => {
269+
ctx.browser.setBrowserStatus('open')
270+
})
271+
272+
cy.contains('button', 'Running Chrome')
273+
274+
// Updating active browser in conjunction with the browser status to ensure that changes to
275+
// both are reflected in the UI.
276+
cy.withCtx((ctx) => {
277+
ctx.actions.app.setActiveBrowser(ctx.lifecycleManager.browsers!.find((browser) => browser.name === 'firefox') as FoundBrowser)
278+
ctx.browser.setBrowserStatus('closed')
279+
})
280+
281+
cy.contains('button', 'Start E2E Testing in Firefox').should('be.visible')
282+
cy.findByRole('radio', { name: 'Firefox v5', checked: true }).should('be.visible')
283+
})
254284
})
255285

256286
describe('No System Browsers Detected', () => {

0 commit comments

Comments
 (0)