-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7162 from sainthkh/decaff-driver-2
- Loading branch information
Showing
22 changed files
with
3,328 additions
and
2,730 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
const _ = require('lodash') | ||
const Promise = require('bluebird') | ||
|
||
const $errUtils = require('../../cypress/error_utils') | ||
|
||
module.exports = (Commands, Cypress, cy) => { | ||
Commands.addAll({ | ||
url (options = {}) { | ||
const userOptions = options | ||
|
||
options = _.defaults({}, userOptions, { log: true }) | ||
|
||
if (options.log !== false) { | ||
options._log = Cypress.log({ | ||
message: '', | ||
}) | ||
} | ||
|
||
const getHref = () => { | ||
return cy.getRemoteLocation('href') | ||
} | ||
|
||
const resolveHref = () => { | ||
return Promise.try(getHref).then((href) => { | ||
return cy.verifyUpcomingAssertions(href, options, { | ||
onRetry: resolveHref, | ||
}) | ||
}) | ||
} | ||
|
||
return resolveHref() | ||
}, | ||
|
||
hash (options = {}) { | ||
const userOptions = options | ||
|
||
options = _.defaults({}, userOptions, { log: true }) | ||
|
||
if (options.log !== false) { | ||
options._log = Cypress.log({ | ||
message: '', | ||
}) | ||
} | ||
|
||
const getHash = () => { | ||
return cy.getRemoteLocation('hash') | ||
} | ||
|
||
const resolveHash = () => { | ||
return Promise.try(getHash).then((hash) => { | ||
return cy.verifyUpcomingAssertions(hash, options, { | ||
onRetry: resolveHash, | ||
}) | ||
}) | ||
} | ||
|
||
return resolveHash() | ||
}, | ||
|
||
location (key, options) { | ||
let userOptions = options | ||
|
||
// normalize arguments allowing key + options to be undefined | ||
// key can represent the options | ||
if (_.isObject(key) && _.isUndefined(userOptions)) { | ||
userOptions = key | ||
} | ||
|
||
userOptions = userOptions || {} | ||
|
||
options = _.defaults({}, userOptions, { log: true }) | ||
|
||
const getLocation = () => { | ||
const location = cy.getRemoteLocation() | ||
|
||
return _.isString(key) | ||
// use existential here because we only want to throw | ||
// on null or undefined values (and not empty strings) | ||
? location[key] ?? $errUtils.throwErrByPath('location.invalid_key', { args: { key } }) | ||
: location | ||
} | ||
|
||
if (options.log !== false) { | ||
options._log = Cypress.log({ | ||
message: key != null ? key : '', | ||
}) | ||
} | ||
|
||
const resolveLocation = () => { | ||
return Promise.try(getLocation).then((ret) => { | ||
return cy.verifyUpcomingAssertions(ret, options, { | ||
onRetry: resolveLocation, | ||
}) | ||
}) | ||
} | ||
|
||
return resolveLocation() | ||
}, | ||
}) | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
const _ = require('lodash') | ||
|
||
const $dom = require('../../dom') | ||
|
||
module.exports = (Commands, Cypress, cy) => { | ||
Commands.addAll({ prevSubject: 'optional' }, { | ||
end () { | ||
return null | ||
}, | ||
}) | ||
|
||
Commands.addAll({ | ||
noop (arg) { | ||
return arg | ||
}, | ||
|
||
log (msg, args) { | ||
Cypress.log({ | ||
end: true, | ||
snapshot: true, | ||
message: [msg, args], | ||
consoleProps () { | ||
return { | ||
message: msg, | ||
args, | ||
} | ||
}, | ||
}) | ||
|
||
return null | ||
}, | ||
|
||
wrap (arg, options = {}) { | ||
const userOptions = options | ||
|
||
options = _.defaults({}, userOptions, { log: true }) | ||
|
||
if (options.log !== false) { | ||
options._log = Cypress.log({ | ||
message: arg, | ||
}) | ||
|
||
if ($dom.isElement(arg)) { | ||
options._log.set({ $el: arg }) | ||
} | ||
} | ||
|
||
const resolveWrap = () => { | ||
return cy.verifyUpcomingAssertions(arg, options, { | ||
onRetry: resolveWrap, | ||
}) | ||
.return(arg) | ||
} | ||
|
||
return resolveWrap() | ||
}, | ||
}) | ||
} |
Oops, something went wrong.
a904d46
There was a problem hiding this comment.
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.a904d46
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AppVeyor has built the
win32 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.Instructions are included below, depending on the shell you are using.
In Command Prompt (
cmd.exe
):In PowerShell:
In Git Bash:
Using
cross-env
:If the above commands do not work for you, you can also try using
cross-env
: