Skip to content

Commit 6c4370d

Browse files
committed
Merge branch 'tgriesser/10.0-release/refactor-lifecycle' into feat/alert-with-stack
* tgriesser/10.0-release/refactor-lifecycle: (50 commits) Remove unused test file update task spec to use correct projectRoot update Fix test Fix test Fix tests update tests fix test correct config path Fix TS resolve conflicts Fixing component & e2e tests build: fix dev process on windows (#19401) fix: `cy.contains()` ignores `<style>` and `<script>` without removing them. (#19424) Fix some tests chore: Fix the broken codeowners automation (#19431) chore: add types for Cypress.session.clearAllSavedSessions (#19412) fix: No unnecessary snapshotting (#19311) chore: Remove pkg/driver @ts-nocheck part 1 (#19353) fix: add CYPRESS_VERIFY_TIMEOUT param and a test for it (#19282) ...
2 parents a1ed603 + 9866644 commit 6c4370d

File tree

109 files changed

+1913
-1060
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

109 files changed

+1913
-1060
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@
2626
/packages/ts/ @cypress-io/test-runner
2727
/packages/ui-components/ @cypress-io/test-runner
2828
/packages/web-config/ @cypress-io/test-runner
29-
/scripts/ @cypress-io/test-runner
29+
/scripts/ @cypress-io/test-runner

browser-versions.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"chrome:beta": "96.0.4664.45",
3-
"chrome:stable": "96.0.4664.45"
2+
"chrome:beta": "97.0.4692.56",
3+
"chrome:stable": "96.0.4664.110"
44
}

circle.yml

Lines changed: 28 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ mainBuildFilters: &mainBuildFilters
2929
only:
3030
- develop
3131
- 10.0-release
32+
- test-binary-downstream-windows
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: [ renovate/cypress-request-2.x, << 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: [ test-binary-downstream-windows, << pipeline.git.branch >> ]
5053
- matches:
5154
pattern: "-release$"
5255
value: << pipeline.git.branch >>
@@ -1665,7 +1668,7 @@ jobs:
16651668
- run:
16661669
name: Check current branch to persist artifacts
16671670
command: |
1668-
if [[ "$CIRCLE_BRANCH" != "develop" && "$CIRCLE_BRANCH" != "10.0-release" && "$CIRCLE_BRANCH" != "renovate/cypress-request-2.x" && "$CIRCLE_BRANCH" != "tgriesser/fix/patch-resolutions" ]]; then
1671+
if [[ "$CIRCLE_BRANCH" != "develop" && "$CIRCLE_BRANCH" != "test-binary-downstream-windows" && "$CIRCLE_BRANCH" != "10.0-release" && "$CIRCLE_BRANCH" != "renovate/cypress-request-2.x" && "$CIRCLE_BRANCH" != "tgriesser/fix/patch-resolutions" ]]; then
16691672
echo "Not uploading artifacts or posting install comment for this branch."
16701673
circleci-agent step halt
16711674
fi
@@ -1750,7 +1753,12 @@ jobs:
17501753

17511754
test-binary-and-npm-against-other-projects:
17521755
<<: *defaults
1753-
resource_class: medium
1756+
parameters:
1757+
<<: *defaultsParameters
1758+
resource_class:
1759+
type: string
1760+
default: medium
1761+
resource_class: << parameters.resource_class >>
17541762
steps:
17551763
# needs uploaded NPM and test binary
17561764
- restore_cached_workspace
@@ -1759,23 +1767,14 @@ jobs:
17591767
- run: ls -la binary-url.json npm-package-url.json
17601768
- run: cat binary-url.json
17611769
- run: cat npm-package-url.json
1762-
- run: mkdir /tmp/testing
1763-
- run:
1764-
name: create dummy package
1765-
working_directory: /tmp/testing
1766-
command: npm init -y
17671770
- run:
17681771
# install NPM from unique urls
1769-
name: Install Cypress
1772+
name: Install Cypress Binary in Dummy Package
17701773
command: |
17711774
node scripts/test-unique-npm-and-binary.js \
17721775
--npm npm-package-url.json \
17731776
--binary binary-url.json \
17741777
--cwd /tmp/testing
1775-
- run:
1776-
name: Verify Cypress binary
1777-
working_directory: /tmp/testing
1778-
command: $(yarn bin)/cypress verify
17791778
- run:
17801779
name: Running other test projects with new NPM package and binary
17811780
command: |
@@ -1806,19 +1805,19 @@ jobs:
18061805
- run:
18071806
name: Cypress version
18081807
working_directory: test-binary
1809-
command: $(yarn bin)/cypress version
1808+
command: $(yarn bin cypress) version
18101809
- run:
18111810
name: Verify Cypress binary
18121811
working_directory: test-binary
1813-
command: $(yarn bin)/cypress verify
1812+
command: $(yarn bin cypress) verify
18141813
- run:
18151814
name: Cypress help
18161815
working_directory: test-binary
1817-
command: $(yarn bin)/cypress help
1816+
command: $(yarn bin cypress) help
18181817
- run:
18191818
name: Cypress info
18201819
working_directory: test-binary
1821-
command: $(yarn bin)/cypress info
1820+
command: $(yarn bin cypress) info
18221821
- store-npm-logs
18231822

18241823
test-npm-module-on-minimum-node-version:
@@ -1999,7 +1998,7 @@ jobs:
19991998
CYPRESS_PROJECT_ID=$TEST_TINY_PROJECT_ID \
20001999
CYPRESS_RECORD_KEY=$TEST_TINY_RECORD_KEY \
20012000
CYPRESS_INTERNAL_ENV=staging \
2002-
$(yarn bin)/cypress run --record
2001+
$(yarn bin cypress) run --record
20032002
- store-npm-logs
20042003

20052004
test-binary-against-recipes-firefox:
@@ -2145,11 +2144,11 @@ jobs:
21452144
- run:
21462145
name: Cypress help
21472146
working_directory: test-binary
2148-
command: $(yarn bin)/cypress help
2147+
command: $(yarn bin cypress) help
21492148
- run:
21502149
name: Cypress info
21512150
working_directory: test-binary
2152-
command: $(yarn bin)/cypress info
2151+
command: $(yarn bin cypress) info
21532152
- run:
21542153
name: Add Cypress demo
21552154
working_directory: test-binary
@@ -2165,11 +2164,11 @@ jobs:
21652164
- run:
21662165
name: Verify Cypress binary
21672166
working_directory: test-binary
2168-
command: DEBUG=cypress:cli $(yarn bin)/cypress verify
2167+
command: DEBUG=cypress:cli $(yarn bin cypress) verify
21692168
- run:
21702169
name: Run Cypress binary
21712170
working_directory: test-binary
2172-
command: DEBUG=cypress:cli $(yarn bin)/cypress run
2171+
command: DEBUG=cypress:cli $(yarn bin cypress) run
21732172
- store-npm-logs
21742173

21752174
linux-workflow: &linux-workflow
@@ -2584,6 +2583,14 @@ windows-workflow: &windows-workflow
25842583
requires:
25852584
- windows-build
25862585

2586+
- test-binary-and-npm-against-other-projects:
2587+
context: test-runner:trigger-test-jobs
2588+
name: windows-test-binary-and-npm-against-other-projects
2589+
executor: windows
2590+
resource_class: windows.medium
2591+
requires:
2592+
- windows-create-build-artifacts
2593+
25872594
workflows:
25882595
linux:
25892596
<<: *linux-workflow

cli/lib/tasks/verify.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const logger = require('../logger')
1515
const xvfb = require('../exec/xvfb')
1616
const state = require('./state')
1717

18-
const VERIFY_TEST_RUNNER_TIMEOUT_MS = 30000
18+
const VERIFY_TEST_RUNNER_TIMEOUT_MS = process.env.CYPRESS_VERIFY_TIMEOUT || 30000
1919

2020
const checkExecutable = (binaryDir) => {
2121
const executable = state.getPathToExecutable(binaryDir)

cli/test/lib/tasks/verify_spec.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,14 @@ context('lib/tasks/verify', () => {
7272
expect(verify.VERIFY_TEST_RUNNER_TIMEOUT_MS).to.be.gt(10000)
7373
})
7474

75+
it('accepts custom verify task timeout', () => {
76+
process.env.CYPRESS_VERIFY_TIMEOUT = '500000'
77+
delete require.cache[require.resolve(`${lib}/tasks/verify`)]
78+
const newVerifyInstance = require(`${lib}/tasks/verify`)
79+
80+
expect(newVerifyInstance.VERIFY_TEST_RUNNER_TIMEOUT_MS).to.be.gte(500000)
81+
})
82+
7583
it('logs error and exits when no version of Cypress is installed', () => {
7684
return verify
7785
.start()

cli/types/cypress.d.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,11 @@ declare namespace Cypress {
319319
*/
320320
LocalStorage: LocalStorage
321321

322+
/**
323+
* Internal class for session management.
324+
*/
325+
session: Session
326+
322327
/**
323328
* Current testing type, determined by the Test Runner chosen to run.
324329
*/
@@ -3136,6 +3141,11 @@ declare namespace Cypress {
31363141
onAnyAbort(route: RouteOptions, proxy: any): void
31373142
}
31383143

3144+
interface Session {
3145+
// Clear all saved sessions and re-run the current spec file.
3146+
clearAllSavedSessions: () => Promise<void>
3147+
}
3148+
31393149
type SameSiteStatus = 'no_restriction' | 'strict' | 'lax'
31403150

31413151
interface SetCookieOptions extends Loggable, Timeoutable {

npm/vite-dev-server/src/makeCypressPlugin.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { resolve, posix, sep } from 'path'
1+
import { resolve, sep } from 'path'
22
import { readFile } from 'fs'
33
import { promisify } from 'util'
44
import Debug from 'debug'

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"binary-release": "node ./scripts/binary.js release",
1313
"binary-upload": "node ./scripts/binary.js upload",
1414
"binary-zip": "node ./scripts/binary.js zip",
15-
"build": "lerna run build --stream --no-bail --ignore create-cypress-tests && lerna run build --stream --scope create-cypress-tests",
15+
"build": "lerna run build --stream --no-bail --ignore create-cypress-tests --ignore \"'@packages/{runner}'\" && lerna run build --stream --scope create-cypress-tests",
1616
"build-prod": "lerna run build-prod-ui --stream && lerna run build-prod --stream --ignore create-cypress-tests && lerna run build-prod --stream --scope create-cypress-tests",
1717
"bump": "node ./scripts/binary.js bump",
1818
"check-node-version": "node scripts/check-node-version.js",
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
describe('App: Spec List', () => {
2+
beforeEach(() => {
3+
cy.scaffoldProject('component-tests')
4+
cy.openProject('component-tests')
5+
cy.startAppServer('component')
6+
cy.visitApp()
7+
})
8+
9+
it('highlights the currently running spec', () => {
10+
cy.contains('fails').click()
11+
12+
cy.get('[data-selected-spec="true"]').should('contain', 'fails')
13+
cy.get('[data-selected-spec="false"]').should('contain', 'foo')
14+
})
15+
})

packages/app/src/runner/SnapshotControls.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
2-
<div class="absolute inset-x-0 bottom-24">
3-
<div class="h-11 flex justify-center">
2+
<div class="inset-x-0 bottom-24 absolute">
3+
<div class="flex justify-center children:h-11">
44
<SnapshotMessage
55
v-if="snapshotStore.messageTitle"
66
:message-title="snapshotStore.messageTitle"

packages/app/src/runner/SpecRunner.vue

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -323,15 +323,23 @@ $navbar-width: 80px;
323323

324324
<style>
325325
#unified-runner > div {
326-
height: min(100%, 100vh);
326+
height: 100%
327327
}
328328
329-
iframe {
329+
iframe.aut-iframe {
330330
width: 100%;
331331
height: 100%;
332332
background: white;
333333
}
334334
335+
iframe.spec-iframe {
336+
border: none;
337+
height: 0;
338+
position: absolute;
339+
visibility: hidden;
340+
width: 0;
341+
}
342+
335343
.highlight {
336344
background: rgba(159, 196, 231, 0.6);
337345
border: solid 2px #9FC4E7;

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

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -339,12 +339,8 @@ export class EventManager {
339339
Cypress = this.Cypress = this.$CypressDriver.create(config)
340340

341341
// expose Cypress globally
342-
// since CT AUT shares the window with the spec, we don't want to overwrite
343-
// our spec Cypress instance with the component's Cypress instance
344-
if (window.top === window) {
345-
// @ts-ignore
346-
window.Cypress = Cypress
347-
}
342+
// @ts-ignore
343+
window.Cypress = Cypress
348344

349345
this._addListeners()
350346

packages/app/src/runs/RunsContainer.vue

Lines changed: 23 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,22 @@
33
v-if="!currentProject?.projectId || !cloudViewer?.id"
44
:gql="props.gql"
55
/>
6-
<RunsEmpty
7-
v-else-if="!currentProject?.cloudProject?.runs?.nodes.length"
8-
:gql="currentProject"
9-
/>
10-
<div
11-
v-else
12-
data-cy="runs"
13-
>
14-
<RunCard
15-
v-for="run of currentProject?.cloudProject?.runs?.nodes"
16-
:key="run.id"
17-
:gql="run"
6+
<template v-else-if="currentProject?.cloudProject?.__typename === 'CloudProject'">
7+
<RunsEmpty
8+
v-if="!currentProject?.cloudProject?.runs?.nodes.length"
9+
:gql="currentProject"
1810
/>
19-
</div>
11+
<div
12+
v-else
13+
data-cy="runs"
14+
>
15+
<RunCard
16+
v-for="run of currentProject?.cloudProject?.runs?.nodes"
17+
:key="run.id"
18+
:gql="run"
19+
/>
20+
</div>
21+
</template>
2022
</template>
2123

2224
<script lang="ts" setup>
@@ -33,11 +35,14 @@ fragment RunsContainer on Query {
3335
id
3436
...RunsEmpty
3537
cloudProject {
36-
id
37-
runs(first: 10) {
38-
nodes {
39-
id
40-
...RunCard
38+
__typename
39+
... on CloudProject {
40+
id
41+
runs(first: 10) {
42+
nodes {
43+
id
44+
...RunCard
45+
}
4146
}
4247
}
4348
}
@@ -56,15 +61,6 @@ const currentProject = computed(() => props.gql.currentProject)
5661
const cloudViewer = computed(() => props.gql.cloudViewer)
5762
</script>
5863

59-
<route>
60-
{
61-
name: "Runs",
62-
meta: {
63-
title: "Runs"
64-
}
65-
}
66-
</route>
67-
6864
<style scoped>
6965
.fade-enter-active, .fade-leave-active {
7066
transition: opacity .3s

0 commit comments

Comments
 (0)