Skip to content
This repository was archived by the owner on Mar 4, 2020. It is now read-only.

feat: e2e tests#1438

Merged
kuzhelov merged 23 commits intomasterfrom
feat/e2e-tests
Jun 6, 2019
Merged

feat: e2e tests#1438
kuzhelov merged 23 commits intomasterfrom
feat/e2e-tests

Conversation

@kuzhelov
Copy link
Contributor

@kuzhelov kuzhelov commented Jun 3, 2019

This PR introduces support for in-browser tests to the project.

Command to run in-browser tests

yarn test:e2e

This 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/tests directory of the project. These test files are identical to the ones already written for unit tests, with only difference is that e2e global object is provided as an entry point for browser API.

This global e2e object serves as a thin wrapper on top of puppeteer's API, 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 Dropdown test 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 by puppeteer to simulate browser scenarios.

Other improvements

Duplicated logic used for gulp tasks has been fetched and refactored:

  • serve module is introduced to encapsulate imperative code of scaffolding express server
  • gulp-jest plugin is introduced to easily embed Jest tests into Gulp chains

package.json Outdated
"syncpack": "^4.3.1",
"through2": "^2.0.3",
"tmp": "^0.0.33",
"ts-jest": "^24.0.2",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

used to transpile code of jest tests - should be removed after fixes for Babel config will be merged @layershifter

@codecov
Copy link

codecov bot commented Jun 3, 2019

Codecov Report

Merging #1438 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           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        6

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 47ec1fd...38f3d21. Read the comment docs.

@DustyTheBot
Copy link
Collaborator

Warnings
⚠️ There are no updates provided to CHANGELOG. Ensure there are no publicly visible changes introduced by this PR.

Generated by 🚫 dangerJS

@kuzhelov kuzhelov merged commit dda099d into master Jun 6, 2019
@delete-merged-branch delete-merged-branch bot deleted the feat/e2e-tests branch June 6, 2019 17:13
@kuzhelov kuzhelov mentioned this pull request Jun 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants