diff --git a/package-lock.json b/package-lock.json index df3b3e112c..b555ea4892 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2688,9 +2688,9 @@ } }, "@types/jest": { - "version": "24.0.15", - "resolved": "https://registry.npmjs.org/@types/jest/-/jest-24.0.15.tgz", - "integrity": "sha512-MU1HIvWUme74stAoc3mgAi+aMlgKOudgEvQDIm1v4RkrDudBh1T+NFp5sftpBAdXdx1J0PbdpJ+M2EsSOi1djA==", + "version": "24.0.16", + "resolved": "https://registry.npmjs.org/@types/jest/-/jest-24.0.16.tgz", + "integrity": "sha512-JrAiyV+PPGKZzw6uxbI761cHZ0G7QMOHXPhtSpcl08rZH6CswXaaejckn3goFKmF7M3nzEoJ0lwYCbqLMmjziQ==", "dev": true, "requires": { "@types/jest-diff": "*" @@ -5353,9 +5353,9 @@ } }, "cypress": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/cypress/-/cypress-3.4.0.tgz", - "integrity": "sha512-vUE+sK3l23fhs5qTN3dKpveyP0fGr37VmK3FSYaTEjbqC/qh4DbA1Ych/3bLStUpHP4rpE5KAx7i1s/tpdD9vQ==", + "version": "3.4.1", + "resolved": "https://registry.npmjs.org/cypress/-/cypress-3.4.1.tgz", + "integrity": "sha512-1HBS7t9XXzkt6QHbwfirWYty8vzxNMawGj1yI+Fu6C3/VZJ8UtUngMW6layqwYZzLTZV8tiDpdCNBypn78V4Dg==", "dev": true, "requires": { "@cypress/listr-verbose-renderer": "0.4.1", @@ -5373,12 +5373,11 @@ "extract-zip": "1.6.7", "fs-extra": "5.0.0", "getos": "3.1.1", - "glob": "7.1.3", "is-ci": "1.2.1", "is-installed-globally": "0.1.0", "lazy-ass": "1.6.0", "listr": "0.12.0", - "lodash": "4.17.11", + "lodash": "4.17.15", "log-symbols": "2.2.0", "minimist": "1.2.0", "moment": "2.24.0", @@ -5458,9 +5457,9 @@ "dev": true }, "glob": { - "version": "7.1.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", - "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", + "version": "7.1.4", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz", + "integrity": "sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A==", "dev": true, "requires": { "fs.realpath": "^1.0.0", @@ -5480,12 +5479,6 @@ "ci-info": "^1.5.0" } }, - "lodash": { - "version": "4.17.11", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", - "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", - "dev": true - }, "punycode": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz", diff --git a/package.json b/package.json index 72504725a7..0e4762ba6e 100644 --- a/package.json +++ b/package.json @@ -82,7 +82,7 @@ "@cypress/questions-remain": "1.0.1", "@keyv/redis": "github:bahmutov/keyv-redis#b64f44cd1d1e87893d989b1469068af8292299d5", "@types/fluent-ffmpeg": "2.1.10", - "@types/jest": "24.0.15", + "@types/jest": "24.0.16", "beeper": "2.0.0", "bin-up": "1.2.0", "chai": "4.2.0", @@ -92,7 +92,7 @@ "colors": "1.3.3", "common-tags": "1.8.0", "concurrent-transform": "1.0.0", - "cypress": "3.4.0", + "cypress": "3.4.1", "dependency-check": "3.4.1", "deps-ok": "1.4.1", "eslint": "6.1.0", diff --git a/source/faq/questions/using-cypress-faq.md b/source/faq/questions/using-cypress-faq.md index 58e5501b83..e90d0d54d0 100644 --- a/source/faq/questions/using-cypress-faq.md +++ b/source/faq/questions/using-cypress-faq.md @@ -203,6 +203,23 @@ describe('The Document Metadata', () => { }) ``` +## {% fa fa-angle-right %} Can I check that a form's HTML form validation is shown when an input is invalid? + +You certainly can. + +```javascript +it('check validation message on invalid input', () => { + cy.get('input:invalid').should('have.length', 0) + cy.get('[type="email"]').type('not_an_email') + cy.get('[type="submit"]').click() + cy.get('input:invalid').should('have.length', 1) + cy.get('[type="email"]').then(($input) => { + expect($input[0].validationMessage).to.eq('I expect an email!') + }) +}) +``` + + ## {% fa fa-angle-right %} Can I throttle network speeds using Cypress? You can throttle your network connection by accessing your Developer Tools Network panel. Additionally, you can add your own custom presets by selecting **Custom > Add** from the Network Conditions drawer. diff --git a/source/guides/guides/continuous-integration.md b/source/guides/guides/continuous-integration.md index 2ea0c18566..691ef28a7a 100644 --- a/source/guides/guides/continuous-integration.md +++ b/source/guides/guides/continuous-integration.md @@ -348,7 +348,7 @@ See our {% url 'examples' docker %} for additional information on our maintained If you are not using one of the above CI providers then make sure your system has these dependencies installed. ```shell -apt-get install xvfb libgtk2.0-0 libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2 +apt-get install xvfb libgtk-3-dev libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2 ``` ## Caching diff --git a/source/ja/_changelogs/3.4.1.md b/source/ja/_changelogs/3.4.1.md index b8c4b9a041..bc665770e4 100644 --- a/source/ja/_changelogs/3.4.1.md +++ b/source/ja/_changelogs/3.4.1.md @@ -8,28 +8,32 @@ **Bugfixes:** -- We upgraded the `lodash` dependency to fix the security vulnerability warning. Fixes {% issue 4699 %}, {% issue 4730 %}, {% issue 4743 %}. -- Videos that were stopping recording prematurely before the test results were fully displayed should now record until all test results are displayed. Fixes {% issue 2370 %}. -- We fixed a bug where pages using non-UTF-8 character encoding would become corrupted when opened in Cypress. Fixes {% issue 3479 %}, {% issue 1543 %}, and {% issue 3650 %}. -- Fixed a regression introduced in {% url "3.4.0" changelog#3-4-0 %} that caused an error to be thrown when using the `and` chainable getter. Fixes {% issue 4833 %}. +- Fixed a bug where the content of pages using non-UTF-8 character encoding would become corrupted when opened in Cypress. Fixes {% issue 3479 %}, {% issue 1543 %}, and {% issue 3650 %}. +- Fixed a regression introduced in {% url "3.4.0" changelog#3-4-0 %} that caused an error to be thrown when chaining together multiple assertions using the `and` chainable getter. Fixes {% issue 4833 %}. - The `include` and `includes` assertion chainers now correctly work the same as `contain` and `contains` assertion chainers. Fixes {% issue 4833 %}. -- Cypress now correctly runs when there is no internet connection on Windows when testing a localhost URL. Fixes {% issue 4763 %}. -- We now check for the `readonly` attribute when seeing if an attribute is typeable during {% url "`cy.type()`" type %}. Fixes {% issue 1246 %}. -- Variables beginning with `top` and `location` in the application under test are no longer modified when `modifyObstructiveCode` is `true`. Fixes {% issue 4794 %}. -- We removed erroneous socket connections when there is no browser running. Fixes {% issue 4776 %}. -- We upgraded the `mocha-teamcity-reporter` dependency so that it no longer errors in certain situations when trying to access duration. Fixes {% issue 4654 %}. +- Cypress now correctly works offline on Windows when visiting a localhost URL. Fixes {% issue 4763 %}. +- {% url "`cy.type()`" type %} now factors in the `readonly` property of `` elements, and will wait for this property to be `false` before attempting to type. Fixes {% issue 1246 %}. +- Variables beginning with `top` and `location` in your application code are no longer modified when `modifyObstructiveCode` is `true`. Fixes {% issue 4794 %}. +- We removed erroneous socket connections when the browser is initially launching. Fixes {% issue 4776 %}. +- Fixed a bug when dismissing pinned snapshots that would cause the page to be wiped with nothing rendered. Fixes {% issue 4864 %}. +- We upgraded the `mocha-teamcity-reporter` dependency so that it no longer errors in certain situations when trying to access duration on tests. Fixes {% issue 4654 %}. +- We upgraded the `lodash` dependency to fix a security vulnerability warning. Fixes {% issue 4699 %}, {% issue 4730 %}, {% issue 4743 %}. **Misc:** -- Cypress now looks for any npm proxy configurations when no other system proxy configuration is found. Addresses {% issue 4719 %}. -- We updated the messaging when there is a failure when downloading Cypress to recommend checking your proxy settings. Addresses {% issue 1662 %}. -- A warning message now displays if you attempt to run the Cypress binary directly (not as an `npm` package). Addresses {% issue 1573 %}. -- There are newly added examples in the types for {% url "custom commands" custom-commands %}, {% url "`cy.location`" location %} and {% url "`.should()`" should %}. Addresses {% issue 3684 %} and {% issue 4715 %}. +- We now ensure we are shipping with production versions of dependencies such as `react`, `mobx`, etc. This should help to prevent conflicts with Developer Tools extensions and increase performance by reducing memory, heap allocation, and overall JS bundle size. Addresses {% issue 4844 %}. +- Video recordings now wait after all tests finish to ensure that the video captures the final rendered frames of the browser. This prevents the last few paints from being cut off. Fixes {% issue 2370 %}. +- Cypress now looks for any npm proxy configuration values as a fallback when no other system proxy configuration is found. This brings this feature into parity with how npm reads off proxy configuration values during an `npm install`. Addresses {% issue 4719 %}. +- We updated the messaging when there is a failure downloading Cypress to recommend checking your proxy settings. Addresses {% issue 1662 %}. +- A warning message now displays if you attempt to run the Cypress binary directly instead of going through the cypress `npm` package. Addresses {% issue 1573 %}. +- There are newly added examples in the TypeScript definitions for {% url "custom commands" custom-commands %}, {% url "`cy.location()`" location %} and {% url "`.should()`" should %}. Addresses {% issue 3684 %} and {% issue 4715 %}. - The types for the {% url "`cy.contains(content, options)`" contains %} syntax have been added. Addresses {% issue 4727 %}. - Types for `cy.once()` have been added. Addressed in {% PR 4788 %}. +- There is now a `{ parseSpecialCharSequences: false }` option to {% url "`cy.type()`" type %} that disables parsing the special character sequences found between the `{}` characters. This will now type what you've provided literally without any special parsing. Fixes {% issue 4287 %}. - You can now zoom in the main Test Runner window and also the Electron browser. Corresponding keyboard shortcuts for Zoom in, Zoom out and Actual Size are also available. Addresses {% issue 1231 %}. - When viewing the Test Runner's main window at its smallest size, the header text no longer incorrectly wraps. Addresses {% issue 86 %}. - We're continuing to make process in converting our codebase from CoffeeScript to JavaScript. Addresses {% issue 2690 %} in {% PR 4781 %} and {% PR 4817 %}. +- We increased the cypress binary verification phase from 10 seconds to 30 seconds to accomodate underpowered or overwhelmed machines typically found in CI environments. Addresses {% issue 4624 %}. **Documentation Changes:** @@ -37,10 +41,8 @@ - Updated instructions for adding types for custom commands in the {% url "TypeScript Support" typescript-support#Types-for-custom-commands %} doc. Addressed in {% url "#1901" https://github.com/cypress-io/cypress-documentation/pull/1901 %} - Added a section about video encoding and how to speed up the encoding time to {% url "Screenshots and Videos" screenshots-and-videos#Video-encoding %} doc. Addressed in {% url "#1880" https://github.com/cypress-io/cypress-documentation/pull/1880 %} - **Dependency Updates** -- We now ensure we are shipping with production versions of dependencies. This should prevent conflicts with development versions in the application under test and increase performance by avoiding potential memory issues. Addresses {% issue 4844 %}. - Upgraded `@ffmpeg-installer/ffmpeg` from `1.0.17` to `1.0.19`. Addressed in {% PR 4792 %}. - Upgraded `browserify` from `13.3.0` to `16.3.0`. Addressed in {% PR 4751 %}, {% PR 4825 %} and {% PR 4826 %}. - Upgraded `data-uri-to-buffer` from `1.2.0` to `2.0.1`. Addressed in {% PR 4622 %}. diff --git a/source/ja/faq/questions/using-cypress-faq.md b/source/ja/faq/questions/using-cypress-faq.md index b51058f17b..a3ac4f542b 100644 --- a/source/ja/faq/questions/using-cypress-faq.md +++ b/source/ja/faq/questions/using-cypress-faq.md @@ -203,6 +203,23 @@ describe('The Document Metadata', () => { }) ``` +## {% fa fa-angle-right %} Can I check that a form's HTML form validation is shown when an input is invalid? + +You certainly can. + +```javascript +it('check validation message on invalid input', () => { + cy.get('input:invalid').should('have.length', 0) + cy.get('[type="email"]').type('not_an_email') + cy.get('[type="submit"]').click() + cy.get('input:invalid').should('have.length', 1) + cy.get('[type="email"]').then(($input) => { + expect($input[0].validationMessage).to.eq('I expect an email!') + }) +}) +``` + + ## {% fa fa-angle-right %} Can I throttle network speeds using Cypress? You can throttle your network connection by accessing your Developer Tools Network panel. Additionally, you can add your own custom presets by selecting **Custom > Add** from the Network Conditions drawer. diff --git a/source/ja/guides/guides/continuous-integration.md b/source/ja/guides/guides/continuous-integration.md index bd671086fa..1c37cdbf5d 100644 --- a/source/ja/guides/guides/continuous-integration.md +++ b/source/ja/guides/guides/continuous-integration.md @@ -324,7 +324,7 @@ See our {% url 'examples' docker %} for additional information on our maintained If you are not using one of the above CI providers then make sure your system has these dependencies installed. ```shell -apt-get install xvfb libgtk2.0-0 libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2 +apt-get install xvfb libgtk-3-dev libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2 ``` ## Caching diff --git a/source/zh-cn/_changelogs/3.4.1.md b/source/zh-cn/_changelogs/3.4.1.md index f2c7376935..bc665770e4 100644 --- a/source/zh-cn/_changelogs/3.4.1.md +++ b/source/zh-cn/_changelogs/3.4.1.md @@ -8,28 +8,32 @@ **Bugfixes:** -- We upgraded the `lodash` dependency to fix the security vulnerability warning. Fixes {% issue 4699 %}, {% issue 4730 %}, {% issue 4743 %}. -- Videos that were stopping recording prematurely before the test results were fully displayed should now record until all test results are displayed. Fixes {% issue 2370 %}. -- We fixed a bug where pages using non-UTF-8 character encoding would become corrupted when opened in Cypress. Fixes {% issue 3479 %}, {% issue 1543 %}, and {% issue 3650 %}. -- Fixed a regression introduced in {% url "3.4.0" changelog#3-4-0 %} that caused an error to be thrown when using the `and` chainable getter. Fixes {% issue 4833 %}. +- Fixed a bug where the content of pages using non-UTF-8 character encoding would become corrupted when opened in Cypress. Fixes {% issue 3479 %}, {% issue 1543 %}, and {% issue 3650 %}. +- Fixed a regression introduced in {% url "3.4.0" changelog#3-4-0 %} that caused an error to be thrown when chaining together multiple assertions using the `and` chainable getter. Fixes {% issue 4833 %}. - The `include` and `includes` assertion chainers now correctly work the same as `contain` and `contains` assertion chainers. Fixes {% issue 4833 %}. -- Cypress now correctly runs when there is no internet connection on Windows when testing a localhost URL. Fixes {% issue 4763 %}. -- We now check for the `readonly` attribute when seeing if an attribute is typeable during {% url "`cy.type()`" type %}. Fixes {% issue 1246 %}. -- Variables beginning with `top` and `location` in the application under test are no longer modified when `modifyObstructiveCode` is `true`. Fixes {% issue 4794 %}. -- We removed erroneous socket connections when there is no browser running. Fixes {% issue 4776 %}. -- We upgraded the `mocha-teamcity-reporter` dependency so that it no longer errors in certain situations when trying to access duration. Fixes {% issue 4654 %}. +- Cypress now correctly works offline on Windows when visiting a localhost URL. Fixes {% issue 4763 %}. +- {% url "`cy.type()`" type %} now factors in the `readonly` property of `` elements, and will wait for this property to be `false` before attempting to type. Fixes {% issue 1246 %}. +- Variables beginning with `top` and `location` in your application code are no longer modified when `modifyObstructiveCode` is `true`. Fixes {% issue 4794 %}. +- We removed erroneous socket connections when the browser is initially launching. Fixes {% issue 4776 %}. +- Fixed a bug when dismissing pinned snapshots that would cause the page to be wiped with nothing rendered. Fixes {% issue 4864 %}. +- We upgraded the `mocha-teamcity-reporter` dependency so that it no longer errors in certain situations when trying to access duration on tests. Fixes {% issue 4654 %}. +- We upgraded the `lodash` dependency to fix a security vulnerability warning. Fixes {% issue 4699 %}, {% issue 4730 %}, {% issue 4743 %}. **Misc:** -- Cypress now looks for any npm proxy configurations when no other system proxy configuration is found. Addresses {% issue 4719 %}. -- We updated the messaging when there is a failure when downloading Cypress to recommend checking your proxy settings. Addresses {% issue 1662 %}. -- A warning message now displays if you attempt to run the Cypress binary directly (not as an `npm` package). Addresses {% issue 1573 %}. -- There are newly added examples in the types for {% url "custom commands" custom-commands %}, {% url "`cy.location`" location %} and {% url "`.should()`" should %}. Addresses {% issue 3684 %} and {% issue 4715 %}. +- We now ensure we are shipping with production versions of dependencies such as `react`, `mobx`, etc. This should help to prevent conflicts with Developer Tools extensions and increase performance by reducing memory, heap allocation, and overall JS bundle size. Addresses {% issue 4844 %}. +- Video recordings now wait after all tests finish to ensure that the video captures the final rendered frames of the browser. This prevents the last few paints from being cut off. Fixes {% issue 2370 %}. +- Cypress now looks for any npm proxy configuration values as a fallback when no other system proxy configuration is found. This brings this feature into parity with how npm reads off proxy configuration values during an `npm install`. Addresses {% issue 4719 %}. +- We updated the messaging when there is a failure downloading Cypress to recommend checking your proxy settings. Addresses {% issue 1662 %}. +- A warning message now displays if you attempt to run the Cypress binary directly instead of going through the cypress `npm` package. Addresses {% issue 1573 %}. +- There are newly added examples in the TypeScript definitions for {% url "custom commands" custom-commands %}, {% url "`cy.location()`" location %} and {% url "`.should()`" should %}. Addresses {% issue 3684 %} and {% issue 4715 %}. - The types for the {% url "`cy.contains(content, options)`" contains %} syntax have been added. Addresses {% issue 4727 %}. - Types for `cy.once()` have been added. Addressed in {% PR 4788 %}. +- There is now a `{ parseSpecialCharSequences: false }` option to {% url "`cy.type()`" type %} that disables parsing the special character sequences found between the `{}` characters. This will now type what you've provided literally without any special parsing. Fixes {% issue 4287 %}. - You can now zoom in the main Test Runner window and also the Electron browser. Corresponding keyboard shortcuts for Zoom in, Zoom out and Actual Size are also available. Addresses {% issue 1231 %}. - When viewing the Test Runner's main window at its smallest size, the header text no longer incorrectly wraps. Addresses {% issue 86 %}. - We're continuing to make process in converting our codebase from CoffeeScript to JavaScript. Addresses {% issue 2690 %} in {% PR 4781 %} and {% PR 4817 %}. +- We increased the cypress binary verification phase from 10 seconds to 30 seconds to accomodate underpowered or overwhelmed machines typically found in CI environments. Addresses {% issue 4624 %}. **Documentation Changes:** @@ -39,7 +43,6 @@ **Dependency Updates** -- We now ensure we are shipping with production versions of dependencies. This should prevent conflicts with development versions in the application under test and increase performance by avoiding potential memory issues. Addresses {% issue 4844 %}. - Upgraded `@ffmpeg-installer/ffmpeg` from `1.0.17` to `1.0.19`. Addressed in {% PR 4792 %}. - Upgraded `browserify` from `13.3.0` to `16.3.0`. Addressed in {% PR 4751 %}, {% PR 4825 %} and {% PR 4826 %}. - Upgraded `data-uri-to-buffer` from `1.2.0` to `2.0.1`. Addressed in {% PR 4622 %}. diff --git a/source/zh-cn/faq/questions/using-cypress-faq.md b/source/zh-cn/faq/questions/using-cypress-faq.md index 5e61f3c136..e90d0d54d0 100644 --- a/source/zh-cn/faq/questions/using-cypress-faq.md +++ b/source/zh-cn/faq/questions/using-cypress-faq.md @@ -203,6 +203,23 @@ describe('The Document Metadata', () => { }) ``` +## {% fa fa-angle-right %} Can I check that a form's HTML form validation is shown when an input is invalid? + +You certainly can. + +```javascript +it('check validation message on invalid input', () => { + cy.get('input:invalid').should('have.length', 0) + cy.get('[type="email"]').type('not_an_email') + cy.get('[type="submit"]').click() + cy.get('input:invalid').should('have.length', 1) + cy.get('[type="email"]').then(($input) => { + expect($input[0].validationMessage).to.eq('I expect an email!') + }) +}) +``` + + ## {% fa fa-angle-right %} Can I throttle network speeds using Cypress? You can throttle your network connection by accessing your Developer Tools Network panel. Additionally, you can add your own custom presets by selecting **Custom > Add** from the Network Conditions drawer. @@ -447,7 +464,7 @@ describe('Logo', () => { The code you write in Cypress is executed in the browser, so you can import or require JS modules, *but* only those that work in a browser. -You can `require` or `import` them as you're accustomed to. We preprocess your spec files with Babel and Browserify. +You can `require` or `import` them as you're accustomed to. We preprocess your spec files with `babel` and `browserify`. Cypress does not have direct access to Node or your file system. We recommend utilizing one of the following to execute code outside of the browser: diff --git a/source/zh-cn/guides/guides/continuous-integration.md b/source/zh-cn/guides/guides/continuous-integration.md index a8a3183265..3540d31093 100644 --- a/source/zh-cn/guides/guides/continuous-integration.md +++ b/source/zh-cn/guides/guides/continuous-integration.md @@ -324,7 +324,7 @@ Error: the cypress binary is not installed 如果你没有使用以上的CI提供商,那么请确保你的系统已经安装如下依赖: ```shell -apt-get install xvfb libgtk2.0-0 libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2 +apt-get install xvfb libgtk-3-dev libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2 ``` ## 缓存