From e01507dbe76aac2657cc73aef21921c3df854039 Mon Sep 17 00:00:00 2001 From: Chris Breiding Date: Thu, 18 Apr 2019 14:51:40 -0400 Subject: [PATCH 1/6] upgrade to electron 2.0.18 and node 8.9.3 --- .node-version | 2 +- appveyor.yml | 4 ++-- packages/electron/package.json | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.node-version b/.node-version index 2b0aa21219df..22333f1ec56f 100644 --- a/.node-version +++ b/.node-version @@ -1 +1 @@ -8.2.1 +8.9.3 diff --git a/appveyor.yml b/appveyor.yml index 0d8157fd1e15..77a86da93bf0 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -6,8 +6,8 @@ branches: # https://www.appveyor.com/docs/lang/nodejs-iojs/ environment: - # use latest version of Node 8 with NPM 6 - nodejs_version: "8.2.1" + # use matching version of Node.js + nodejs_version: "8.9.3" # encode secure variables which will NOT be used # in pull requests # https://www.appveyor.com/docs/build-configuration/#secure-variables diff --git a/packages/electron/package.json b/packages/electron/package.json index 230e2dfe4a28..4d8ff4844614 100644 --- a/packages/electron/package.json +++ b/packages/electron/package.json @@ -1,7 +1,7 @@ { "name": "@packages/electron", "version": "0.0.0", - "electronVersion": "1.8.2", + "electronVersion": "2.0.18", "private": true, "main": "index.js", "scripts": { From ea79a3e2264c3a4a27f1651720ac02e06f2d3924 Mon Sep 17 00:00:00 2001 From: Chris Breiding Date: Fri, 19 Apr 2019 09:23:52 -0400 Subject: [PATCH 2/6] use cypress/browsers:node8.9.3-chrome73 docker image --- circle.yml | 2 +- scripts/run-docker-local.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/circle.yml b/circle.yml index 956f8aaeeaa9..3f135c32cee2 100644 --- a/circle.yml +++ b/circle.yml @@ -23,7 +23,7 @@ executors: # the Docker image with Cypress dependencies and Chrome browser cy-doc: docker: - - image: cypress/browsers:chrome64 + - image: cypress/browsers:node8.9.3-chrome73 environment: PLATFORM: linux diff --git a/scripts/run-docker-local.sh b/scripts/run-docker-local.sh index c84ffcf8983b..b94204839d2c 100755 --- a/scripts/run-docker-local.sh +++ b/scripts/run-docker-local.sh @@ -2,7 +2,7 @@ set e+x echo "This script should be run from cypress's root" -name=cypress/browsers:chrome64 +name=cypress/browsers:node8.9.3-chrome73 echo "Pulling CI container $name" docker pull $name From 7914f6814243fbbee08c3860cbc0d8d4de904fa5 Mon Sep 17 00:00:00 2001 From: Ben Kucera <14625260+Bkucera@users.noreply.github.com> Date: Wed, 24 Apr 2019 14:46:27 -0400 Subject: [PATCH 3/6] fix type_spec for chrome --- .../commands/actions/type_spec.coffee | 89 +++++++++++++------ .../commands/navigation_spec.coffee | 33 +++++-- .../integration/e2e/return_value_spec.coffee | 4 +- packages/runner/package.json | 1 + 4 files changed, 89 insertions(+), 38 deletions(-) diff --git a/packages/driver/test/cypress/integration/commands/actions/type_spec.coffee b/packages/driver/test/cypress/integration/commands/actions/type_spec.coffee index c1ae3d1f556d..dbb15ed896f4 100644 --- a/packages/driver/test/cypress/integration/commands/actions/type_spec.coffee +++ b/packages/driver/test/cypress/integration/commands/actions/type_spec.coffee @@ -4,6 +4,12 @@ Keyboard = Cypress.Keyboard Promise = Cypress.Promise $selection = require("../../../../../src/dom/selection") +## trim new lines at the end of innerText +## due to changing browser versions implementing +## this differently +trimInnerText = ($el) -> + _.trimEnd($el.get(0).innerText, "\n") + describe "src/cy/commands/actions/type", -> before -> cy @@ -11,6 +17,31 @@ describe "src/cy/commands/actions/type", -> .then (win) -> @body = win.document.body.outerHTML + el = cy.$$('[contenteditable]:first').get(0) + + innerHtml = el.innerHTML + + ## by default... the last new line by itself + ## will only ever count as a single new line... + ## but new lines above it will count as 2 new lines... + ## so by adding "3" new lines, the last counts as 1 + ## and the first 2 count as 2... + el.innerHTML = '

'.repeat(3) + + ## browsers changed their implementation + ## of the number of newlines that

+ ## create. newer versions of chrome set 2 new lines + ## per set - whereas older ones create only 1 new line. + ## so we grab the current sets for the assertion later + ## so this test is browser version agnostic + newLines = el.innerText + + ## disregard the last new line, and divide by 2... + ## this tells us how many multiples of new lines + ## the browser inserts for new lines other than + ## the last new line + @multiplierNumNewLines = (newLines.length - 1) / 2 + beforeEach -> doc = cy.state("document") @@ -1038,7 +1069,7 @@ describe "src/cy/commands/actions/type", -> cy.$$('[contenteditable]:first').get(0).innerHTML = '
foo
' cy.get("[contenteditable]:first") .type("bar").then ($div) -> - expect($div.get(0).innerText).to.eql("foobar\n") + expect(trimInnerText($div)).to.eql("foobar") expect($div.get(0).textContent).to.eql("foobar") expect($div.get(0).innerHTML).to.eql("
foobar
") @@ -1046,7 +1077,7 @@ describe "src/cy/commands/actions/type", -> cy.$$('[contenteditable]:first').get(0).innerHTML = '

foo

' cy.get("[contenteditable]:first") .type("bar").then ($div) -> - expect($div.get(0).innerText).to.eql("foobar\n\n") + expect(trimInnerText($div)).to.eql("foobar") expect($div.get(0).textContent).to.eql("foobar") expect($div.get(0).innerHTML).to.eql("

foobar

") @@ -1054,13 +1085,13 @@ describe "src/cy/commands/actions/type", -> cy.$$('[contenteditable]:first').get(0).innerHTML = '
bar
' cy.get("[contenteditable]:first") .type("{selectall}{leftarrow}foo").then ($div) -> - expect($div.get(0).innerText).to.eql("foobar\n") + expect(trimInnerText($div)).to.eql("foobar") it "collapses selection to end on {rightarrow}", -> cy.$$('[contenteditable]:first').get(0).innerHTML = '
bar
' cy.get("[contenteditable]:first") .type("{selectall}{leftarrow}foo{selectall}{rightarrow}baz").then ($div) -> - expect($div.get(0).innerText).to.eql("foobarbaz\n") + expect(trimInnerText($div)).to.eql("foobarbaz") it "can remove a placeholder
", -> cy.$$('[contenteditable]:first').get(0).innerHTML = '

' @@ -1451,7 +1482,7 @@ describe "src/cy/commands/actions/type", -> cy.get("[contenteditable]:first") .type("{home}11{uparrow}{home}22{uparrow}{home}33").then ($div) -> - expect($div.get(0).innerText).to.eql("33foo\n22bar\n11baz\n") + expect(trimInnerText($div)).to.eql("33foo\n22bar\n11baz") context "{end}", -> it "sets which and keyCode to 35 and does not fire keypress events", (done) -> @@ -1501,7 +1532,7 @@ describe "src/cy/commands/actions/type", -> cy.get("[contenteditable]:first") .type("{end}11{uparrow}{end}22{uparrow}{end}33").then ($div) -> - expect($div.get(0).innerText).to.eql("foo33\nbar22\nbaz11\n") + expect(trimInnerText($div)).to.eql("foo33\nbar22\nbaz11") context "{uparrow}", -> beforeEach -> @@ -1540,7 +1571,7 @@ describe "src/cy/commands/actions/type", -> cy.get("[contenteditable]:first") .type("{leftarrow}{leftarrow}{uparrow}11{uparrow}22{downarrow}{downarrow}33").then ($div) -> - expect($div.get(0).innerText).to.eql("foo22\nb11ar\nbaz33\n") + expect(trimInnerText($div)).to.eql("foo22\nb11ar\nbaz33") it "uparrow ignores current selection", -> ce = cy.$$('[contenteditable]:first').get(0) @@ -1556,7 +1587,7 @@ describe "src/cy/commands/actions/type", -> cy.get("[contenteditable]:first") .type("{uparrow}11").then ($div) -> - expect($div.get(0).innerText).to.eql("11foo\nbar\nbaz\n") + expect(trimInnerText($div)).to.eql("11foo\nbar\nbaz") it "up and down arrow on textarea", -> cy.$$('textarea:first').get(0).value = 'foo\nbar\nbaz' @@ -1570,7 +1601,6 @@ describe "src/cy/commands/actions/type", -> .type('{uparrow}{uparrow}') .should('have.value', '14') - context "{downarrow}", -> beforeEach -> cy.$$("#comments").val("foo\nbar\nbaz") @@ -1626,7 +1656,7 @@ describe "src/cy/commands/actions/type", -> cy.get("[contenteditable]:first") .type("{downarrow}22").then ($div) -> - expect($div.get(0).innerText).to.eql("foo\n22bar\nbaz\n") + expect(trimInnerText($div)).to.eql("foo\n22bar\nbaz") context "{selectall}{del}", -> it "can select all the text and delete", -> @@ -1688,14 +1718,16 @@ describe "src/cy/commands/actions/type", -> it "inserts new line into [contenteditable] ", -> cy.get("#input-types [contenteditable]:first").invoke("text", "foo") .type("bar{enter}baz{enter}{enter}{enter}quux").then ($div) -> - expect($div.get(0).innerText).to.eql("foobar\nbaz\n\n\nquux\n") + conditionalNewLines = "\n\n".repeat(@multiplierNumNewLines) + + expect(trimInnerText($div)).to.eql("foobar\nbaz#{conditionalNewLines}\nquux") expect($div.get(0).textContent).to.eql("foobarbazquux") expect($div.get(0).innerHTML).to.eql("foobar
baz


quux
") it "inserts new line into [contenteditable] from midline", -> cy.get("#input-types [contenteditable]:first").invoke("text", "foo") .type("bar{leftarrow}{enter}baz{leftarrow}{enter}quux").then ($div) -> - expect($div.get(0).innerText).to.eql("fooba\nba\nquuxzr\n") + expect(trimInnerText($div)).to.eql("fooba\nba\nquuxzr") expect($div.get(0).textContent).to.eql("foobabaquuxzr") expect($div.get(0).innerHTML).to.eql("fooba
ba
quuxzr
") @@ -2312,7 +2344,6 @@ describe "src/cy/commands/actions/type", -> .then -> expect(changed).to.eql 0 - describe "caret position", -> it "respects being formatted by input event handlers" @@ -2380,32 +2411,35 @@ describe "src/cy/commands/actions/type", -> el.innerHTML = 'start'+ '
middle
'+ '
end
' + cy.get('[contenteditable]:first') ## move cursor to beginning of div .type('{selectall}{leftarrow}') - .type('{rightarrow}'.repeat(14)+'[_I_]').then -> - expect(cy.$$('[contenteditable]:first').get(0).innerText).to.eql('start\nmiddle\ne[_I_]nd\n') + .type('{rightarrow}'.repeat(14)+'[_I_]').then ($el) -> + expect(trimInnerText($el)).to.eql('start\nmiddle\ne[_I_]nd') it "can wrap cursor to prev line in [contenteditable] with {leftarrow}", -> $el = cy.$$('[contenteditable]:first') el = $el.get(0) + el.innerHTML = 'start'+ '
middle
'+ '
end
' - cy.get('[contenteditable]:first').type('{leftarrow}'.repeat(12)+'[_I_]').then -> - expect(cy.$$('[contenteditable]:first').get(0).innerText).to.eql('star[_I_]t\nmiddle\nend\n') + cy.get('[contenteditable]:first').type('{leftarrow}'.repeat(12)+'[_I_]').then ($el) -> + expect(trimInnerText($el)).to.eql('star[_I_]t\nmiddle\nend') it "can wrap cursor to next line in [contenteditable] with {rightarrow} and empty lines", -> $el = cy.$$('[contenteditable]:first') el = $el.get(0) - el.innerHTML = '

'.repeat(4)+ - '
end
' + el.innerHTML = '

'.repeat(4) + '
end
' + + newLines = "\n\n\n".repeat(@multiplierNumNewLines) cy.get('[contenteditable]:first') .type('{selectall}{leftarrow}') - # .type('foobar'+'{rightarrow}'.repeat(6)+'[_I_]').then -> - # expect(cy.$$('[contenteditable]:first').get(0).innerText).to.eql('foobar\n\n\n\nen[_I_]d\n') + .type('foobar'+'{rightarrow}'.repeat(6)+'[_I_]').then -> + expect(trimInnerText($el)).to.eql("foobar#{newLines}\nen[_I_]d") it "can use {rightarrow} and nested elements", -> $el = cy.$$('[contenteditable]:first') @@ -2415,19 +2449,19 @@ describe "src/cy/commands/actions/type", -> cy.get('[contenteditable]:first') .type('{selectall}{leftarrow}') .type('{rightarrow}'.repeat(3)+'[_I_]').then -> - expect(cy.$$('[contenteditable]:first').get(0).innerText).to.eql('sta[_I_]rt\n') + expect(trimInnerText($el)).to.eql('sta[_I_]rt') it "enter and \\n should act the same for [contenteditable]", -> - cleanseText = (text) -> - text.replace(/ /g, ' ') + ## non breaking white space + text.split('\u00a0').join(' ') expectMatchInnerText = ($el , innerText) -> - expect(cleanseText($el.get(0).innerText)).to.eql(innerText) + expect(cleanseText(trimInnerText($el))).to.eql(innerText) ## NOTE: this may only pass in Chrome since the whitespace may be different in other browsers ## even if actual and expected appear the same. - expected = "{\n foo: 1\n bar: 2\n baz: 3\n}\n" + expected = "{\n foo: 1\n bar: 2\n baz: 3\n}" cy.get('[contenteditable]:first') .invoke('html', '

') .type('{{}{enter} foo: 1{enter} bar: 2{enter} baz: 3{enter}}') @@ -2438,7 +2472,6 @@ describe "src/cy/commands/actions/type", -> .should ($el) -> expectMatchInnerText($el, expected) - it "enter and \\n should act the same for textarea", -> expected = "{\n foo: 1\n bar: 2\n baz: 3\n}" cy.get('textarea:first') @@ -2449,8 +2482,6 @@ describe "src/cy/commands/actions/type", -> .type('{{}\n foo: 1\n bar: 2\n baz: 3\n}') .should('have.prop', 'value', expected) - - describe "{enter}", -> beforeEach -> @$forms = cy.$$("#form-submits") diff --git a/packages/driver/test/cypress/integration/commands/navigation_spec.coffee b/packages/driver/test/cypress/integration/commands/navigation_spec.coffee index 6f4f58609eec..1489f179b3ce 100644 --- a/packages/driver/test/cypress/integration/commands/navigation_spec.coffee +++ b/packages/driver/test/cypress/integration/commands/navigation_spec.coffee @@ -91,6 +91,7 @@ describe "src/cy/commands/navigation", -> expect(stub2).to.be.calledOnce expect(stub3).to.be.calledOnce + # Array(100).fill().map -> it "removes listeners", -> win = cy.state("window") @@ -100,6 +101,14 @@ describe "src/cy/commands/navigation", -> expect(rel).to.be.calledWith("beforeunload") expect(rel).to.be.calledWith("unload") + + # cy.reload().then -> + # cy.wrap(null).should -> + # expect(rel).to.be.calledWith("beforeunload") + # expect(rel).to.be.calledWith("unload") + + + describe "errors", -> beforeEach -> Cypress.config("defaultCommandTimeout", 50) @@ -149,6 +158,7 @@ describe "src/cy/commands/navigation", -> expect(win.foo).to.be.undefined it "throws when reload times out", (done) -> + console.time('foo') locReload = cy.spy(Cypress.utils, "locReload") cy @@ -167,6 +177,8 @@ describe "src/cy/commands/navigation", -> cy.on "fail", (err) -> expected = true + console.timeEnd('foo') + expect(err.message).to.include "Your page did not fire its 'load' event within '1ms'." .reload({timeout: 1}) @@ -232,17 +244,18 @@ describe "src/cy/commands/navigation", -> $(doc.body).empty().html(@body) ## TODO: fix this - it.skip "(FLAKY) sets timeout to Cypress.config(pageLoadTimeout)", -> - timeout = cy.spy Promise.prototype, "timeout" - Cypress.config("pageLoadTimeout", 4567) + # it.skip "(FLAKY) sets timeout to Cypress.config(pageLoadTimeout)", -> + # timeout = cy.spy Promise.prototype, "timeout" + # Cypress.config("pageLoadTimeout", 4567) - cy - .visit("/fixtures/jquery.html") - .go("back").then -> - expect(timeout).to.be.calledWith(4567, "go") + # cy + # .visit("/fixtures/jquery.html") + # .go("back").then -> + # expect(timeout).to.be.calledWith(4567, "go") it "removes listeners", -> cy + .visit("/fixtures/generic.html") .visit("/fixtures/jquery.html") .then -> winLoadListeners = cy.listeners("window:load") @@ -266,6 +279,7 @@ describe "src/cy/commands/navigation", -> stub3 = cy.stub() cy + .visit("/fixtures/generic.html") .visit("/fixtures/jquery.html") .then -> cy.on("stability:changed", stub1) @@ -279,6 +293,7 @@ describe "src/cy/commands/navigation", -> it "removes listeners from window", -> cy + .visit("/fixtures/generic.html") .visit("/fixtures/jquery.html") .then (win) -> rel = cy.stub(win, "removeEventListener") @@ -369,6 +384,7 @@ describe "src/cy/commands/navigation", -> it "logs go", -> cy + .visit("/fixtures/generic.html") .visit("/fixtures/jquery.html") .go("back").then -> lastLog = @lastLog @@ -378,12 +394,14 @@ describe "src/cy/commands/navigation", -> it "can turn off logging", -> cy + .visit("/fixtures/generic.html") .visit("/fixtures/jquery.html") .go("back", {log: false}).then -> expect(@lastLog).to.be.undefined it "does not log 'Page Load' events", -> cy + .visit("/fixtures/generic.html") .visit("/fixtures/jquery.html") .go("back").then -> @logs.slice(0).forEach (log) -> @@ -393,6 +411,7 @@ describe "src/cy/commands/navigation", -> beforeunload = false cy + .visit("/fixtures/generic.html") .visit("/fixtures/jquery.html") .window().then (win) -> cy.on "window:before:unload", => diff --git a/packages/driver/test/cypress/integration/e2e/return_value_spec.coffee b/packages/driver/test/cypress/integration/e2e/return_value_spec.coffee index 9a10b99e8776..0eb158f95fad 100644 --- a/packages/driver/test/cypress/integration/e2e/return_value_spec.coffee +++ b/packages/driver/test/cypress/integration/e2e/return_value_spec.coffee @@ -29,7 +29,7 @@ describe "return values", -> it "stringifies function bodies", (done) -> cy.on "fail", (err) -> - expect(err.message).to.include("> function () {") + expect(err.message).to.include("> function") expect(err.message).to.include("return \"foo\";") expect(err.message).to.include("Cypress detected that you invoked one or more cy commands but returned a different value.") @@ -78,7 +78,7 @@ describe "return values", -> expect(lastLog.get("name")).to.eq("foo") expect(lastLog.get("error")).to.eq(err) expect(err.message).to.include("> cy.foo()") - expect(err.message).to.include("> function () {") + expect(err.message).to.include("> function") expect(err.message).to.include("return \"bar\";") expect(err.message).to.include("Cypress detected that you invoked one or more cy commands in a custom command but returned a different value.") diff --git a/packages/runner/package.json b/packages/runner/package.json index 74503f700776..860b7a022344 100644 --- a/packages/runner/package.json +++ b/packages/runner/package.json @@ -24,6 +24,7 @@ "lib" ], "devDependencies": { + "@babel/plugin-proposal-decorators": "7.4.0", "@babel/plugin-proposal-object-rest-spread": "7.4.0", "@cypress/react-tooltip": "0.4.0", "bin-up": "1.1.0", From d9d5bd60ccacb37b44c4853c31874ec58eff442c Mon Sep 17 00:00:00 2001 From: Ben Kucera <14625260+Bkucera@users.noreply.github.com> Date: Wed, 24 Apr 2019 15:27:26 -0400 Subject: [PATCH 4/6] Revert "fix type_spec for chrome" This reverts commit 7914f6814243fbbee08c3860cbc0d8d4de904fa5. --- .../commands/actions/type_spec.coffee | 89 ++++++------------- .../commands/navigation_spec.coffee | 33 ++----- .../integration/e2e/return_value_spec.coffee | 4 +- packages/runner/package.json | 1 - 4 files changed, 38 insertions(+), 89 deletions(-) diff --git a/packages/driver/test/cypress/integration/commands/actions/type_spec.coffee b/packages/driver/test/cypress/integration/commands/actions/type_spec.coffee index dbb15ed896f4..c1ae3d1f556d 100644 --- a/packages/driver/test/cypress/integration/commands/actions/type_spec.coffee +++ b/packages/driver/test/cypress/integration/commands/actions/type_spec.coffee @@ -4,12 +4,6 @@ Keyboard = Cypress.Keyboard Promise = Cypress.Promise $selection = require("../../../../../src/dom/selection") -## trim new lines at the end of innerText -## due to changing browser versions implementing -## this differently -trimInnerText = ($el) -> - _.trimEnd($el.get(0).innerText, "\n") - describe "src/cy/commands/actions/type", -> before -> cy @@ -17,31 +11,6 @@ describe "src/cy/commands/actions/type", -> .then (win) -> @body = win.document.body.outerHTML - el = cy.$$('[contenteditable]:first').get(0) - - innerHtml = el.innerHTML - - ## by default... the last new line by itself - ## will only ever count as a single new line... - ## but new lines above it will count as 2 new lines... - ## so by adding "3" new lines, the last counts as 1 - ## and the first 2 count as 2... - el.innerHTML = '

'.repeat(3) - - ## browsers changed their implementation - ## of the number of newlines that

- ## create. newer versions of chrome set 2 new lines - ## per set - whereas older ones create only 1 new line. - ## so we grab the current sets for the assertion later - ## so this test is browser version agnostic - newLines = el.innerText - - ## disregard the last new line, and divide by 2... - ## this tells us how many multiples of new lines - ## the browser inserts for new lines other than - ## the last new line - @multiplierNumNewLines = (newLines.length - 1) / 2 - beforeEach -> doc = cy.state("document") @@ -1069,7 +1038,7 @@ describe "src/cy/commands/actions/type", -> cy.$$('[contenteditable]:first').get(0).innerHTML = '
foo
' cy.get("[contenteditable]:first") .type("bar").then ($div) -> - expect(trimInnerText($div)).to.eql("foobar") + expect($div.get(0).innerText).to.eql("foobar\n") expect($div.get(0).textContent).to.eql("foobar") expect($div.get(0).innerHTML).to.eql("
foobar
") @@ -1077,7 +1046,7 @@ describe "src/cy/commands/actions/type", -> cy.$$('[contenteditable]:first').get(0).innerHTML = '

foo

' cy.get("[contenteditable]:first") .type("bar").then ($div) -> - expect(trimInnerText($div)).to.eql("foobar") + expect($div.get(0).innerText).to.eql("foobar\n\n") expect($div.get(0).textContent).to.eql("foobar") expect($div.get(0).innerHTML).to.eql("

foobar

") @@ -1085,13 +1054,13 @@ describe "src/cy/commands/actions/type", -> cy.$$('[contenteditable]:first').get(0).innerHTML = '
bar
' cy.get("[contenteditable]:first") .type("{selectall}{leftarrow}foo").then ($div) -> - expect(trimInnerText($div)).to.eql("foobar") + expect($div.get(0).innerText).to.eql("foobar\n") it "collapses selection to end on {rightarrow}", -> cy.$$('[contenteditable]:first').get(0).innerHTML = '
bar
' cy.get("[contenteditable]:first") .type("{selectall}{leftarrow}foo{selectall}{rightarrow}baz").then ($div) -> - expect(trimInnerText($div)).to.eql("foobarbaz") + expect($div.get(0).innerText).to.eql("foobarbaz\n") it "can remove a placeholder
", -> cy.$$('[contenteditable]:first').get(0).innerHTML = '

' @@ -1482,7 +1451,7 @@ describe "src/cy/commands/actions/type", -> cy.get("[contenteditable]:first") .type("{home}11{uparrow}{home}22{uparrow}{home}33").then ($div) -> - expect(trimInnerText($div)).to.eql("33foo\n22bar\n11baz") + expect($div.get(0).innerText).to.eql("33foo\n22bar\n11baz\n") context "{end}", -> it "sets which and keyCode to 35 and does not fire keypress events", (done) -> @@ -1532,7 +1501,7 @@ describe "src/cy/commands/actions/type", -> cy.get("[contenteditable]:first") .type("{end}11{uparrow}{end}22{uparrow}{end}33").then ($div) -> - expect(trimInnerText($div)).to.eql("foo33\nbar22\nbaz11") + expect($div.get(0).innerText).to.eql("foo33\nbar22\nbaz11\n") context "{uparrow}", -> beforeEach -> @@ -1571,7 +1540,7 @@ describe "src/cy/commands/actions/type", -> cy.get("[contenteditable]:first") .type("{leftarrow}{leftarrow}{uparrow}11{uparrow}22{downarrow}{downarrow}33").then ($div) -> - expect(trimInnerText($div)).to.eql("foo22\nb11ar\nbaz33") + expect($div.get(0).innerText).to.eql("foo22\nb11ar\nbaz33\n") it "uparrow ignores current selection", -> ce = cy.$$('[contenteditable]:first').get(0) @@ -1587,7 +1556,7 @@ describe "src/cy/commands/actions/type", -> cy.get("[contenteditable]:first") .type("{uparrow}11").then ($div) -> - expect(trimInnerText($div)).to.eql("11foo\nbar\nbaz") + expect($div.get(0).innerText).to.eql("11foo\nbar\nbaz\n") it "up and down arrow on textarea", -> cy.$$('textarea:first').get(0).value = 'foo\nbar\nbaz' @@ -1601,6 +1570,7 @@ describe "src/cy/commands/actions/type", -> .type('{uparrow}{uparrow}') .should('have.value', '14') + context "{downarrow}", -> beforeEach -> cy.$$("#comments").val("foo\nbar\nbaz") @@ -1656,7 +1626,7 @@ describe "src/cy/commands/actions/type", -> cy.get("[contenteditable]:first") .type("{downarrow}22").then ($div) -> - expect(trimInnerText($div)).to.eql("foo\n22bar\nbaz") + expect($div.get(0).innerText).to.eql("foo\n22bar\nbaz\n") context "{selectall}{del}", -> it "can select all the text and delete", -> @@ -1718,16 +1688,14 @@ describe "src/cy/commands/actions/type", -> it "inserts new line into [contenteditable] ", -> cy.get("#input-types [contenteditable]:first").invoke("text", "foo") .type("bar{enter}baz{enter}{enter}{enter}quux").then ($div) -> - conditionalNewLines = "\n\n".repeat(@multiplierNumNewLines) - - expect(trimInnerText($div)).to.eql("foobar\nbaz#{conditionalNewLines}\nquux") + expect($div.get(0).innerText).to.eql("foobar\nbaz\n\n\nquux\n") expect($div.get(0).textContent).to.eql("foobarbazquux") expect($div.get(0).innerHTML).to.eql("foobar
baz


quux
") it "inserts new line into [contenteditable] from midline", -> cy.get("#input-types [contenteditable]:first").invoke("text", "foo") .type("bar{leftarrow}{enter}baz{leftarrow}{enter}quux").then ($div) -> - expect(trimInnerText($div)).to.eql("fooba\nba\nquuxzr") + expect($div.get(0).innerText).to.eql("fooba\nba\nquuxzr\n") expect($div.get(0).textContent).to.eql("foobabaquuxzr") expect($div.get(0).innerHTML).to.eql("fooba
ba
quuxzr
") @@ -2344,6 +2312,7 @@ describe "src/cy/commands/actions/type", -> .then -> expect(changed).to.eql 0 + describe "caret position", -> it "respects being formatted by input event handlers" @@ -2411,35 +2380,32 @@ describe "src/cy/commands/actions/type", -> el.innerHTML = 'start'+ '
middle
'+ '
end
' - cy.get('[contenteditable]:first') ## move cursor to beginning of div .type('{selectall}{leftarrow}') - .type('{rightarrow}'.repeat(14)+'[_I_]').then ($el) -> - expect(trimInnerText($el)).to.eql('start\nmiddle\ne[_I_]nd') + .type('{rightarrow}'.repeat(14)+'[_I_]').then -> + expect(cy.$$('[contenteditable]:first').get(0).innerText).to.eql('start\nmiddle\ne[_I_]nd\n') it "can wrap cursor to prev line in [contenteditable] with {leftarrow}", -> $el = cy.$$('[contenteditable]:first') el = $el.get(0) - el.innerHTML = 'start'+ '
middle
'+ '
end
' + cy.get('[contenteditable]:first').type('{leftarrow}'.repeat(12)+'[_I_]').then -> + expect(cy.$$('[contenteditable]:first').get(0).innerText).to.eql('star[_I_]t\nmiddle\nend\n') - cy.get('[contenteditable]:first').type('{leftarrow}'.repeat(12)+'[_I_]').then ($el) -> - expect(trimInnerText($el)).to.eql('star[_I_]t\nmiddle\nend') it "can wrap cursor to next line in [contenteditable] with {rightarrow} and empty lines", -> $el = cy.$$('[contenteditable]:first') el = $el.get(0) - el.innerHTML = '

'.repeat(4) + '
end
' - - newLines = "\n\n\n".repeat(@multiplierNumNewLines) + el.innerHTML = '

'.repeat(4)+ + '
end
' cy.get('[contenteditable]:first') .type('{selectall}{leftarrow}') - .type('foobar'+'{rightarrow}'.repeat(6)+'[_I_]').then -> - expect(trimInnerText($el)).to.eql("foobar#{newLines}\nen[_I_]d") + # .type('foobar'+'{rightarrow}'.repeat(6)+'[_I_]').then -> + # expect(cy.$$('[contenteditable]:first').get(0).innerText).to.eql('foobar\n\n\n\nen[_I_]d\n') it "can use {rightarrow} and nested elements", -> $el = cy.$$('[contenteditable]:first') @@ -2449,19 +2415,19 @@ describe "src/cy/commands/actions/type", -> cy.get('[contenteditable]:first') .type('{selectall}{leftarrow}') .type('{rightarrow}'.repeat(3)+'[_I_]').then -> - expect(trimInnerText($el)).to.eql('sta[_I_]rt') + expect(cy.$$('[contenteditable]:first').get(0).innerText).to.eql('sta[_I_]rt\n') it "enter and \\n should act the same for [contenteditable]", -> + cleanseText = (text) -> - ## non breaking white space - text.split('\u00a0').join(' ') + text.replace(/ /g, ' ') expectMatchInnerText = ($el , innerText) -> - expect(cleanseText(trimInnerText($el))).to.eql(innerText) + expect(cleanseText($el.get(0).innerText)).to.eql(innerText) ## NOTE: this may only pass in Chrome since the whitespace may be different in other browsers ## even if actual and expected appear the same. - expected = "{\n foo: 1\n bar: 2\n baz: 3\n}" + expected = "{\n foo: 1\n bar: 2\n baz: 3\n}\n" cy.get('[contenteditable]:first') .invoke('html', '

') .type('{{}{enter} foo: 1{enter} bar: 2{enter} baz: 3{enter}}') @@ -2472,6 +2438,7 @@ describe "src/cy/commands/actions/type", -> .should ($el) -> expectMatchInnerText($el, expected) + it "enter and \\n should act the same for textarea", -> expected = "{\n foo: 1\n bar: 2\n baz: 3\n}" cy.get('textarea:first') @@ -2482,6 +2449,8 @@ describe "src/cy/commands/actions/type", -> .type('{{}\n foo: 1\n bar: 2\n baz: 3\n}') .should('have.prop', 'value', expected) + + describe "{enter}", -> beforeEach -> @$forms = cy.$$("#form-submits") diff --git a/packages/driver/test/cypress/integration/commands/navigation_spec.coffee b/packages/driver/test/cypress/integration/commands/navigation_spec.coffee index 1489f179b3ce..6f4f58609eec 100644 --- a/packages/driver/test/cypress/integration/commands/navigation_spec.coffee +++ b/packages/driver/test/cypress/integration/commands/navigation_spec.coffee @@ -91,7 +91,6 @@ describe "src/cy/commands/navigation", -> expect(stub2).to.be.calledOnce expect(stub3).to.be.calledOnce - # Array(100).fill().map -> it "removes listeners", -> win = cy.state("window") @@ -101,14 +100,6 @@ describe "src/cy/commands/navigation", -> expect(rel).to.be.calledWith("beforeunload") expect(rel).to.be.calledWith("unload") - - # cy.reload().then -> - # cy.wrap(null).should -> - # expect(rel).to.be.calledWith("beforeunload") - # expect(rel).to.be.calledWith("unload") - - - describe "errors", -> beforeEach -> Cypress.config("defaultCommandTimeout", 50) @@ -158,7 +149,6 @@ describe "src/cy/commands/navigation", -> expect(win.foo).to.be.undefined it "throws when reload times out", (done) -> - console.time('foo') locReload = cy.spy(Cypress.utils, "locReload") cy @@ -177,8 +167,6 @@ describe "src/cy/commands/navigation", -> cy.on "fail", (err) -> expected = true - console.timeEnd('foo') - expect(err.message).to.include "Your page did not fire its 'load' event within '1ms'." .reload({timeout: 1}) @@ -244,18 +232,17 @@ describe "src/cy/commands/navigation", -> $(doc.body).empty().html(@body) ## TODO: fix this - # it.skip "(FLAKY) sets timeout to Cypress.config(pageLoadTimeout)", -> - # timeout = cy.spy Promise.prototype, "timeout" - # Cypress.config("pageLoadTimeout", 4567) + it.skip "(FLAKY) sets timeout to Cypress.config(pageLoadTimeout)", -> + timeout = cy.spy Promise.prototype, "timeout" + Cypress.config("pageLoadTimeout", 4567) - # cy - # .visit("/fixtures/jquery.html") - # .go("back").then -> - # expect(timeout).to.be.calledWith(4567, "go") + cy + .visit("/fixtures/jquery.html") + .go("back").then -> + expect(timeout).to.be.calledWith(4567, "go") it "removes listeners", -> cy - .visit("/fixtures/generic.html") .visit("/fixtures/jquery.html") .then -> winLoadListeners = cy.listeners("window:load") @@ -279,7 +266,6 @@ describe "src/cy/commands/navigation", -> stub3 = cy.stub() cy - .visit("/fixtures/generic.html") .visit("/fixtures/jquery.html") .then -> cy.on("stability:changed", stub1) @@ -293,7 +279,6 @@ describe "src/cy/commands/navigation", -> it "removes listeners from window", -> cy - .visit("/fixtures/generic.html") .visit("/fixtures/jquery.html") .then (win) -> rel = cy.stub(win, "removeEventListener") @@ -384,7 +369,6 @@ describe "src/cy/commands/navigation", -> it "logs go", -> cy - .visit("/fixtures/generic.html") .visit("/fixtures/jquery.html") .go("back").then -> lastLog = @lastLog @@ -394,14 +378,12 @@ describe "src/cy/commands/navigation", -> it "can turn off logging", -> cy - .visit("/fixtures/generic.html") .visit("/fixtures/jquery.html") .go("back", {log: false}).then -> expect(@lastLog).to.be.undefined it "does not log 'Page Load' events", -> cy - .visit("/fixtures/generic.html") .visit("/fixtures/jquery.html") .go("back").then -> @logs.slice(0).forEach (log) -> @@ -411,7 +393,6 @@ describe "src/cy/commands/navigation", -> beforeunload = false cy - .visit("/fixtures/generic.html") .visit("/fixtures/jquery.html") .window().then (win) -> cy.on "window:before:unload", => diff --git a/packages/driver/test/cypress/integration/e2e/return_value_spec.coffee b/packages/driver/test/cypress/integration/e2e/return_value_spec.coffee index 0eb158f95fad..9a10b99e8776 100644 --- a/packages/driver/test/cypress/integration/e2e/return_value_spec.coffee +++ b/packages/driver/test/cypress/integration/e2e/return_value_spec.coffee @@ -29,7 +29,7 @@ describe "return values", -> it "stringifies function bodies", (done) -> cy.on "fail", (err) -> - expect(err.message).to.include("> function") + expect(err.message).to.include("> function () {") expect(err.message).to.include("return \"foo\";") expect(err.message).to.include("Cypress detected that you invoked one or more cy commands but returned a different value.") @@ -78,7 +78,7 @@ describe "return values", -> expect(lastLog.get("name")).to.eq("foo") expect(lastLog.get("error")).to.eq(err) expect(err.message).to.include("> cy.foo()") - expect(err.message).to.include("> function") + expect(err.message).to.include("> function () {") expect(err.message).to.include("return \"bar\";") expect(err.message).to.include("Cypress detected that you invoked one or more cy commands in a custom command but returned a different value.") diff --git a/packages/runner/package.json b/packages/runner/package.json index 860b7a022344..74503f700776 100644 --- a/packages/runner/package.json +++ b/packages/runner/package.json @@ -24,7 +24,6 @@ "lib" ], "devDependencies": { - "@babel/plugin-proposal-decorators": "7.4.0", "@babel/plugin-proposal-object-rest-spread": "7.4.0", "@cypress/react-tooltip": "0.4.0", "bin-up": "1.1.0", From 4688fc608996ec2872360674c18bae187c0c77c9 Mon Sep 17 00:00:00 2001 From: Ben Kucera <14625260+Bkucera@users.noreply.github.com> Date: Wed, 24 Apr 2019 15:25:25 -0400 Subject: [PATCH 5/6] fix driver specs for chrome --- .../commands/actions/type_spec.coffee | 89 +++++++++++++------ .../commands/navigation_spec.coffee | 7 ++ .../integration/e2e/return_value_spec.coffee | 4 +- 3 files changed, 69 insertions(+), 31 deletions(-) diff --git a/packages/driver/test/cypress/integration/commands/actions/type_spec.coffee b/packages/driver/test/cypress/integration/commands/actions/type_spec.coffee index c1ae3d1f556d..dbb15ed896f4 100644 --- a/packages/driver/test/cypress/integration/commands/actions/type_spec.coffee +++ b/packages/driver/test/cypress/integration/commands/actions/type_spec.coffee @@ -4,6 +4,12 @@ Keyboard = Cypress.Keyboard Promise = Cypress.Promise $selection = require("../../../../../src/dom/selection") +## trim new lines at the end of innerText +## due to changing browser versions implementing +## this differently +trimInnerText = ($el) -> + _.trimEnd($el.get(0).innerText, "\n") + describe "src/cy/commands/actions/type", -> before -> cy @@ -11,6 +17,31 @@ describe "src/cy/commands/actions/type", -> .then (win) -> @body = win.document.body.outerHTML + el = cy.$$('[contenteditable]:first').get(0) + + innerHtml = el.innerHTML + + ## by default... the last new line by itself + ## will only ever count as a single new line... + ## but new lines above it will count as 2 new lines... + ## so by adding "3" new lines, the last counts as 1 + ## and the first 2 count as 2... + el.innerHTML = '

'.repeat(3) + + ## browsers changed their implementation + ## of the number of newlines that

+ ## create. newer versions of chrome set 2 new lines + ## per set - whereas older ones create only 1 new line. + ## so we grab the current sets for the assertion later + ## so this test is browser version agnostic + newLines = el.innerText + + ## disregard the last new line, and divide by 2... + ## this tells us how many multiples of new lines + ## the browser inserts for new lines other than + ## the last new line + @multiplierNumNewLines = (newLines.length - 1) / 2 + beforeEach -> doc = cy.state("document") @@ -1038,7 +1069,7 @@ describe "src/cy/commands/actions/type", -> cy.$$('[contenteditable]:first').get(0).innerHTML = '
foo
' cy.get("[contenteditable]:first") .type("bar").then ($div) -> - expect($div.get(0).innerText).to.eql("foobar\n") + expect(trimInnerText($div)).to.eql("foobar") expect($div.get(0).textContent).to.eql("foobar") expect($div.get(0).innerHTML).to.eql("
foobar
") @@ -1046,7 +1077,7 @@ describe "src/cy/commands/actions/type", -> cy.$$('[contenteditable]:first').get(0).innerHTML = '

foo

' cy.get("[contenteditable]:first") .type("bar").then ($div) -> - expect($div.get(0).innerText).to.eql("foobar\n\n") + expect(trimInnerText($div)).to.eql("foobar") expect($div.get(0).textContent).to.eql("foobar") expect($div.get(0).innerHTML).to.eql("

foobar

") @@ -1054,13 +1085,13 @@ describe "src/cy/commands/actions/type", -> cy.$$('[contenteditable]:first').get(0).innerHTML = '
bar
' cy.get("[contenteditable]:first") .type("{selectall}{leftarrow}foo").then ($div) -> - expect($div.get(0).innerText).to.eql("foobar\n") + expect(trimInnerText($div)).to.eql("foobar") it "collapses selection to end on {rightarrow}", -> cy.$$('[contenteditable]:first').get(0).innerHTML = '
bar
' cy.get("[contenteditable]:first") .type("{selectall}{leftarrow}foo{selectall}{rightarrow}baz").then ($div) -> - expect($div.get(0).innerText).to.eql("foobarbaz\n") + expect(trimInnerText($div)).to.eql("foobarbaz") it "can remove a placeholder
", -> cy.$$('[contenteditable]:first').get(0).innerHTML = '

' @@ -1451,7 +1482,7 @@ describe "src/cy/commands/actions/type", -> cy.get("[contenteditable]:first") .type("{home}11{uparrow}{home}22{uparrow}{home}33").then ($div) -> - expect($div.get(0).innerText).to.eql("33foo\n22bar\n11baz\n") + expect(trimInnerText($div)).to.eql("33foo\n22bar\n11baz") context "{end}", -> it "sets which and keyCode to 35 and does not fire keypress events", (done) -> @@ -1501,7 +1532,7 @@ describe "src/cy/commands/actions/type", -> cy.get("[contenteditable]:first") .type("{end}11{uparrow}{end}22{uparrow}{end}33").then ($div) -> - expect($div.get(0).innerText).to.eql("foo33\nbar22\nbaz11\n") + expect(trimInnerText($div)).to.eql("foo33\nbar22\nbaz11") context "{uparrow}", -> beforeEach -> @@ -1540,7 +1571,7 @@ describe "src/cy/commands/actions/type", -> cy.get("[contenteditable]:first") .type("{leftarrow}{leftarrow}{uparrow}11{uparrow}22{downarrow}{downarrow}33").then ($div) -> - expect($div.get(0).innerText).to.eql("foo22\nb11ar\nbaz33\n") + expect(trimInnerText($div)).to.eql("foo22\nb11ar\nbaz33") it "uparrow ignores current selection", -> ce = cy.$$('[contenteditable]:first').get(0) @@ -1556,7 +1587,7 @@ describe "src/cy/commands/actions/type", -> cy.get("[contenteditable]:first") .type("{uparrow}11").then ($div) -> - expect($div.get(0).innerText).to.eql("11foo\nbar\nbaz\n") + expect(trimInnerText($div)).to.eql("11foo\nbar\nbaz") it "up and down arrow on textarea", -> cy.$$('textarea:first').get(0).value = 'foo\nbar\nbaz' @@ -1570,7 +1601,6 @@ describe "src/cy/commands/actions/type", -> .type('{uparrow}{uparrow}') .should('have.value', '14') - context "{downarrow}", -> beforeEach -> cy.$$("#comments").val("foo\nbar\nbaz") @@ -1626,7 +1656,7 @@ describe "src/cy/commands/actions/type", -> cy.get("[contenteditable]:first") .type("{downarrow}22").then ($div) -> - expect($div.get(0).innerText).to.eql("foo\n22bar\nbaz\n") + expect(trimInnerText($div)).to.eql("foo\n22bar\nbaz") context "{selectall}{del}", -> it "can select all the text and delete", -> @@ -1688,14 +1718,16 @@ describe "src/cy/commands/actions/type", -> it "inserts new line into [contenteditable] ", -> cy.get("#input-types [contenteditable]:first").invoke("text", "foo") .type("bar{enter}baz{enter}{enter}{enter}quux").then ($div) -> - expect($div.get(0).innerText).to.eql("foobar\nbaz\n\n\nquux\n") + conditionalNewLines = "\n\n".repeat(@multiplierNumNewLines) + + expect(trimInnerText($div)).to.eql("foobar\nbaz#{conditionalNewLines}\nquux") expect($div.get(0).textContent).to.eql("foobarbazquux") expect($div.get(0).innerHTML).to.eql("foobar
baz


quux
") it "inserts new line into [contenteditable] from midline", -> cy.get("#input-types [contenteditable]:first").invoke("text", "foo") .type("bar{leftarrow}{enter}baz{leftarrow}{enter}quux").then ($div) -> - expect($div.get(0).innerText).to.eql("fooba\nba\nquuxzr\n") + expect(trimInnerText($div)).to.eql("fooba\nba\nquuxzr") expect($div.get(0).textContent).to.eql("foobabaquuxzr") expect($div.get(0).innerHTML).to.eql("fooba
ba
quuxzr
") @@ -2312,7 +2344,6 @@ describe "src/cy/commands/actions/type", -> .then -> expect(changed).to.eql 0 - describe "caret position", -> it "respects being formatted by input event handlers" @@ -2380,32 +2411,35 @@ describe "src/cy/commands/actions/type", -> el.innerHTML = 'start'+ '
middle
'+ '
end
' + cy.get('[contenteditable]:first') ## move cursor to beginning of div .type('{selectall}{leftarrow}') - .type('{rightarrow}'.repeat(14)+'[_I_]').then -> - expect(cy.$$('[contenteditable]:first').get(0).innerText).to.eql('start\nmiddle\ne[_I_]nd\n') + .type('{rightarrow}'.repeat(14)+'[_I_]').then ($el) -> + expect(trimInnerText($el)).to.eql('start\nmiddle\ne[_I_]nd') it "can wrap cursor to prev line in [contenteditable] with {leftarrow}", -> $el = cy.$$('[contenteditable]:first') el = $el.get(0) + el.innerHTML = 'start'+ '
middle
'+ '
end
' - cy.get('[contenteditable]:first').type('{leftarrow}'.repeat(12)+'[_I_]').then -> - expect(cy.$$('[contenteditable]:first').get(0).innerText).to.eql('star[_I_]t\nmiddle\nend\n') + cy.get('[contenteditable]:first').type('{leftarrow}'.repeat(12)+'[_I_]').then ($el) -> + expect(trimInnerText($el)).to.eql('star[_I_]t\nmiddle\nend') it "can wrap cursor to next line in [contenteditable] with {rightarrow} and empty lines", -> $el = cy.$$('[contenteditable]:first') el = $el.get(0) - el.innerHTML = '

'.repeat(4)+ - '
end
' + el.innerHTML = '

'.repeat(4) + '
end
' + + newLines = "\n\n\n".repeat(@multiplierNumNewLines) cy.get('[contenteditable]:first') .type('{selectall}{leftarrow}') - # .type('foobar'+'{rightarrow}'.repeat(6)+'[_I_]').then -> - # expect(cy.$$('[contenteditable]:first').get(0).innerText).to.eql('foobar\n\n\n\nen[_I_]d\n') + .type('foobar'+'{rightarrow}'.repeat(6)+'[_I_]').then -> + expect(trimInnerText($el)).to.eql("foobar#{newLines}\nen[_I_]d") it "can use {rightarrow} and nested elements", -> $el = cy.$$('[contenteditable]:first') @@ -2415,19 +2449,19 @@ describe "src/cy/commands/actions/type", -> cy.get('[contenteditable]:first') .type('{selectall}{leftarrow}') .type('{rightarrow}'.repeat(3)+'[_I_]').then -> - expect(cy.$$('[contenteditable]:first').get(0).innerText).to.eql('sta[_I_]rt\n') + expect(trimInnerText($el)).to.eql('sta[_I_]rt') it "enter and \\n should act the same for [contenteditable]", -> - cleanseText = (text) -> - text.replace(/ /g, ' ') + ## non breaking white space + text.split('\u00a0').join(' ') expectMatchInnerText = ($el , innerText) -> - expect(cleanseText($el.get(0).innerText)).to.eql(innerText) + expect(cleanseText(trimInnerText($el))).to.eql(innerText) ## NOTE: this may only pass in Chrome since the whitespace may be different in other browsers ## even if actual and expected appear the same. - expected = "{\n foo: 1\n bar: 2\n baz: 3\n}\n" + expected = "{\n foo: 1\n bar: 2\n baz: 3\n}" cy.get('[contenteditable]:first') .invoke('html', '

') .type('{{}{enter} foo: 1{enter} bar: 2{enter} baz: 3{enter}}') @@ -2438,7 +2472,6 @@ describe "src/cy/commands/actions/type", -> .should ($el) -> expectMatchInnerText($el, expected) - it "enter and \\n should act the same for textarea", -> expected = "{\n foo: 1\n bar: 2\n baz: 3\n}" cy.get('textarea:first') @@ -2449,8 +2482,6 @@ describe "src/cy/commands/actions/type", -> .type('{{}\n foo: 1\n bar: 2\n baz: 3\n}') .should('have.prop', 'value', expected) - - describe "{enter}", -> beforeEach -> @$forms = cy.$$("#form-submits") diff --git a/packages/driver/test/cypress/integration/commands/navigation_spec.coffee b/packages/driver/test/cypress/integration/commands/navigation_spec.coffee index 6f4f58609eec..4a5fa333708d 100644 --- a/packages/driver/test/cypress/integration/commands/navigation_spec.coffee +++ b/packages/driver/test/cypress/integration/commands/navigation_spec.coffee @@ -243,6 +243,7 @@ describe "src/cy/commands/navigation", -> it "removes listeners", -> cy + .visit("/fixtures/generic.html") .visit("/fixtures/jquery.html") .then -> winLoadListeners = cy.listeners("window:load") @@ -266,6 +267,7 @@ describe "src/cy/commands/navigation", -> stub3 = cy.stub() cy + .visit("/fixtures/generic.html") .visit("/fixtures/jquery.html") .then -> cy.on("stability:changed", stub1) @@ -279,6 +281,7 @@ describe "src/cy/commands/navigation", -> it "removes listeners from window", -> cy + .visit("/fixtures/generic.html") .visit("/fixtures/jquery.html") .then (win) -> rel = cy.stub(win, "removeEventListener") @@ -369,6 +372,7 @@ describe "src/cy/commands/navigation", -> it "logs go", -> cy + .visit("/fixtures/generic.html") .visit("/fixtures/jquery.html") .go("back").then -> lastLog = @lastLog @@ -378,12 +382,14 @@ describe "src/cy/commands/navigation", -> it "can turn off logging", -> cy + .visit("/fixtures/generic.html") .visit("/fixtures/jquery.html") .go("back", {log: false}).then -> expect(@lastLog).to.be.undefined it "does not log 'Page Load' events", -> cy + .visit("/fixtures/generic.html") .visit("/fixtures/jquery.html") .go("back").then -> @logs.slice(0).forEach (log) -> @@ -393,6 +399,7 @@ describe "src/cy/commands/navigation", -> beforeunload = false cy + .visit("/fixtures/generic.html") .visit("/fixtures/jquery.html") .window().then (win) -> cy.on "window:before:unload", => diff --git a/packages/driver/test/cypress/integration/e2e/return_value_spec.coffee b/packages/driver/test/cypress/integration/e2e/return_value_spec.coffee index 9a10b99e8776..0eb158f95fad 100644 --- a/packages/driver/test/cypress/integration/e2e/return_value_spec.coffee +++ b/packages/driver/test/cypress/integration/e2e/return_value_spec.coffee @@ -29,7 +29,7 @@ describe "return values", -> it "stringifies function bodies", (done) -> cy.on "fail", (err) -> - expect(err.message).to.include("> function () {") + expect(err.message).to.include("> function") expect(err.message).to.include("return \"foo\";") expect(err.message).to.include("Cypress detected that you invoked one or more cy commands but returned a different value.") @@ -78,7 +78,7 @@ describe "return values", -> expect(lastLog.get("name")).to.eq("foo") expect(lastLog.get("error")).to.eq(err) expect(err.message).to.include("> cy.foo()") - expect(err.message).to.include("> function () {") + expect(err.message).to.include("> function") expect(err.message).to.include("return \"bar\";") expect(err.message).to.include("Cypress detected that you invoked one or more cy commands in a custom command but returned a different value.") From de6e4474f845a169c3aaa3574458bdbcd7077502 Mon Sep 17 00:00:00 2001 From: Brian Mann Date: Thu, 25 Apr 2019 18:52:34 -0400 Subject: [PATCH 6/6] update engines to 8.9.3 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e054bd77a0d2..004ac370a40c 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "description": "Cypress.io end to end testing tool", "private": true, "engines": { - "node": ">=8.2.1" + "node": ">=8.9.3" }, "scripts": { "prestart": "npm run check-deps-pre",