@cypress/core-desktop-gui
Version:
Desktop GUI for managing Cypress projects.
99 lines (76 loc) • 2.43 kB
text/coffeescript
describe "Options", ->
beforeEach ->
cy
.visit("/")
.window().then (win) ->
{, } = win
= cy.agents()
.handle("get:options", null, {})
.handle("get:current:user", null, {})
.get(".fa-cog").as("optionsLink")
it "link to options has tooltip attrs", ->
cy
.get("#footer").find(".dropup")
.should("have.attr", "data-original-title")
it "displays options on click", ->
cy
.get("@optionsLink").click()
.get(".dropdown-menu").should("be.visible")
context "click about link", ->
beforeEach ->
= {
position: "center"
width: 300
height: 230
toolbar: false
title: "About"
type: "ABOUT"
}
it "triggers window:open", ->
.spy(, "ipc")
cy.get("@optionsLink").click()
cy.contains("a", "About").click().then ->
expect(.ipc).to.be.calledWith("window:open", )
context "click chat link", ->
it "triggers window:open", ->
.spy(, "ipc")
cy.get("@optionsLink").click()
cy.contains("a", "Chat").click().then ->
expect(.ipc).to.be.calledWith("external:open", "https://gitter.im/cypress-io/cypress")
context "click debug console link", ->
beforeEach ->
= {
height: 400
position: "center"
title: "Debug Console"
toolbar: false
type: "DEBUG"
width: 800
}
it "triggers window:open", ->
.spy(, "ipc")
cy.get("@optionsLink").click()
cy.contains("a", "Debug Console").click().then ->
expect(.ipc).to.be.calledWith("window:open", )
context "click check for updates link", ->
beforeEach ->
= {
height: 210
position: "center"
title: "Updates"
toolbar: false
type: "UPDATES"
width: 300
}
it "triggers window:open", ->
.spy(, "ipc")
cy.get("@optionsLink").click()
cy.contains("a", "Check for updates").click().then ->
expect(.ipc).to.be.calledWith("window:open", )
context "click Quit link", ->
beforeEach ->
it "triggers quit", ->
.spy(, "ipc")
cy.get("@optionsLink").click()
cy.contains("a", "Quit").click().then ->
expect(.ipc).to.be.calledWith("quit")