datajoint / datajoint-labbook

DataJoint LabBook is a graphical user interface built using React to facilitate working with DataJoint computational pipelines.
https://datajoint.com/docs/core/datajoint-labbook
MIT License
11 stars 14 forks source link

Adding A Test Case For Login Page #130

Closed ChihweiLHBird closed 3 years ago

guzman-raphael commented 3 years ago

@ChihweiLHBird Thanks for the PR! Are you running this currently on your side? If so, how are you running it to verify it tests properly?

ChihweiLHBird commented 3 years ago

@ChihweiLHBird Thanks for the PR! Are you running this currently on your side? If so, how are you running it to verify it tests properly?

Thank you! It can be verified by run npm test. We can also add it to the GitHub action as a test automation.

guzman-raphael commented 3 years ago

@ChihweiLHBird Awesome, thanks for sharing. Will give it a try locally on my side.

Regarding how we go about CI and adopting it into the code pipeline, we normally include a test database that is only accessible locally for the tests. Have a look here for reference. Since the scaffolding is not yet in this code base, we can help you with this. Let me give your PR a test locally on my end and we can contribute with you by PR'ing to your fork to help get you going. I'm thinking of including your tests (along with future tests) into the dev docker environment which will watch for changes and automatically re-run.

ChihweiLHBird commented 3 years ago

@ChihweiLHBird Thanks for the PR! Are you running this currently on your side? If so, how are you running it to verify it tests properly?

@ChihweiLHBird Awesome, thanks for sharing. Will give it a try locally on my side.

Regarding how we go about CI and adopting it into the code pipeline, we normally include a test database that is only accessible locally for the tests. Have a look here for reference. Since the scaffolding is not yet in this code base, we can help you with this. Let me give your PR a test locally on my end and we can contribute with you by PR'ing to your fork to help get you going. I'm thinking of including your tests (along with future tests) into the dev docker environment which will watch for changes and automatically re-run.

@guzman-raphael Thank you very much! Would you like me to develop further test cases for other pages of the ReactJS App? I think we would need an account for testing purpose.

guzman-raphael commented 3 years ago

@ChihweiLHBird That would be great. Yes we can, I'll PR to your branch soon to help set that up with you. Also, would be great if you could add the display of the code coverage as well.

guzman-raphael commented 3 years ago

Hey @ChihweiLHBird. BTW, in case you are having any image rendering and/or SSL/TLS related issues lately, our cert recently expired. You just need to update the nginx image with one that has been renewed i.e. bump the version. Like this.

ChihweiLHBird commented 3 years ago

Hey @ChihweiLHBird. BTW, in case you are having any image rendering and/or SSL/TLS related issues lately, our cert recently expired. You just need to update the nginx image with one that has been renewed i.e. bump the version. Like this.

Okay thanks, let me take a look. I am sorry, I didn't receive the notification from GitHub about your PR. I just merged it.

ChihweiLHBird commented 3 years ago

Hi @guzman-raphael , for the local test database, I just need to connect the local db in the labbook, and write the test cases for the pages after logging in with the root account? I can see the password of the root account is labbook. Is root the root account's username?

guzman-raphael commented 3 years ago

@ChihweiLHBird Yes, see line 12 that was just merged in docker-compose-dev.yaml.

ChihweiLHBird commented 3 years ago

@ChihweiLHBird Yes, see line 12 that was just merged in docker-compose-dev.yaml.

Thank you!

guzman-raphael commented 3 years ago

@ChihweiLHBird Saw you pushed a new commit. Were you ready for review or not yet? Usually we convert to draft while still working through things and mark it ready for review to indicate to others to begin the review.

ChihweiLHBird commented 3 years ago

@ChihweiLHBird Saw you pushed a new commit. Were you ready for review or not yet? Usually we convert to draft while still working through things and mark it ready for review to indicate to others to begin the review.

Although the test case cannot verify the behavior of the Web App after login operation, I think this PR is okay to be reviewed because it can simulate something on the login page. What do you think? Maybe we can get it reviewed (and merged) first and then adding other test cases later?