Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Profile test #101

Merged
merged 5 commits into from
Nov 12, 2020
Merged

Profile test #101

merged 5 commits into from
Nov 12, 2020

Conversation

Kii-26
Copy link
Contributor

@Kii-26 Kii-26 commented Nov 5, 2020

intent test for edit profile

@c25vdw
Copy link
Contributor

c25vdw commented Nov 5, 2020

  1. note that we are using the test project's database now. So right now the account to log in cannot work. You could go to https://console.firebase.google.com/u/1/project/cmput301bookfriends-testing/overview (the testing project console) to add the user data you want to test.

  2. This intent test is editing an email, which means that next time this test runs the email is already the changed one. In the test you can write a clean up function that change it back. Trung has a method that's cleaning up books (tearDown) , maybe we can do similar thing here but with users. https://github.com/CMPUT301F20T21/Book_Friends/pull/99/files#diff-0a6e55853e02e91530604ee87eef8c3180c94e5e8e0aa60c274f67f846228e19R112-R123

@zhpeng811
Copy link
Member

zhpeng811 commented Nov 5, 2020

Looks like all tests are missing assert conditions.. without assert conditions the test will only fail if it fails to capture an element

An example of assert condition is to check if the email display field is changed to the updated email after performing a success edit, or check if the email display field stayed the same after performing a fail edit

Here is an example of assert condition:
ViewInteraction emailField = onView(
allOf(withId(email text view id goes here), withText(the expected email goes here), isDisplayed()));
emailField.check(matches(withText(the expected email goes here)));

@Kii-26
Copy link
Contributor Author

Kii-26 commented Nov 5, 2020

  1. note that we are using the test project's database now. So right now the account to log in cannot work. You could go to https://console.firebase.google.com/u/1/project/cmput301bookfriends-testing/overview (the testing project console) to add the user data you want to test.
  2. This intent test is editing an email, which means that next time this test runs the email is already the changed one. In the test you can write a clean up function that change it back. Trung has a method that's cleaning up books (tearDown) , maybe we can do similar thing here but with users. https://github.com/CMPUT301F20T21/Book_Friends/pull/99/files#diff-0a6e55853e02e91530604ee87eef8c3180c94e5e8e0aa60c274f67f846228e19R112-R123

For 1, do you mean I directly add account from the firebase web page? Then run the test?
For 2, I actually edit the email back on profileEditEmailSuccess(), should I do this at the end of all test?

@c25vdw
Copy link
Contributor

c25vdw commented Nov 5, 2020

For 1, do you mean I directly add account from the firebase web page? Then run the test?
For 2, I actually edit the email back on profileEditEmailSuccess(), should I do this at the end of all test?

  1. Actually, you can use this account:
  • username: test
  • password: bookfriendstest
  1. sorry, I missed that code. right now it should be ok.

@Kii-26
Copy link
Contributor Author

Kii-26 commented Nov 6, 2020

I tried with the username test, but it still cannot log in. And I think there is no "test" account in test project's database. I might miss something...?

@c25vdw
Copy link
Contributor

c25vdw commented Nov 6, 2020

I'm guessing your project didn't have the correct services key for the testing firebase project. Maybe try this https://discord.com/channels/753316752087318739/753317648347037746/774063001539313684, the key files are in pinned message.

Copy link
Contributor

@c25vdw c25vdw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Copy link
Member

@zhpeng811 zhpeng811 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@Kii-26 Kii-26 merged commit 92f218a into master Nov 12, 2020
@Kii-26 Kii-26 deleted the profile-test branch November 12, 2020 07:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants