organicapp

0.0.1 • Public • Published

NodeJs/RethinkDB app for Cypress testing

https://user-images.githubusercontent.com/36752411/172285672-eb5d1e08-bb75-4274-9c2d-33e2a2275d5e.mp4

Desription

I wrote this test app to help me write and practice cypress tests.All cypress.io tests are in cypress/integration/organic-app-tests folder.
This NodeJs-Express app uses the following dependencies:

  • bcrypt: to hash passwords and never store clear text passwords in databae
  • chance: to generate random integers and strings while testing
  • ejs: Ejs template engine to render views to the user
  • passport: To handle Authentication and authorization
  • rethinkdbdash: Handles connections to and from RethinkDb database
  • socket.io: Takes care of asyncroneous communications sent by changefeeds from RethinkDb ( Admin page )
  • My choice for back end settled for RethinkDb, because of its feature called "changefeeds" which sends notifications via sockt.io to the client once any change happens within its tables. The cypress test for socket.io and changefeeds is in cypress folder "admin.spec.js"

    changefeed

    How to use this app ?

    1. Download and Install RethinkDb from here
    2. Create a shortcut wherever you like to point to RethinkDB executable with the following path value and arguments: C:\RethinkDB\rethinkdb.exe -d c:\RethinkDB\data\ --bind all
    3. Click on the shortcut to start RethinkDB Server
    4. Clone this app to a folder of your choice: git clone https://github.com/jinan-kordab/nodejs-rethinkdb-app.git
    5. cd organicapp
    6. npm install>

      cdnpm

    7. cd organicapp/bin (Inside bin folder you will find two files: 1- create-data.js 2- delete-data.js)
    8. node create-data.js (this will populate your RethinkDB instance with test data. The other file, deletes all test data that was added via file accordingly)
    9. cd ..
    10. npm start (this will start the appp)
    11. navigate to http://localhost:3000 , you should see the landing page:
    12. landing

    13. now open another terminal (bash or powershell
    14. cd organicapp
    15. npx cypress open (this will start cypress, and you can write and run cypress tests)
    16. cypress

    I wrote more about this app on my blog here: my blog post including discussion on unit and integration QA testing in Cypress

Readme

Keywords

none

Package Sidebar

Install

npm i organicapp

Weekly Downloads

0

Version

0.0.1

License

none

Unpacked Size

9.81 MB

Total Files

68

Last publish

Collaborators

  • jinankordab