Skip to content

Commit

Permalink
fix after merge: use most recent attempt for before/after hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
kuceb committed Aug 10, 2020
1 parent cd1119b commit df26592
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions packages/driver/src/cypress/runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -859,13 +859,18 @@ const create = (specWindow, mocha, Cypress, cy) => {

const suite = hook.parent

let foundTest

if (hook.hookName === 'after all') {
return findLastTestInSuite(suite, isNotAlreadyRunTest)
foundTest = findLastTestInSuite(suite, isNotAlreadyRunTest)
} else if (hook.hookName === 'before all') {
foundTest = findTestInSuite(suite, isNotAlreadyRunTest)
}

if (hook.hookName === 'before all') {
return findTestInSuite(suite, isNotAlreadyRunTest)
}
// if test has retried, we getTestById will give us the last attempt
foundTest = foundTest && getTestById(foundTest.id)

return foundTest
}

const onScriptError = (err) => {
Expand Down

1 comment on commit df26592

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on df26592 Aug 10, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the linux x64 version of the Test Runner.

You can install this pre-release platform-specific build using instructions at https://on.cypress.io/installing-cypress#Install-pre-release-version.

You will need to use custom CYPRESS_INSTALL_BINARY url and install Cypress using an url instead of the version.

export CYPRESS_INSTALL_BINARY=https://cdn.cypress.io/beta/binary/5.0.0/linux-x64/circle-test-retries-df265924ae8a42f6503b263bc6df702b42018050-416875/cypress.zip
npm install https://cdn.cypress.io/beta/npm/5.0.0/circle-test-retries-df265924ae8a42f6503b263bc6df702b42018050-416874/cypress.tgz

Please sign in to comment.