Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix rerun before/after hooks on navigation [remerge] #7154

Merged
merged 38 commits into from
May 28, 2020
Merged
Show file tree
Hide file tree
Changes from 35 commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
2dd7b41
try 2: fix rerun before/after hooks
kuceb Apr 27, 2020
85503d3
change logic to rerun before hooks after top navigation
kuceb Apr 30, 2020
46c116d
fix windowSize for browser e2e test
kuceb May 4, 2020
590a573
fix windowSize for xvfb chrome in e2e test
kuceb May 4, 2020
22d2780
ok fine, just disable screenshots
kuceb May 4, 2020
6d1451d
Merge remote-tracking branch 'origin/develop' into 2-fix-rerun-hooks-…
kuceb May 7, 2020
ec77ac3
perf: faster lookup for hooks without runnables
kuceb May 7, 2020
751e752
Merge remote-tracking branch 'origin/develop' into 2-fix-rerun-hooks-…
kuceb May 8, 2020
6790888
fix afterAll hook switch logic
kuceb May 8, 2020
2f06046
backport to before/after fix
kuceb May 20, 2020
75bf3bf
Merge remote-tracking branch 'origin/develop' into 2-fix-rerun-hooks-…
kuceb May 20, 2020
d230c17
backport to before/after fix 2
kuceb May 20, 2020
f2977b7
fix noExit passed to e2e test inline options
kuceb May 22, 2020
836fc0a
Merge remote-tracking branch 'origin/develop' into 2-fix-rerun-hooks-…
kuceb May 22, 2020
d15fc1f
remove extra root afterhook check
kuceb May 22, 2020
ba5c388
add issue link..twice
kuceb May 22, 2020
9061197
cleanup function to arrows
kuceb May 22, 2020
bc27e9c
remove Cypress object proxying related code for certain utils
kuceb May 26, 2020
e653294
use getTest() as we did previously
kuceb May 26, 2020
b5fc7a0
remove Cypress object proxying related code for certain utils
kuceb May 26, 2020
512ccd0
fix Cypress._RESUMED_AT_TEST access
kuceb May 26, 2020
2802664
fix Cypress._RESUMED_AT_TEST access 2
kuceb May 26, 2020
fd3e7b1
fix runner.getResumedAtTestIndex, state accesses
kuceb May 26, 2020
2538d7b
Merge remote-tracking branch 'origin/develop' into 2-fix-rerun-hooks-…
kuceb May 26, 2020
ffc1c3d
fix firefoxgcinterval access
kuceb May 26, 2020
dd41468
fix arrow function
kuceb May 26, 2020
e5a1040
fix firefoxgcinterval access
kuceb May 26, 2020
7070f4f
try a simpler way to fix afterAll hook issue
kuceb May 26, 2020
f2d4663
Merge remote-tracking branch 'origin/develop' into 2-fix-rerun-hooks-…
kuceb May 27, 2020
e8eeabf
Merge remote-tracking branch 'origin/develop' into chore-remove-obj-p…
kuceb May 27, 2020
e3ad51a
fix decaf after merge
kuceb May 27, 2020
a2c39f6
cleanup internal-types.d.ts
kuceb May 27, 2020
929fa48
Merge branch 'chore-remove-obj-proxying-logic' into 2-fix-rerun-hooks…
kuceb May 27, 2020
366578e
fix internal-types
kuceb May 27, 2020
9643cb1
Merge branch 'chore-remove-obj-proxying-logic' into 2-fix-rerun-hooks…
kuceb May 27, 2020
f239874
Merge remote-tracking branch 'origin/develop' into 2-fix-rerun-hooks-…
kuceb May 27, 2020
02f12f7
fix comment, getTestFromRunnable signature
kuceb May 27, 2020
ea8142c
remove unneeded lastTestInSuiteLogic
kuceb May 27, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions packages/driver/src/cy/commands/navigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -917,14 +917,14 @@ module.exports = (Commands, Cypress, cy, state, config) => {
// state for like scrollTop
let s = {
currentId: id,
tests: Cypress.getTestsState(),
startTime: Cypress.getStartTime(),
emissions: Cypress.getEmissions(),
tests: Cypress.runner.getTestsState(),
startTime: Cypress.runner.getStartTime(),
emissions: Cypress.runner.getEmissions(),
}

s.passed = Cypress.countByTestState(s.tests, 'passed')
s.failed = Cypress.countByTestState(s.tests, 'failed')
s.pending = Cypress.countByTestState(s.tests, 'pending')
s.passed = Cypress.runner.countByTestState(s.tests, 'passed')
s.failed = Cypress.runner.countByTestState(s.tests, 'failed')
s.pending = Cypress.runner.countByTestState(s.tests, 'pending')
s.numLogs = $Log.countLogsByTests(s.tests)

return Cypress.action('cy:collect:run:state')
Expand Down
20 changes: 1 addition & 19 deletions packages/driver/src/cypress.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,6 @@ const browserInfo = require('./cypress/browser')
const resolvers = require('./cypress/resolvers')
const debug = require('debug')('cypress:driver:cypress')

const proxies = {
runner: 'getStartTime getTestsState getEmissions setNumLogs countByTestState getDisplayPropsForLog getConsolePropsForLogById getSnapshotPropsForLogById getErrorByTestId setStartTime resumeAtTest normalizeAll'.split(' '),
cy: 'detachDom getStyles'.split(' '),
}

const jqueryProxyFn = function (...args) {
if (!this.cy) {
$errUtils.throwErrByPath('miscellaneous.no_cy')
Expand Down Expand Up @@ -91,7 +86,6 @@ class $Cypress {
this.mocha = null
this.runner = null
this.Commands = null
this._RESUMED_AT_TEST = null
this.$autIframe = null
this.onSpecReady = null

Expand Down Expand Up @@ -243,7 +237,7 @@ class $Cypress {
// mocha runner has begun running the tests
this.emit('run:start')

if (this._RESUMED_AT_TEST) {
if (this.runner.getResumedAtTestIndex() !== null) {
return
}

Expand Down Expand Up @@ -624,18 +618,6 @@ $Cypress.prototype.minimatch = minimatch
$Cypress.prototype.sinon = sinon
$Cypress.prototype.lolex = lolex

// proxy all of the methods in proxies
// to their corresponding objects
_.each(proxies, (methods, key) => {
return _.each(methods, (method) => {
return $Cypress.prototype[method] = function (...args) {
const prop = this[key]

return prop && prop[method].apply(prop, args)
}
})
})

// attaching these so they are accessible
// via the runner + integration spec helper
$Cypress.$ = $
Expand Down
Loading