Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DOCS] Add missing docs for testing tutorial #88

Closed
4 tasks
scarletfog opened this issue Nov 27, 2019 · 8 comments
Closed
4 tasks

[DOCS] Add missing docs for testing tutorial #88

scarletfog opened this issue Nov 27, 2019 · 8 comments
Assignees

Comments

@scarletfog
Copy link

Description

We miss the docs for testing tutorial in official documentation. We should describe how the following scripts work, and their effects:

  • test:e2e.dump
  • test:mobile.dump
  • test:production.dump
  • test:walkontable.dump

Additional note:
Maybe worth adding to README.md || CONTRIBUTING.md || package.json as a comment

Links

https://handsontable.com/docs/7.2.2/tutorial-testing.html

@budnix
Copy link
Member

budnix commented Nov 27, 2019

npm run:

  • clean Cleans/Removes commonjs, es, coverage and tmp directories, a side effects of the building process;
  • lint Checkes gramma rules for JS and CSS files;
  • lint:fix Fixes all gramma rules for JS and CSS files found by eslint and stylelint;
  • stylelint Checks gramma rules for CSS files;
  • stylelint:fix Fixes all gramma rules for CSS files;
  • eslint Checks gramma rules for CSS files;
  • eslint:fix Fixes all gramma rules for CSS files;
  • test.random Runs all tests (Unit tests, Walkontable E2E, Handsontable E2E and Handsontable using minfiied version files tests and TypeScript Tests) in random order;
  • test:walkontable Builds Walkontable to UMD format and runs all Walkontable E2E tests in headless browser;
  • test:walkontable.random The same as above but in random order;
  • test:walkontable.watch The same as above but in watch mode. The watcher triggers the tests on both; changed source code and change tests;
  • test:walkontable.dump Generates all E2E tests for Walkontable into src/3rdparty/walkontable/test/SpecRunner.html file;
  • test:walkontable.puppeteer Runs generated runner (src/3rdparty/walkontable/test/SpecRunner.html) with the headless browser;
  • test:production Build UMD minified files with dependencies included to that file and run all E2E tests in the headless browser;
  • test:production.random The same as above but in random order;
  • test:production.dump Generates runner file test/E2ERunner.html but with an included minified (with dependencies included to that) version of the Handsontable (hadsnontable.full.min.js, hadsnontable.full.min.css). This tests checks if the minifier minifies the code correctly;
  • test:e2e Builds UMD files of the Handsontable, then builds languages, generates HTML file with E2E tests and runs on the headless browser;
  • test:e2e.random The same as above but in random order;
  • test:e2e.dump Generates runner file test/E2ERunner.html but with included not minified and without included dependencies version of the Handsontable (hadsnontable.js, hadsnontable.css). This tests checks if the UMD files are works correctly;
  • test:e2e.watch Watch mode; The watcher triggers the tests on both; changed source code and change tests;
  • test:e2e.puppeteer Runs generated runner file (test/E2ERunner.html) with headless browser;
  • test:unit Runs unit tests;
  • test:unit.watch Unit tests in random;
  • test:mobile.dump Generates tests for mobile devices into test/MobileRunner.html;
  • test:types Runs tests which test if the TS definition works;
  • watch Build the Handsontable in watch mode.
  • build General build script. It generates UMD files in dist/ directory, for CommonJS (NodeJS) in commonjs/ directory and for ES6+ in the es/ directory. Additionally, languages are rebuilding while running that script;
  • build:umd Builds only UMD files;
  • build:umd.min Builds only UMD files and minifies them;
  • build:commonjs Builds only commonjs files;
  • build:es Builds only ES files;
  • build:walkontable Builds only UMD files for Walkontable, necessary only for tests;
  • build:language Builds languages files into dist/languages and languages directories;
  • build:language.min Builds languages and minifies them;

@budnix
Copy link
Member

budnix commented Nov 27, 2019

Additionally, we support --testPathPattern argument which works for some test scripts. That argument is very useful for testing only specific test files, which of course decreases the time needed to test a feature.

E.q.

  • npm run test:e2e--testPathPattern=filtersUI Generates runner with filtered tests and run in the headless browser;
  • npm run test:e2e.dump --testPathPattern=filtersUI Dumps tests to file only for FilterUI tests;
  • npm run test:e2e.watch --testPathPattern=filtersUI The same but it watches tests files and source code for changes. If it detect the changes script run the tests;

The same with unit tests:

  • npm run test:unit --testPathPattern=map Runs the tests filtered by path pattern;
  • npm run test:unit.watch --testPathPattern=map Watch the tests;

Unit tests are supported by Jest library. No runner file is necessary to test that type of tests.

@scarletfog
Copy link
Author

@budnix thank you so much for your precious help!

@aninde
Copy link
Contributor

aninde commented Jan 13, 2020

Dumped files are constructed to be fired from the server, not locally from the file://...

@aninde
Copy link
Contributor

aninde commented Jan 14, 2020

Flow to test walkontable in the browser:

git checkout master
git pull
rimraf node_modules - to be sure that environment is clear
npm i
npm run build
npm run build:walkontable
npm run test:walkontable.dump
serve
http://localhost:5000/src/3rdparty/walkontable/test/SpecRunner

@aninde
Copy link
Contributor

aninde commented Feb 4, 2020

The mobile test does not pass anywhere, so I wouldn't brag about them in our documentation. I reported it so as not to forget quality/#23

@aninde
Copy link
Contributor

aninde commented Jan 7, 2021

The order of threads is to be improved since
image
is above the description of how to generate these described files.

@aninde aninde self-assigned this Jan 26, 2021
@aninde aninde transferred this issue from another repository Jan 26, 2021
@aninde aninde transferred this issue from handsontable/quality Jan 26, 2021
@aninde aninde transferred this issue from another repository Jan 26, 2021
@aninde
Copy link
Contributor

aninde commented Feb 19, 2021

@aninde aninde closed this as completed Feb 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants