Skip to content

Commit

Permalink
Changed queued fixture command to cy.now + removed unnecessary isRout…
Browse files Browse the repository at this point in the history
…e check (#7983)
  • Loading branch information
Przemek Suchodolski committed Jul 27, 2020
1 parent b2fd528 commit a3ca026
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 1 addition & 3 deletions packages/driver/src/cy/commands/waiting.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,7 @@ module.exports = (Commands, Cypress, cy, state) => {
log.set('referencesAlias', aliases)
}

const isRouteCommand = () => command.get('name') === 'route' || command.get('subject').xhrUrl

if (!isRouteCommand()) {
if (command.get('name') !== 'route') {
$errUtils.throwErrByPath('wait.invalid_alias', {
onFail: options._log,
args: { alias },
Expand Down
4 changes: 3 additions & 1 deletion packages/driver/src/cy/commands/xhr.js
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,9 @@ module.exports = (Commands, Cypress, cy, state, config) => {
const fixturesRe = /^(fx:|fixture:)/

if (hasResponse && fixturesRe.test(options.response)) {
return cy.fixture(options.response.replace(fixturesRe, '')).then(() => route())
const fixtureName = options.response.replace(fixturesRe, '')

return cy.now('fixture', fixtureName).then(() => route())
}

return route()
Expand Down

0 comments on commit a3ca026

Please sign in to comment.