Mentorship-backend: Create a user journey test from sending a mentorship request and the request is rejected.

Created on 5 Oct 2020  路  13Comments  路  Source: anitab-org/mentorship-backend

Description

I need to test a specific user path,
so that I can make sure a specific path can be executed usefully in a deterministic way.

This test should be located in a specific folder for separation concerns, it could be called tests/user_journey.
Next, I'll define a very broad scenario, but simple enough for you to start.

Scenario: User A (mentor) and User B (mentee)

  1. User B (mentee) sends a request to User A (mentor)
  2. User A (mentor) rejects request

Definition of Done

  • [ ] Create 1 user journey test that follows the scenario described above
  • [ ] Document the test result on Test Quality (@anitab-org/qa-team can help)

Estimation

3 hours

Coding Quality Assurance Testing

Most helpful comment

@vj-codes Sorry for the late reply. I won't be able to work on it right now.

All 13 comments

Hello! I would like to work on this .... I have a question.Do I need to test the app as well ?

@rpattath can you please clear my query and if possible assign me this issue?

@yash2189 you need to automate only this workflow (sending a mentorship request and the request is rejected) on the backend. https://github.com/anitab-org/mentorship-backend/blob/develop/tests/user_journey/test_happy_path_1.py is a sample but here only the positive scenario has been covered. You will have to automate tests that fail, for example rejecting a request that does not exist.

@rpattath For that do I need to setup the environment on my local machine?

@yash2189 Are you still working on this request? In case not, I would be happy to add the mentioned workflow. I am a first timer in this repo.

cc @rpattath

@rpattath Sorry for the late response .... I was assigned few other issues hence I couldn't do this issue. Can you please make this issue available for others?
If possible can you assign this issue to @shankybnl ?

Thank you @yash2189 for the quick response. @rpattath Could you please assign it to me?

Sorry for the multiple messages @rpattath and @isabelcosta I have set up the mentorship-backend repo on my local machine. In case this issue is still available, can you please assign it to me? I can try to finish it as part of Hacktoberfest.

@shankybnl hey are you still interested to work on this issue?

@vj-codes Sorry for the late reply. I won't be able to work on it right now.

@vj-codes Shall I take this up?

Assigning you @sankha555
Happy coding!

@vj-codes @rpattath Made a PR containing the user journey. Kindly take a look at it and let me know your reviews about it. Thanks!

P.S. I encountered one importing error while making the patch. I took ideas from this journey and made the same imports with the addition of the http library. However, placing my journey inside the user_journeys folder returns the following traceback:

Traceback (most recent call last):
  File "tests/user_journey/test_rejection_path.py", line 8, in <module>
    from app import messages
ModuleNotFoundError: No module named 'app'

The error was surprising to me as I had implemented all the setup instructions and had also installed all dependencies. When I placed my user journey file inside the main folder mentorship-backend (which contains app), I got no error as expected and the tests ran perfectly. Could you please help me out with this issue and instruct me as to how I can make my user journey run even after placing inside the user_journeys folder. It will be really helpful for me in future contributions. Thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

anna4j picture anna4j  路  24Comments

epicadk picture epicadk  路  19Comments

paritoshsinghrahar picture paritoshsinghrahar  路  24Comments

paritoshsinghrahar picture paritoshsinghrahar  路  25Comments

PrashanthPuneriya picture PrashanthPuneriya  路  45Comments