mentorship-android icon indicating copy to clipboard operation
mentorship-android copied to clipboard

Write “Current Relation” screen Espresso test (b)

Open anna4j opened this issue 4 years ago • 32 comments

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.

anna4j avatar Aug 30 '20 10:08 anna4j

@annaj I would like to work on this as an OSH participant

ashwinijha6 avatar Aug 31 '20 19:08 ashwinijha6

Hey I've already assigned you to a backend issue. You can claim one issue at a time :) @ashwinijha6

anna4j avatar Aug 31 '20 19:08 anna4j

ok I'll continue with that one. Will try this issue if not assigned to anyone after 3 days

ashwinijha6 avatar Aug 31 '20 19:08 ashwinijha6

You can try this one once you've sent a PR for that one:)

anna4j avatar Aug 31 '20 19:08 anna4j

ya sure @anna4j :)

ashwinijha6 avatar Aug 31 '20 19:08 ashwinijha6

Can this issue be assigned to me?

FullBinaryAlchemist avatar Sep 02 '20 15:09 FullBinaryAlchemist

@FullBinaryAlchemist sure

anna4j avatar Sep 02 '20 16:09 anna4j

@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?

FullBinaryAlchemist avatar Sep 03 '20 17:09 FullBinaryAlchemist

@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 avatar Sep 03 '20 17:09 anna4j

@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:
  1. If the user has needsMentoring set to true then there should only be one mentee relationship in the current relationship.
  2. For a relationship in Current Relationship, if the User is a mentee then they should not be able to add tasks.
  3. For a relationship in Current Relationship, only if the User is a mentor should they be able to assign tasks.
  4. 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)

FullBinaryAlchemist avatar Sep 04 '20 19:09 FullBinaryAlchemist

These test cases look good to me. @iofall are we missing something?

anna4j avatar Sep 04 '20 20:09 anna4j

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:

  1. 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 actually needsMentoring value does not reflect whether they have a relationship or not.
  2. 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.
  3. 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
  4. Both users can also mark tasks as completed, so you can just test whether they are able to successfully mark them as completed.
  5. Another test could be, the cancel button for the relationship, does it display a confirmation when clicked.
  6. Maybe a test for, when there are no tasks/ achievements, is the proper text displayed.

I hope this helps.

iofall avatar Sep 04 '20 23:09 iofall

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.

iofall avatar Sep 04 '20 23:09 iofall

@FullBinaryAlchemist how's the PR going?

vj-codes avatar Sep 18 '20 19:09 vj-codes

@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 avatar Sep 20 '20 14:09 FullBinaryAlchemist

@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.

vj-codes avatar Sep 25 '20 20:09 vj-codes

@FullBinaryAlchemist sorry I have unassign you, for now, please claim again when you are active

aditmehta9 avatar Sep 29 '20 19:09 aditmehta9

Hey...can I work on this issue?

faznan3nazer avatar Oct 01 '20 14:10 faznan3nazer

@aditmehta9 @iofall @anna4j I'd like to take up this issue !

justdvnsh avatar Oct 04 '20 15:10 justdvnsh

Hey...can I work on this issue?

Sure

aditmehta9 avatar Oct 05 '20 12:10 aditmehta9

@aditmehta9 @iofall @anna4j I'd like to take up this issue !

@faznan3nazer commented first

aditmehta9 avatar Oct 05 '20 12:10 aditmehta9

@aditmehta9 sorry for the delay...I will open PR this week...

faznan3nazer avatar Oct 10 '20 17:10 faznan3nazer

@aditmehta9 sorry for the delay...I will open PR this week...

Okay

aditmehta9 avatar Oct 10 '20 19:10 aditmehta9

@aditmehta9 can you please unassign me... I will work on this issue later if still available...

faznan3nazer avatar Oct 15 '20 12:10 faznan3nazer

@aditmehta9 can you please unassign me... I will work on this issue later if still available...

Sure

aditmehta9 avatar Oct 15 '20 13:10 aditmehta9

Can I take up this issue?

HaripriyaB avatar Oct 18 '20 19:10 HaripriyaB

Can I take up this issue?

Sure

aditmehta9 avatar Oct 19 '20 07:10 aditmehta9

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. 😊

HaripriyaB avatar Oct 20 '20 03:10 HaripriyaB

@vj-codes can i work on this issue??

ravi5175 avatar Apr 26 '21 17:04 ravi5175

@vj-codes can i work on this issue??

Sure @ravi5175

devkapilbansal avatar Apr 26 '21 17:04 devkapilbansal