β dom highlights need to account for box-sizing: border-box
πΆCookies CDP bug cypress-io/cypress#5297 - relies on Chrome Video Record PR
β selector playground keyboard shortcuts fix cypress-io/cypress#5285
β dom highlighting broken cypress-io/cypress#5299
πΆset top.onerror same as autWindow.onerror
β mouse dblclick, rightclick
- There is a new
.rightclick()
command that allows you to right click on elements. - We now trigger all appropriate mouse events on
.click()
.dbleclick()
such asmouseover
,pointerdown
and many others. - The click coordinates are now correctly printed to the console and drawn during snapshots when clicking inside an iframe element.
.dblclick()
now accepts the same options as.click()
command.screenY
andscreenX
are now sent appropriately for.trigger()
command.
- Needs a lot more comments
- Brian is hesitant to merge and wants to look more closely at the code.
β Chrome record video
Dependent on cypress-io/cypress#5209
β Accept βparamsβ to cy.visit()
// visits to http://localhost:3500/users?page=1&role=admin
cy.visit("http://localhost:3500/users", {
qs: {
page: '1',
role: 'admin'
}
})
// visits to http://example.com/users?page=1&admins
cy.visit("http://example.com/users?page=1", {
qs: { 'admins' }
})
β catch invalid env var
CYPRESS_ENV=foobar cypress run
-------
The environment variable with the reserved name "CYPRESS_ENV" is set.
Unset the "CYPRESS_ENV" environment variable and run Cypress again.
----------
CYPRESS_ENV=foo
----------
Platform: xxx
Cypress Version: 1.2.3
-------
- Change the second sentence in error to 'To fix this...'
- Actually I don't see this convention, so leaving as is.
β Fix async timeouts
Now tests with a done
callback will timeout (in defaultCommandTimeout
ms) after the last cy
command runs.
it('can timeout async test', function (done) {
// times out after 4000ms
})
it('can timeout async test after cypress command', function (done) {
cy.wait(1000)
// times out after 5000ms
})
it('does not timeout during cypress command', function (done) {
cy.get('.exists)
cy.then(() => done())
// does not time out
})
- Move all of the tests from runner_spec.js in async timeouts to an e2e test and actually evaluate the exit code. Brian doesn't like that we are 'modifying reality' by pulling out the error then returning false.
- Do not merge until this is changed.
β err msg for detached DOM
When you 'click' or do any action on an element, we now check for 'detached' before 'visibility. So the test below would fail before with just 'element was not visible', but now it will fail with 'element is detached'.
// will throw 'cy.click() failed because this element is detached from the DOM'
cy.get('input:first')
.should(($el) => {
$el[0].ownerDocument.addEventListener('scroll', () => {
$el.remove()
})
})
.click()
We now check that an element is attached to the DOM before checking if it is visible anywhere - this will give a more accurate error message.
cy.get('div').should('be.visible')
This element '<div>' is not visible because it is detached from the DOM
.should()
needs to be changed as per brian's feedback.- MERGE IN AFTER FEEDBACK.
β focus event updates
Fixed a bug where Cypress was sending focus
events to non-visible elements.
## normally programmatic focus calls cause "primed" focus/blur events if the window is not in focus
## so we fire fake events to act as if the window is always in focus
Elements that are hidden should not be focusable - BUT we should still send focus
events on input of 0x0
size or opacity:0
because these aren't 'hidden'.
isFocusableAndNotHidden
instead of genericisFocusable
parentHasDisplayNone
method - since you can't figure this out on the base el likevisibility: hidden
can
HTML els below will no longer be force focused.
<input style="visibility:hidden" id="no-focus-1"/>
<input style="display:none" id="no-focus-2"/>
<div style="visibility:hidden"><input id="no-focus-3"/></div>
<div style="display:none"><input id="no-focus-4"/></div>
- brian added some feedback directly to PR
- MERGE IN AFTER FEEDBACK.
β options.ensure
Essentially fixes the bug where you can not click on readonly
inputs.
- Broke out checks like
position
to be off an objectensure
, so we can writeensure.posision
,ensure.notDisabled
. - Broke out
ensureReceivability
into 2 checks:ensureNotReadonly
&ensureNotDisabled
.
β --config-file
- You can now pass an official
--config-file
flag to specify a different file to be used for Cypress configuration. You can also passfalse
to the--config-file
to not use any configuration file. - File does not have to be
.json
, but will throw the normal JSON syntax error later on when you try to run Cypress if it contains invalid JSON.
cypress run --help
-C, --config-file <config-file> path to JSON file where configuration values are set. defaults to "cypress.json". pass "false" to disable.
Updated all instances where we used to say 'cypress.json' to instead say your 'configuration fault' sometimes mentioning where the default is.
Errors if specified config file cannot be located and not a new project.
Could not find a Cypress configuration file, exiting.
We looked but did not find a foo.json file in this folder: path/to/folder
Does not create cypress.json
on initial build of project if configFile: false
.
- Address brian's comments on the PR.
- MERGE IN AFTER ADDRESSED.
β Max viewport now 4000 instead of 3000
cy.viewport() width and height must be between 20px and 4000px.
β Use node path from configFile
{
"nodeVersion": "bundled"
}
{
"nodeVersion": "system"
}
run stdout indicates node version
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Cypress: 1.2.3 β
β Browser: FooBrowser 88 β
β Node Version: v0.0.0 (bundled with Cypress) β
β Specs: 1 found (base_url_spec.coffee) β
β Searched: cypress/integration/base_url_spec.coffee β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Errors when system NodeVersion can't be found
`nodeVersion` is set to `system`, but Cypress could not find a usable Node executable on your PATH.
Make sure that your Node executable exists and can be run by the current user.
Cypress will use the built-in Node version (v#{arg1}) instead.
β Fix gzipped utf-8 .js files getting corrupted
β Truncate httpprops in error message to 2000 chars instead of 100
Before
Method: GET
URL: http://localhost:2294/myreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyre...
Headers: {
"Connection": "keep-alive",
"user-agent": "foo",
"accept": "*/*",
"accept-encoding": "gzip, deflate"
}
-----------------------------------------------------------
The response we got was:
Status: 404 - Not Found
Headers: {
"x-powered-by": "Express",
"content-security-policy": "default-src 'self'",
"x-content-type-options": "nosniff",
"content-type": "text/html; charset=utf-8",
"content-length": "301",
"date": "Fri, 18 Aug 2017 XX:XX GMT",
"connection": "keep-alive"
}
Body: <!DOCTYPE html>
<html lang="en">
<head>
<meta...
After
Method: GET
URL: http://localhost:2294/myreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallylong
Headers: {
"Connection": "keep-alive",
"user-agent": "foo",
"accept": "*/*",
"accept-encoding": "gzip, deflate"
}
-----------------------------------------------------------
The response we got was:
Status: 404 - Not Found
Headers: {
"x-powered-by": "Express",
"content-security-policy": "default-src 'self'",
"x-content-type-options": "nosniff",
"content-type": "text/html; charset=utf-8",
"content-length": "301",
"date": "Fri, 18 Aug 2017 XX:XX GMT",
"connection": "keep-alive"
}
Body: <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Error</title>
</head>
<body>
<pre>Cannot GET /myreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallylong</pre>
</body>
β Keyboard shortcuts in the Test Runner
- pressing the R key restarts the tests
- pressing the S key stops the tests
- pressing F focuses the spec files window
list of browsers to plugins
Pass list of available browsers through plugins/index.js
- with options to control its display.
module.exports = (on, config) => {
// remove "standard" browsers and use
// our local Electron as a browser
config.browsers = [
{
name: 'electron-app',
family: 'electron-app',
displayName: 'Local Electron app',
version: '1.2.3',
path: 'foo/bar/baz/path,
// show full package version in the browser dropdown
majorVersion: `v${pkg.version}`,
info: 'Electron.js app that supports the Cypress launcher'
}
]
return config
}
- We would rather there be a method call called
setBrowser
orsetBrowsers
so that we could actually do some validation. You could mutate it and just completely mess up the launching of Cypress browser. - Need type definitions.
- Do not move forward until this is change to API is made.
Add padding support to element screenshot
// expands screenshot 10 pixels beyond boundaries of el
cy.get('.input').screenshot({ padding: 10 })
// expands screenshot -10 pixels beyond boundaries of el
cy.get('.input').screenshot({ padding: -10 })
// expands screenshot by 4 on each side, 10 on each top/bottom
cy.get('.input').screenshot({ padding: [4, 10, 4, 10] })
.screenshot() 'padding' option must be either a number or an array of numbers with a length between 1 and 4. You passed: foo
Throws if you are attempting to screenshot an element that is 0 height/width. I asked them to update wording of message to:
It was not possible to take a screenshot, since the height and/or width of the screenshot area was zero.
- 'padding' and API is fine - move forward with making this work.
- Needs code changes and more thorough review.
ansi_up upgrade
reduce effect of npm silent loglevel
β Hide new NODE_TLS_REJECT_UNAUTHORIZED warning
β run driver-integration tests in electron as well
type fixes
- Requires cypress-io/cypress#3030 be merged first.
- Can now target any focusable target with
.type()
, supports some weird things people should have legitimately been able to type into. - Using
.type()
incontenteditable
rich text editors should now have a much better experience. - Throws better error message on what is 'focusable'
- Fixed bug where Cypress was not using the correct property getter for
maxLength
during type validation.
Doing some refactoring from Jen's PR comments
- Did not review
Tags for grouping
- Allow
--tag
flag to pass one or multiple tags per run
Display in --help
tag: 'named tag(s) for recorded runs in the Cypress Dashboard',
Allow comma-separated list of tags
cypress run --tag a b c d e f g --spec h i j k l
Warn when space-separated list of tags
Warning: It looks like you're passing --tag a space-separated list of arguments:
"a b c d e f g"
This will work, but it's not recommended.
If you are trying to pass multiple arguments, separate them with commas instead:
cypress run --tag arg1,arg2,arg3
Displays tag in run stdout
β Browser: FooBrowser 88 β
β Specs: 1 found (record_pass_spec.coffee) β
β Searched: cypress/integration/record_pass* β
β Params: Tag: nightly, Group: foo-bar, Parallel: true β
β Run URL: https://dashboard.cypress.io/#/projects/cjvoj7/runs/12 β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Error on CI when not passing --record
You passed the --ci-build-id, --group, --tag, or --parallel flag without also passing the --record flag.
The --tag flag you passed was: nightly
The --group flag you passed was: e2e-tests
These flags can only be used when recording to the Cypress Dashboard service.
Added tag to other CI errors where we were listing params:
The --tag flag you passed was: nightly
The --group flag you passed was: electron-smoke-tests
The --ciBuildId flag you passed was: ciBuildId123
- Did not review - want to wait for Services team work first.