Skip to content

Commit 1ca0dda

Browse files
authored
Merge branch 'develop' into issues/23552-regression
2 parents e05a30e + 1aa9793 commit 1ca0dda

File tree

9 files changed

+310
-462
lines changed

9 files changed

+310
-462
lines changed

circle.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ macWorkflowFilters: &darwin-workflow-filters
3535
when:
3636
or:
3737
- equal: [ develop, << pipeline.git.branch >> ]
38-
- equal: [ 'tbiethman/22272-globbing-working-dir', << pipeline.git.branch >> ]
38+
- equal: [ 'correct-dashboard-results', << pipeline.git.branch >> ]
3939
- equal: [ 'skip-or-fix-flaky-tests-2', << pipeline.git.branch >> ]
4040
- matches:
4141
pattern: "-release$"
@@ -132,7 +132,7 @@ commands:
132132
- run:
133133
name: Check current branch to persist artifacts
134134
command: |
135-
if [[ "$CIRCLE_BRANCH" != "develop" && "$CIRCLE_BRANCH" != "tbiethman/23380-root-spec-pattern" ]]; then
135+
if [[ "$CIRCLE_BRANCH" != "develop" && "$CIRCLE_BRANCH" != "correct-dashboard-results" ]]; then
136136
echo "Not uploading artifacts or posting install comment for this branch."
137137
circleci-agent step halt
138138
fi

cli/types/cypress.d.ts

+7-7
Original file line numberDiff line numberDiff line change
@@ -2720,6 +2720,13 @@ declare namespace Cypress {
27202720
* @default 60000
27212721
*/
27222722
pageLoadTimeout: number
2723+
/**
2724+
* Whether Cypress will search for and replace
2725+
* obstructive JS code in .js or .html files.
2726+
*
2727+
* @see https://on.cypress.io/configuration#modifyObstructiveCode
2728+
*/
2729+
modifyObstructiveCode: boolean
27232730
/**
27242731
* Time, in milliseconds, to wait for an XHR request to go out in a [cy.wait()](https://on.cypress.io/wait) command
27252732
* @default 5000
@@ -2968,13 +2975,6 @@ declare namespace Cypress {
29682975
* Whether Cypress was launched via 'cypress open' (interactive mode)
29692976
*/
29702977
isInteractive: boolean
2971-
/**
2972-
* Whether Cypress will search for and replace
2973-
* obstructive JS code in .js or .html files.
2974-
*
2975-
* @see https://on.cypress.io/configuration#modifyObstructiveCode
2976-
*/
2977-
modifyObstructiveCode: boolean
29782978
/**
29792979
* The platform Cypress is running on.
29802980
*/

cli/types/tests/cypress-npm-api-test.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// type tests for Cypress NPM module
22
// https://on.cypress.io/module-api
3-
import cypress from 'cypress'
3+
import cypress, { defineConfig } from 'cypress'
44

55
cypress.run // $ExpectType (options?: Partial<CypressRunOptions> | undefined) => Promise<CypressRunResult | CypressFailedRunResult>
66
cypress.open // $ExpectType (options?: Partial<CypressOpenOptions> | undefined) => Promise<void>
@@ -51,6 +51,10 @@ cypress.run().then(results => {
5151
}
5252
})
5353

54+
const config = defineConfig({
55+
modifyObstructiveCode: true
56+
})
57+
5458
// component options
5559
const componentConfigNextWebpack: Cypress.ConfigOptions = {
5660
component: {

packages/launcher/lib/browsers.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ export function launch (
166166
debuggingPort: number,
167167
args: string[] = [],
168168
defaultBrowserEnv = {},
169-
): LaunchedBrowser {
169+
) {
170170
debug('launching browser %o', { browser, url })
171171

172172
if (!browser.path) {

packages/server/lib/browsers/firefox.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -531,12 +531,12 @@ export async function open (browser: Browser, url: string, options: BrowserLaunc
531531

532532
debug('launch in firefox', { url, args: launchOptions.args })
533533

534-
const browserInstance = await launch(browser, 'about:blank', remotePort, launchOptions.args, {
534+
const browserInstance = launch(browser, 'about:blank', remotePort, launchOptions.args, {
535535
// sets headless resolution to 1280x720 by default
536536
// user can overwrite this default with these env vars or --height, --width arguments
537537
MOZ_HEADLESS_WIDTH: '1280',
538538
MOZ_HEADLESS_HEIGHT: '721',
539-
}) as unknown as BrowserInstance
539+
})
540540

541541
try {
542542
browserCriClient = await firefoxUtil.setup({ automation, extensions: launchOptions.extensions, url, foxdriverPort, marionettePort, remotePort, onError: options.onError, options })
@@ -561,7 +561,7 @@ export async function open (browser: Browser, url: string, options: BrowserLaunc
561561

562562
debug('closing firefox')
563563

564-
originalBrowserKill.apply(browserInstance, args)
564+
return originalBrowserKill.apply(browserInstance, args)
565565
}
566566
} catch (err) {
567567
errors.throwErr('FIREFOX_COULD_NOT_CONNECT', err)

packages/server/lib/modes/run.ts

+10-1
Original file line numberDiff line numberDiff line change
@@ -621,6 +621,11 @@ async function waitForTestsToFinishRunning (options: { project: Project, screens
621621

622622
results.shouldUploadVideo = shouldUploadVideo
623623

624+
if (!shouldUploadVideo) {
625+
debug(`Spec run had no failures and config.videoUploadOnPasses=false. Skip processing video. Video path: ${videoName}`)
626+
results.video = null
627+
}
628+
624629
if (!quiet && !skippedSpec) {
625630
printResults.displayResults(results, estimated)
626631
}
@@ -660,10 +665,15 @@ async function waitForTestsToFinishRunning (options: { project: Project, screens
660665
},
661666
})
662667
} catch (err) {
668+
videoCaptureFailed = true
663669
warnVideoRecordingFailed(err)
664670
}
665671
}
666672

673+
if (videoCaptureFailed) {
674+
results.video = null
675+
}
676+
667677
return results
668678
}
669679

@@ -866,7 +876,6 @@ async function runSpec (config, spec: SpecWithRelativeRoot, options: { project:
866876
quiet: options.quiet,
867877
shouldKeepTabOpen: !isLastSpec,
868878
}),
869-
870879
waitForBrowserToConnect({
871880
spec,
872881
project,

packages/server/test/unit/browsers/firefox_spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ describe('lib/browsers/firefox', () => {
145145

146146
sinon.stub(plugins, 'has')
147147
sinon.stub(plugins, 'execute')
148-
sinon.stub(launch, 'launch').resolves(this.browserInstance)
148+
sinon.stub(launch, 'launch').returns(this.browserInstance)
149149
sinon.stub(utils, 'writeExtension').resolves('/path/to/ext')
150150
sinon.spy(FirefoxProfile.prototype, 'setPreference')
151151
sinon.spy(FirefoxProfile.prototype, 'updatePreferences')

0 commit comments

Comments
 (0)