This repository was archived by the owner on Mar 4, 2020. It is now read-only.
Merged
Conversation
kuzhelov
commented
Jun 3, 2019
package.json
Outdated
| "syncpack": "^4.3.1", | ||
| "through2": "^2.0.3", | ||
| "tmp": "^0.0.33", | ||
| "ts-jest": "^24.0.2", |
Contributor
Author
There was a problem hiding this comment.
used to transpile code of jest tests - should be removed after fixes for Babel config will be merged @layershifter
Codecov Report
@@ Coverage Diff @@
## master #1438 +/- ##
=======================================
Coverage 73.14% 73.14%
=======================================
Files 805 805
Lines 6073 6073
Branches 1794 1794
=======================================
Hits 4442 4442
Misses 1625 1625
Partials 6 6Continue to review full report at Codecov.
|
Collaborator
Generated by 🚫 dangerJS |
layershifter
reviewed
Jun 3, 2019
layershifter
reviewed
Jun 3, 2019
…into feat/e2e-tests
layershifter
approved these changes
Jun 4, 2019
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR introduces support for in-browser tests to the project.
Command to run in-browser tests
yarn test:e2eThis command is also introduced as part of CI checks chain.
Flags
--skip-build- disables prior (re)build of Docs site which end-to-end tests are running against.How things work
All the test files reside under
e2e/testsdirectory of the project. These test files are identical to the ones already written for unit tests, with only difference is thate2eglobal object is provided as an entry point for browser API.This global
e2eobject serves as a thin wrapper on top ofpuppeteer'sAPI, and should be used as a single client's entry point to simulate browser stuff: clicks, focus and keyboard events.Test cases introduced
Couple of
Dropdowntest cases that were not possible to cover with unit tests (from #1201 - both are related to focus behavior scenarios) were introduced.Implementation considerations
Tests are optimised at maximum degree - thin wrapper (
puppeteer) on top of Chromium API is used, as well as performant Jest runner. In comparison to Cypress-based implementation: there is a 7-10 times improvement of tests' running times, as well as full set of API capabilities provided bypuppeteerto simulate browser scenarios.Other improvements
Duplicated logic used for gulp tasks has been fetched and refactored:
servemodule is introduced to encapsulate imperative code of scaffoldingexpressservergulp-jestplugin is introduced to easily embed Jest tests into Gulp chains