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

Basic initialisation test for Editor.js #1410

Merged
merged 28 commits into from
Nov 21, 2020
Merged

Basic initialisation test for Editor.js #1410

merged 28 commits into from
Nov 21, 2020

Conversation

ranemihir
Copy link
Contributor

@ranemihir ranemihir commented Nov 2, 2020

In this PR, I have set up Cypress testing framework and added a basic test which asserts whether an instance of EditorJS in created or not in <div id="editorjs"></div>.

Steps to test the PR and run all the cypress tests:

  1. Run yarn install to add the added cypress dependency which will install the cypress framework.

  2. Run yarn test:dev in a separate terminal. This will create an express server hosting the test files.

  3. Run yarn test:cypress. This will automatically open the installed cypress framework and it will use the default browser in under automation to run all the tests and show you the results.

@robonetphy
Copy link
Member

I am getting this Error:
image

@ranemihir
Copy link
Contributor Author

Steps to test the PR and run all the cypress tests:

  1. Run yarn install to add the added cypress dependency which will install the cypress framework.

  2. Run yarn test:dev in a separate terminal. This will create an express server hosting the test files.

  3. Run yarn test:cypress. This will automatically open the installed cypress framework and it will use the default browser in under automation to run all the tests and show you the results.

@neSpecc @khaydarov @gohabereg @robonetphy and to everyone else who wants to test and review this PR.

example/example.html Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
test/cypress/integration/basic/initialization.spec.js Outdated Show resolved Hide resolved
test/cypress/integration/basic/initialization.spec.js Outdated Show resolved Hide resolved
test/cypress/integration/basic/initialization.spec.js Outdated Show resolved Hide resolved
test/cypress/integration/basic/initialization.spec.js Outdated Show resolved Hide resolved
test/cypress/integration/basic/initialization.spec.js Outdated Show resolved Hide resolved
.gitignore Outdated Show resolved Hide resolved
@hata6502
Copy link
Contributor

Hello! Do you have a plan to measure test coverage?
If so, please see: https://docs.cypress.io/guides/tooling/code-coverage.html

And, would you use CodeCov, and display code coverage as badge in README.md?
https://codecov.io/

.eslintrc Outdated Show resolved Hide resolved
test/cypress/integration/basic/initialization.spec.js Outdated Show resolved Hide resolved
test/cypress/integration/basic/initialization.spec.js Outdated Show resolved Hide resolved
@neSpecc
Copy link
Member

neSpecc commented Nov 21, 2020

Hello! Do you have a plan to measure test coverage?
If so, please see: https://docs.cypress.io/guides/tooling/code-coverage.html

And, would you use CodeCov, and display code coverage as badge in README.md?
https://codecov.io/

I think, we can adjust the CodeCov a little bit later, when we'll write more tests.

@hata6502
Copy link
Contributor

@neSpecc OK!
When installing the code coverage report, please check: https://github.com/ranemihir/editor.js/pull/1/files

@neSpecc neSpecc merged commit 585e01b into codex-team:next Nov 21, 2020
@ranemihir
Copy link
Contributor Author

Thanks! @neSpecc

"svg:win": "if not exist dist md dist && yarn svg",
"svg": "svg-sprite-generate -d src/assets/ -o dist/sprite.svg",
"pull_tools": "git submodule update --init --recursive",
"checkout_tools": "git submodule foreach git pull origin master"
"checkout_tools": "git submodule foreach git pull origin master",
"test:e2e": "cypress open"
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
"test:e2e": "cypress open"
"test:e2e": "cypress run",
"cypress:open": "cypress open"

cypress open: Open cypress GUI window.
cypress run: Run cypress test in CUI.

neSpecc added a commit that referenced this pull request Dec 8, 2020
* Initial commit

* Fixed test.html file

* Create editor instance in the test

* Assert paragraph data in editor instance

* Moving cypress folder to test folder

* Minor Fixes

* Removed config test for now

* Fixed example.html

* Fixed editor.js dist path

* Minor Fixes

* Stored Host in a const

* Add nodemon and Fix commands

* Add and configure cypress eslint plugin

* Updated Tests according to best practices

* Minor FIxes

* Minor FIxes

* adjust eslint and ts

* Update .eslintrc

* improve config

* debug tests

* fix tests

* Fix declarations

* descrease debounce

* rm timeout

* Update CHANGELOG.md

* Update CHANGELOG.md

Co-authored-by: Peter Savchenko <[email protected]>
Co-authored-by: George Berezhnoy <[email protected]>
@evanjmg
Copy link

evanjmg commented May 18, 2022

Any plans to add code coverage? If not, I will likely submit a pr for this.

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

Successfully merging this pull request may close these issues.

6 participants