mentorship-android
mentorship-android copied to clipboard
Write “Current Relation” screen Espresso test (b)
Write “Current Relation” screen (scenario: when there is relation) Espresso test
Describe the solution you'd like Unit tests to cover the Current Relation feature of the app, when there is a relation present.
The tests would go here
Acceptance criteria:
- [ ] Connect Android device or open the emulator
- [ ] On terminal type ./gradlew clean build connectedAndroidTest --stacktrace
- [ ] Wait for your test to complete
- [ ] See the complete report ../mentorship-android/app/build/reports/androidTests/connected/index.html and check if this test passed.
@annaj I would like to work on this as an OSH participant
Hey I've already assigned you to a backend issue. You can claim one issue at a time :) @ashwinijha6
ok I'll continue with that one. Will try this issue if not assigned to anyone after 3 days
You can try this one once you've sent a PR for that one:)
ya sure @anna4j :)
Can this issue be assigned to me?
@FullBinaryAlchemist sure
@anna4j I have finished reading and getting a superficial understanding of the Backend API mentioned in the docs and app main idea . I'm now going through the App documentation and will be delving into the codebase soon. Any pointers for that?
@anna4j I have finished reading and getting a superficial understanding of the Backend API mentioned in the docs and app main idea . I'm now going through the App documentation and will be delving into the codebase soon. Any pointers for that?
Nope go ahead. If you need any assistance let us know
@anna4j I have finished reading and getting a superficial understanding of the Backend API mentioned in the docs and app main idea . I'm now going through the App documentation and will be delving into the codebase soon. Any pointers for that?
Nope go ahead. If you need any assistance let us know
Okay, so I have finished cloning and need some guidance about what kind of tests to implement.
- I saw in the SignUpActivity, that they were simulating the UI inputs to check for different kinds of password combinations but for Current relations how do I go around doing that for Current Relationship? Specifically, which object(s) do I simulate?
- In the app documentation, it is mentioned that a relationship may be canceled by any. Does direct removal take place without the need for approval from the other party? Tentatively these are the tests cases I have thought about:
- If the user has
needsMentoring
set to true then there should only be one mentee relationship in the current relationship. - For a relationship in Current Relationship, if the User is a mentee then they should not be able to add tasks.
- For a relationship in Current Relationship, only if the User is a mentor should they be able to assign tasks.
- For a relationship in Current Relationship, if the User is a mentor they should be able to mark a task as completed.
(I have done previous android development in java so I'm unfamiliar with Kotlin equivalents. Let me know if I'm thinking in the right direction)
These test cases look good to me. @iofall are we missing something?
Hey @FullBinaryAlchemist there is no difference between the Current Relations
screen for when a user is a mentor
or a mentee
. Both can create and mark tasks, refer Wiki. Both screens are identical, regardless of who is viewing it. So I think:
- This one looks good but when there is a relation present,
needsMentoring
does not come into the picture. So I don't think there will be a need for this test. I tried it out actuallyneedsMentoring
value does not reflect whether they have a relationship or not. - This is identical for both a mentee and a mentor, so maybe you could check what text is displayed when one clicks on
Details
and that could be one test. - Same as 2 since both can create tasks, test could be that whether a task is successfully displayed when one clicks on the
+
button and fills out the details - Both users can also mark tasks as completed, so you can just test whether they are able to successfully mark them as completed.
- Another test could be, the cancel button for the relationship, does it display a confirmation when clicked.
- Maybe a test for, when there are no tasks/ achievements, is the proper text displayed.
I hope this helps.
Also answering the questions:
I saw in the SignUpActivity, that they were simulating the UI inputs to check for different kinds of password combinations but for Current relations how do I go around doing that for Current Relationship? Specifically, which object(s) do I simulate?
I think you only need to simulate the inputs which in this case will be for creating the tasks.
In the app documentation, it is mentioned that a relationship may be canceled by any. Does direct removal take place without the need for approval from the other party?
Yes no approval is needed for this from the other party, at least that is the current implementation.
@FullBinaryAlchemist how's the PR going?
@vj-codes I have considered the suggestions given by iofall and reached till idling in Espresso testing ,as I have identified that we'll be requiring that. I have been occupied with some other commitments, for the time being , so wasn't able to work on the PR for a while. My apologies for not communicating the same beforehand. I''ll be able to resume the work from tomorrow onwards and my estimated completion is by 23rd.Let me know if there are some issues with that.
@FullBinaryAlchemist hey are you still working on this? Contributors must update their progress after every 3 days in case it's taking long as per the community guidelines.
@FullBinaryAlchemist sorry I have unassign you, for now, please claim again when you are active
Hey...can I work on this issue?
@aditmehta9 @iofall @anna4j I'd like to take up this issue !
Hey...can I work on this issue?
Sure
@aditmehta9 @iofall @anna4j I'd like to take up this issue !
@faznan3nazer commented first
@aditmehta9 sorry for the delay...I will open PR this week...
@aditmehta9 sorry for the delay...I will open PR this week...
Okay
@aditmehta9 can you please unassign me... I will work on this issue later if still available...
@aditmehta9 can you please unassign me... I will work on this issue later if still available...
Sure
Can I take up this issue?
Can I take up this issue?
Sure
Update on this issue. I've written almost all the test cases which were mentioned the the previous comments. Will be sending the PR today. 😊
@vj-codes can i work on this issue??
@vj-codes can i work on this issue??
Sure @ravi5175