Skip to content
This repository has been archived by the owner on May 5, 2020. It is now read-only.

Added AvatarRoomActivityTest #85 #87

Closed
wants to merge 1 commit into from
Closed

Conversation

opticod
Copy link

@opticod opticod commented Feb 3, 2016

Here is my First Test on AvatarRoomActivity.. #85

@opticod
Copy link
Author

opticod commented Feb 3, 2016

Currently this test will fail as described in Issue #88

@opticod
Copy link
Author

opticod commented Feb 3, 2016

@alma-castant . please review this.

@alma-castant
Copy link
Contributor

@opticod I get notified for all PRs. No need to mention me ;) I will look at it as soon as I can

@opticod
Copy link
Author

opticod commented Feb 9, 2016

@alma-castant This is a Espresso based UI testing class.This will test different Views and Buttons shown up in different orientations including landscape and portrait ,and the working of different click events on Buttons.It will also test the retain of app state working properly or not during orientation change.As mentioned above ,the retain of app state is fixed in #99


/**
* Created by opticod(anupam) on 3/2/16.
*/
Copy link
Contributor

Choose a reason for hiding this comment

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

Please remove this header as we don't use it

onView(withId(R.id.clotheLeft)).perform(click());
onView(withId(R.id.clothes)).check(matches(new DrawableMatcher(R.drawable.cloth4)));
onView(withId(R.id.clotheRight)).perform(click());
onView(withId(R.id.clothes)).check(matches(new DrawableMatcher(R.drawable.cloth1)));
Copy link
Contributor

Choose a reason for hiding this comment

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

In this entire method you are testing the current setting with the current resources for clothes, face, etc. However, these can be changed or increased at any time. Therefore instead create a list with the elements we currently have so if they are ever changed, the test can be easily adapted. Also don't forget to test the head. Even if there is just one option now, there could be more in the future

@opticod
Copy link
Author

opticod commented Feb 24, 2016

@alma-castant , done with the changes.

public void viewTest() {
onView(withId(R.id.eyes)).check(matches(isDisplayed()));
activityRule.getActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
onView(withId(R.id.eyes)).check(matches(isDisplayed()));
Copy link
Contributor

Choose a reason for hiding this comment

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

Why are you changing the orientation after doing the check and not before?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants