Skip to content

Commit

Permalink
Merge branch 'develop' into renovate/parse-domain-2.x
Browse files Browse the repository at this point in the history
  • Loading branch information
jennifer-shehane committed Feb 12, 2019
2 parents 288d07a + 13ebb97 commit 087a1dd
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 10 deletions.
8 changes: 4 additions & 4 deletions packages/driver/src/cy/commands/traversals.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ traversals = "find filter not children eq closest first last next nextAll nextUn
module.exports = (Commands, Cypress, cy, state, config) ->
_.each traversals, (traversal) ->
Commands.add traversal, { prevSubject: "element" }, (subject, arg1, arg2, options) ->
if _.isObject(arg2)
options = arg2

if _.isObject(arg1)
if _.isObject(arg1) and not _.isFunction(arg1)
options = arg1

if _.isObject(arg2) and not _.isFunction(arg2)
options = arg2

options ?= {}

_.defaults options, {log: true}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ describe "src/cy/commands/traversals", ->
fns = [
{find: "*"}
{filter: ":first"}
{filter: (i) -> i == 0}
{not: "div"}
{not: (i, e) -> e.tagName == 'div'}
{eq: 0}
{closest: "body"}
"children", "first", "last", "next", "nextAll", "nextUntil", "parent", "parents", "parentsUntil", "prev", "prevAll", "prevUntil", "siblings"
Expand Down Expand Up @@ -137,15 +139,22 @@ describe "src/cy/commands/traversals", ->

it "has a custom message", ->
cy.get("#list")[name](arg).then ->
arg = if _.isUndefined(arg) then "" else arg.toString()
if _.isUndefined(arg) or _.isFunction(arg)
message = ""
else
message = arg.toString()

lastLog = @lastLog

expect(lastLog.get("message")).to.eq arg
expect(lastLog.get("message")).to.eq message

it "#consoleProps", ->
cy.get("#list")[name](arg).then ($el) ->
obj = {Command: name}
obj.Selector = [].concat(arg).join(", ") unless _.isFunction(arg)
if _.isFunction(arg)
obj.Selector = ""
else
obj.Selector = [].concat(arg).join(", ")

yielded = Cypress.dom.getElements($el)

Expand All @@ -157,6 +166,12 @@ describe "src/cy/commands/traversals", ->

expect(@lastLog.invoke("consoleProps")).to.deep.eq obj

it "can be turned off", ->
cy.get("#list")[name](arg, {log: false}).then ->
lastLog = @lastLog

expect(lastLog.get("name")).to.eq "get"

it "eventually resolves", ->
cy.on "command:retry", _.after 2, ->
cy.$$("button:first").text("foo").addClass("bar")
Expand Down
1 change: 0 additions & 1 deletion packages/server/lib/socket.coffee
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
_ = require("lodash")
path = require("path")
uuid = require("node-uuid")
debug = require('debug')('cypress:server:socket')
Promise = require("bluebird")
socketIo = require("@packages/socket")
Expand Down
1 change: 0 additions & 1 deletion packages/server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,6 @@
"moment": "2.24.0",
"morgan": "1.9.1",
"node-machine-id": "1.1.10",
"node-uuid": "1.4.1",
"node-webkit-updater": "cypress-io/node-webkit-updater#e74623726f381487f543e373e71515177a32daeb",
"opn": "cypress-io/opn#2f4e9a216ca7bdb95dfae9d46d99ddf004b3cbb5",
"ospath": "1.2.2",
Expand Down
1 change: 0 additions & 1 deletion packages/server/test/unit/socket_spec.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ require("../spec_helper")
_ = require("lodash")
os = require("os")
path = require("path")
uuid = require("node-uuid")
Promise = require("bluebird")
socketIo = require("@packages/socket")
extension = require("@packages/extension")
Expand Down

0 comments on commit 087a1dd

Please sign in to comment.