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

Add basic e2e tests #181

Merged
merged 1 commit into from
Oct 6, 2019
Merged

Conversation

yubathom
Copy link
Contributor

@yubathom yubathom commented Oct 4, 2019

Add basic e2e tests with cypress

Related to #65.

preview of npm run dev:e2e

postwoman_basic-e2e

this should be running in ci too - https://travis-ci.org/yubathom/postwoman/builds/593324131
at before_scripts

Screenshot_2019-10-03 Build #138 - yubathom postwoman - Travis CI

wich should give some reports at every pull requests
Screenshot_2019-10-03 Build #138 - yubathom postwoman - Travis CI(1)

New scripts:

  • npm run tests - run tests once in cli mode. Now just these e2e. In future we should run unit tests too.
  • npm run dev:e2e- will start localhos:3000 and run e2e tests within cypress app browser. This is the default mode to tdd.

Notes:

  • I'm not mounting and testing the docker container. Just testing the dev server (run dev) mounted at the travis-ci.
  • Though would be a better approach (running on docker) the dev server is the same enviroment that is deploying the front end. So I think this should be enough right now.
  • Cypress is awesome and we can add fake backend responses to run tests (see tests/e2e/fixtures/ and tests/e2e/support/commands.js). We should create some fixtures of firebase. Something like this.
  • We should write more tests. Any ideas?

@yubathom yubathom added documentation Improvements or additions to documentation need testing Needs to be tested before merging onto production labels Oct 4, 2019
@yubathom yubathom self-assigned this Oct 4, 2019
@ghost
Copy link

ghost commented Oct 4, 2019

DeepCode Report (#ade773)

DeepCode analyzed this pull request.
There is 1 new info report.

@TravisBuddy
Copy link

Hey @yubathom,
Your changes look good to me!

View build log

TravisBuddy Request Identifier: bf9ad560-e648-11e9-9927-991e8c29daea

@liyasthomas
Copy link
Member

This is AWESOME ✨

We'll write more tests 👌

Copy link
Member

@liyasthomas liyasthomas left a comment

Choose a reason for hiding this comment

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

🆗👌

@liyasthomas liyasthomas added this to the v1.0 Stable release milestone Oct 4, 2019
@liyasthomas
Copy link
Member

@NBTX seems to be busy for review. @yubathom can merge this on your requirements.

After merge, we could add more tests.

@liyasthomas liyasthomas merged commit 11e6a88 into hoppscotch:master Oct 6, 2019
@liyasthomas liyasthomas mentioned this pull request Oct 6, 2019
@yubathom
Copy link
Contributor Author

yubathom commented Oct 6, 2019

Tiny suggestions for clean code
https://www.deepcode.ai/app/gh/liyasthomas/postwoman/3ad814ebb71019ca1e9707e4338bacda1af7c0ad/liyasthomas/postwoman/ade7733d4751402cb46def4b4c3cf293b02706bf/_/%2Ftests%2Fe2e%2Fintegration%2Ffeature.url-queries.spec.js/javascript%2Fdc%2FPROMISE_NOT_CATCHED_GENERAL/code/

Hey @liyasthomas, thank you for reviewing and merging. And sorry co's I've got sick and was out theese days.

I tested the deepcodecheck changes and that broke the tests. I think is because I am not able to catch in cypress promises.

I will check at cypress docs and look for workarounds to keep the tests code cleaner in future tests.

@yubathom
Copy link
Contributor Author

yubathom commented Oct 6, 2019

And just deleted at travis the envs SURGE_LOGINand SURGE_TOKEN.

Those were required to already closed #151 and #148.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation need testing Needs to be tested before merging onto production
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants