Skip to content

Commit

Permalink
Merge branch 'develop' into 9.0-release
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisbreiding committed Nov 9, 2021
2 parents 3095d73 + a5cf5c0 commit 1e8dc00
Show file tree
Hide file tree
Showing 37 changed files with 377 additions and 276 deletions.
19 changes: 10 additions & 9 deletions packages/driver/cypress/integration/commands/actions/check_spec.js
@@ -1,3 +1,4 @@
const { assertLogLength } = require('../../../support/utils')
const { _, Promise, $ } = Cypress

describe('src/cy/commands/actions/check', () => {
Expand Down Expand Up @@ -469,7 +470,7 @@ describe('src/cy/commands/actions/check', () => {
cy.on('fail', (err) => {
const { lastLog } = this

expect(this.logs.length).to.eq(chk.length + 1)
assertLogLength(this.logs, chk.length + 1)
expect(lastLog.get('error')).to.eq(err)
expect(err.message).to.include('`cy.check()` failed because this element is not visible')

Expand Down Expand Up @@ -501,7 +502,7 @@ describe('src/cy/commands/actions/check', () => {
cy.on('fail', (err) => {
const { lastLog } = this

expect(this.logs.length).to.eq(chk.length + 1)
assertLogLength(this.logs, chk.length + 1)
expect(lastLog.get('error')).to.eq(err)
expect(err.message).to.include('`cy.check()` failed because this element is not visible')

Expand All @@ -515,7 +516,7 @@ describe('src/cy/commands/actions/check', () => {
cy.on('fail', (err) => {
const { lastLog } = this

expect(this.logs.length).to.eq(1)
assertLogLength(this.logs, 1)
expect(lastLog.get('error')).to.eq(err)

done()
Expand All @@ -530,7 +531,7 @@ describe('src/cy/commands/actions/check', () => {
$('<span>span on button</span>').css({ position: 'absolute', left: checkbox.offset().left, top: checkbox.offset().top, padding: 5, display: 'inline-block', backgroundColor: 'yellow' }).prependTo($('body'))

cy.on('fail', (err) => {
expect(this.logs.length).to.eq(2)
assertLogLength(this.logs, 2)
expect(err.message).to.include('`cy.check()` failed because this element')
expect(err.message).to.include('is being covered by another element')

Expand Down Expand Up @@ -559,7 +560,7 @@ describe('src/cy/commands/actions/check', () => {

it('does not log an additional log on failure', function (done) {
cy.on('fail', () => {
expect(this.logs.length).to.eq(3)
assertLogLength(this.logs, 3)

done()
})
Expand Down Expand Up @@ -1016,7 +1017,7 @@ describe('src/cy/commands/actions/check', () => {
const { lastLog } = this
const len = (chk.length * 2) + 6

expect(this.logs.length).to.eq(len)
assertLogLength(this.logs, len)
expect(lastLog.get('error')).to.eq(err)
expect(err.message).to.include('`cy.uncheck()` failed because this element is not visible')

Expand All @@ -1032,7 +1033,7 @@ describe('src/cy/commands/actions/check', () => {
cy.on('fail', (err) => {
const { lastLog } = this

expect(this.logs.length).to.eq(1)
assertLogLength(this.logs, 1)
expect(lastLog.get('error')).to.eq(err)

done()
Expand Down Expand Up @@ -1068,7 +1069,7 @@ describe('src/cy/commands/actions/check', () => {
$('<span>span on button</span>').css({ position: 'absolute', left: checkbox.offset().left, top: checkbox.offset().top, padding: 5, display: 'inline-block', backgroundColor: 'yellow' }).prependTo($('body'))

cy.on('fail', (err) => {
expect(this.logs.length).to.eq(2)
assertLogLength(this.logs, 2)
expect(err.message).to.include('`cy.uncheck()` failed because this element')
expect(err.message).to.include('is being covered by another element')

Expand Down Expand Up @@ -1122,7 +1123,7 @@ describe('src/cy/commands/actions/check', () => {

it('does not log an additional log on failure', function (done) {
cy.on('fail', () => {
expect(this.logs.length).to.eq(3)
assertLogLength(this.logs, 3)

done()
})
Expand Down
@@ -1,5 +1,6 @@
const { _, $ } = Cypress
const {
assertLogLength,
attachKeyListeners,
shouldBeCalledOnce,
shouldNotBeCalled,
Expand Down Expand Up @@ -286,7 +287,7 @@ describe('src/cy/commands/actions/type - #clear', () => {
cy.on('fail', (err) => {
const { lastLog } = this

expect(this.logs.length).to.eq(3)
assertLogLength(this.logs, 3)
expect(lastLog.get('error')).to.eq(err)
expect(err.message).to.include('`cy.clear()` failed because it requires a valid clearable element.')
expect(err.message).to.include('The element cleared was:')
Expand Down Expand Up @@ -381,7 +382,7 @@ describe('src/cy/commands/actions/type - #clear', () => {
cy.on('fail', (err) => {
const { lastLog } = this

expect(this.logs.length).to.eq(1)
assertLogLength(this.logs, 1)
expect(lastLog.get('error')).to.eq(err)

done()
Expand All @@ -408,7 +409,7 @@ describe('src/cy/commands/actions/type - #clear', () => {
.prependTo(cy.$$('body'))

cy.on('fail', (err) => {
expect(this.logs.length).to.eq(2)
assertLogLength(this.logs, 2)
expect(err.message).to.include('`cy.clear()` failed because this element')
expect(err.message).to.include('is being covered by another element')

Expand Down Expand Up @@ -442,7 +443,7 @@ describe('src/cy/commands/actions/type - #clear', () => {
})

cy.on('fail', () => {
expect(this.logs.length).to.eq(3)
assertLogLength(this.logs, 3)

done()
})
Expand Down
18 changes: 10 additions & 8 deletions packages/driver/cypress/integration/commands/actions/click_spec.js
@@ -1,5 +1,7 @@
const { _, $, Promise } = Cypress
const { getCommandLogWithText,
const {
assertLogLength,
getCommandLogWithText,
findReactInstance,
withMutableReporterState,
clickCommandLog,
Expand Down Expand Up @@ -2163,7 +2165,7 @@ describe('src/cy/commands/actions/click', () => {
cy.on('fail', (err) => {
const { lastLog } = this

expect(this.logs.length).to.eq(1)
assertLogLength(this.logs, 1)
expect(lastLog.get('error')).to.eq(err)

done()
Expand Down Expand Up @@ -2356,7 +2358,7 @@ describe('src/cy/commands/actions/click', () => {

it('throws when attempting to click a <select> element', function (done) {
cy.on('fail', (err) => {
expect(this.logs.length).to.eq(2)
assertLogLength(this.logs, 2)
expect(err.message).to.eq('`cy.click()` cannot be called on a `<select>` element. Use `cy.select()` command instead to change the value.')
expect(err.docsUrl).to.eq('https://on.cypress.io/select')

Expand All @@ -2368,7 +2370,7 @@ describe('src/cy/commands/actions/click', () => {

it('throws when provided invalid position', function (done) {
cy.on('fail', (err) => {
expect(this.logs.length).to.eq(2)
assertLogLength(this.logs, 2)
expect(err.message).to.eq('Invalid position argument: `foo`. Position may only be topLeft, top, topRight, left, center, right, bottomLeft, bottom, bottomRight.')

done()
Expand Down Expand Up @@ -2416,7 +2418,7 @@ describe('src/cy/commands/actions/click', () => {

it('does not log an additional log on failure', function (done) {
cy.on('fail', () => {
expect(this.logs.length).to.eq(3)
assertLogLength(this.logs, 3)

done()
})
Expand Down Expand Up @@ -3293,7 +3295,7 @@ describe('src/cy/commands/actions/click', () => {
cy.on('fail', (err) => {
const { lastLog } = this

expect(this.logs.length).to.eq(1)
assertLogLength(this.logs, 1)
expect(lastLog.get('error')).to.eq(err)

done()
Expand Down Expand Up @@ -3731,7 +3733,7 @@ describe('src/cy/commands/actions/click', () => {
cy.on('fail', (err) => {
const { lastLog } = this

expect(this.logs.length).to.eq(1)
assertLogLength(this.logs, 1)
expect(lastLog.get('error')).to.eq(err)

done()
Expand All @@ -3747,7 +3749,7 @@ describe('src/cy/commands/actions/click', () => {
cy.on('fail', (err) => {
const { lastLog } = this

expect(this.logs.length).to.eq(4)
assertLogLength(this.logs, 4)
expect(lastLog.get('error')).to.eq(err)
expect(err.message).to.include('`cy.rightclick()` failed because this element is not visible')

Expand Down
@@ -1,3 +1,4 @@
const { assertLogLength } = require('../../../support/utils')
const { _, $ } = Cypress

const getActiveElement = () => {
Expand Down Expand Up @@ -297,7 +298,7 @@ describe('src/cy/commands/actions/focus', () => {
cy
.get('input:first').focus()
.get('button:first').focus().then(function () {
expect(this.logs.length).to.eq(2)
assertLogLength(this.logs, 2)
})
})

Expand Down Expand Up @@ -384,7 +385,7 @@ describe('src/cy/commands/actions/focus', () => {
cy.on('fail', (err) => {
const { lastLog } = this

expect(this.logs.length).to.eq(1)
assertLogLength(this.logs, 1)
expect(lastLog.get('error')).to.eq(err)

done()
Expand Down Expand Up @@ -467,7 +468,7 @@ describe('src/cy/commands/actions/focus', () => {

it('does not log an additional log on failure', function (done) {
cy.on('fail', () => {
expect(this.logs.length).to.eq(3)
assertLogLength(this.logs, 3)

done()
})
Expand Down Expand Up @@ -738,7 +739,7 @@ describe('src/cy/commands/actions/focus', () => {

it('logs 1 blur event', () => {
cy.get('input:first').focus().blur().then(function () {
expect(this.logs.length).to.eq(1)
assertLogLength(this.logs, 1)
})
})

Expand Down Expand Up @@ -866,7 +867,7 @@ describe('src/cy/commands/actions/focus', () => {
cy.on('fail', (err) => {
const { lastLog } = this

expect(this.logs.length).to.eq(1)
assertLogLength(this.logs, 1)
expect(lastLog.get('error')).to.eq(err)

done()
Expand All @@ -893,7 +894,7 @@ describe('src/cy/commands/actions/focus', () => {

it('does not log an additional log on failure', function (done) {
cy.on('fail', () => {
expect(this.logs.length).to.eq(4)
assertLogLength(this.logs, 4)

done()
})
Expand Down
@@ -1,3 +1,4 @@
const { assertLogLength } = require('../../../support/utils')
const { _, $ } = Cypress

describe('src/cy/commands/actions/select', () => {
Expand Down Expand Up @@ -586,7 +587,7 @@ describe('src/cy/commands/actions/select', () => {

it('does not log an additional log on failure', function (done) {
cy.on('fail', () => {
expect(this.logs.length).to.eq(3)
assertLogLength(this.logs, 3)

done()
})
Expand All @@ -597,7 +598,7 @@ describe('src/cy/commands/actions/select', () => {
it('only logs once on failure', function (done) {
cy.on('fail', (err) => {
// 2 logs, 1 for cy.get, 1 for cy.select
expect(this.logs.length).to.eq(2)
assertLogLength(this.logs, 2)

done()
})
Expand Down Expand Up @@ -702,7 +703,7 @@ describe('src/cy/commands/actions/select', () => {
})

cy.get('#select-maps').select('de_dust2').then(function () {
expect(this.logs.length).to.eq(2)
assertLogLength(this.logs, 2)
expect(types.length).to.eq(1)
})
})
Expand Down
@@ -1,5 +1,5 @@
const { _, $ } = Cypress
const { Promise } = Cypress
const { assertLogLength } = require('../../../support/utils')
const { _, $, Promise } = Cypress

describe('src/cy/commands/actions/submit', () => {
before(() => {
Expand Down Expand Up @@ -242,7 +242,7 @@ describe('src/cy/commands/actions/submit', () => {
cy.on('fail', (err) => {
const { lastLog } = this

expect(this.logs.length).to.eq(2)
assertLogLength(this.logs, 2)
expect(lastLog.get('error')).to.eq(err)
expect(err.message).to.include('`cy.submit()` can only be called on a `<form>`. Your subject contains a: `<input id="input">`')
expect(err.docsUrl).to.eq('https://on.cypress.io/submit')
Expand Down Expand Up @@ -293,7 +293,7 @@ describe('src/cy/commands/actions/submit', () => {
cy.on('fail', (err) => {
const { lastLog } = this

expect(this.logs.length).to.eq(1)
assertLogLength(this.logs, 1)
expect(lastLog.get('error')).to.eq(err)

done()
Expand Down Expand Up @@ -328,7 +328,7 @@ describe('src/cy/commands/actions/submit', () => {
})

cy.on('fail', () => {
expect(this.logs.length).to.eq(3)
assertLogLength(this.logs, 3)

done()
})
Expand Down
@@ -1,3 +1,4 @@
const { assertLogLength } = require('../../../support/utils')
const { _, $ } = Cypress

describe('src/cy/commands/actions/trigger', () => {
Expand Down Expand Up @@ -1060,7 +1061,7 @@ describe('src/cy/commands/actions/trigger', () => {
cy.on('fail', (err) => {
const { lastLog } = this

expect(this.logs.length).to.eq(2)
assertLogLength(this.logs, 2)
expect(lastLog.get('error')).to.eq(err)

done()
Expand All @@ -1075,7 +1076,7 @@ describe('src/cy/commands/actions/trigger', () => {
cy.on('fail', (err) => {
const { lastLog } = this

expect(this.logs.length).to.eq(2)
assertLogLength(this.logs, 2)
expect(lastLog.get('error')).to.eq(err)
expect(err.message).to.include('`cy.trigger()` failed because this element is not visible')

Expand Down Expand Up @@ -1114,7 +1115,7 @@ describe('src/cy/commands/actions/trigger', () => {

it('throws when provided invalid position', function (done) {
cy.on('fail', (err) => {
expect(this.logs.length).to.eq(2)
assertLogLength(this.logs, 2)
expect(err.message).to.eq('Invalid position argument: `foo`. Position may only be topLeft, top, topRight, left, center, right, bottomLeft, bottom, bottomRight.')

done()
Expand All @@ -1125,7 +1126,7 @@ describe('src/cy/commands/actions/trigger', () => {

it('throws when provided invalid event type', function (done) {
cy.on('fail', (err) => {
expect(this.logs.length).to.eq(2)
assertLogLength(this.logs, 2)
expect(err.message).to.eq('Timed out retrying after 100ms: `cy.trigger()` `eventConstructor` option must be a valid event (e.g. \'MouseEvent\', \'KeyboardEvent\'). You passed: `FooEvent`')

done()
Expand Down Expand Up @@ -1175,7 +1176,7 @@ describe('src/cy/commands/actions/trigger', () => {

it('does not log an additional log on failure', function (done) {
cy.on('fail', () => {
expect(this.logs.length).to.eq(3)
assertLogLength(this.logs, 3)

done()
})
Expand Down

1 comment on commit 1e8dc00

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 1e8dc00 Nov 9, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the linux x64 version of the Test Runner.

Learn more about this pre-release platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/8.8.0/circle-9.0-release-1e8dc009d8477fc761d2ad45ff961e2d7fd423a2/cypress.tgz

Please sign in to comment.