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

spy commands not displaying in command log when multiple tests w/ spies are run #37

Closed
jennifer-shehane opened this issue May 13, 2015 · 1 comment

Comments

@jennifer-shehane
Copy link
Member

I have a few tests back to back that all use the spy command. The first test displays all of the spies in the command log, but the subsequent tests do not display the spies in the command log.

Example Code

describe "triggerMethod", ->
  before ->
    @agents = cy.agents()

    ## removed code for brevity

    @trigger = @agents.spy(@view, "trigger")

  it "triggers methods on show", ->
    App.mainRegion.show(@view)
    events = _(@trigger.getCalls()).map (call) -> call.args[0]
    expect(events).to.deep.eq(
      ["onBeforeRender", "before:render", "onRender", "render", "onBeforeShow", "before:show", "onBeforeAttach", "before:attach", "onAttach", "attach", "onShow", "show", "onDomRefresh", "dom:refresh"]
    )

  it "triggers methods on render", ->
    @view.render()
    events = _(@trigger.getCalls()).map (call) -> call.args[0]
    expect(events).to.deep.eq(
      ["onBeforeRender", "before:render", "onRender", "render"]
    )

  it "triggers methods on destroy", ->
    @view.destroy()
    events = _(@trigger.getCalls()).map (call) -> call.args[0]
    expect(events).to.deep.eq(
      ["onBeforeDestroy", "before:destroy", "onDestroy", "destroy"]
    )

screen shot 2015-05-13 at 12 36 47 pm

@brian-mann
Copy link
Member

brian-mann commented May 15, 2015

This is fixed in 0.6.1.

@cypress-io cypress-io locked as resolved and limited conversation to collaborators Dec 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants