shahshail / TeaBucks

This is simple online Tea order mock app.(Purpose for perform Espresso Test).

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TeaBucks

  • This is simple online Tea order mock app.(Purpose for perform Espresso Test).
  • User can select their favorite tea from different Teas.
  • The user can also customize their tea using spinners and edit texts.

Espresso Test

  • Exspresso can help us to test variety of test components (e.g. Views, Intents, AdapterViews and Idling Resources).
  • For this TeaBucks App, i have performed 4 different tests.

AdapterView Test

  • MenuActivity contains simple list of tea items with grid layout.
  • In this test, I have performed AdapterViews Test with onData and onView methods to assure that app behaves correctly.

1) onData: onData method is responsible to load the adapter item we are interested in onto the screen before operating on it.

2) onView: onView() can handle most Views in our UI, Espresso does require a different method call when dealing with AdapterView widgets.

atp txt

Intent Test

  • Two comman terms in ragards to intent testing are Intent Stub and Intent Verification

1) Intent Stub: Intent stub is nothing but a small piece of code that acts as a fake response to an intent call during a test.

2) Intent Verification: In espresso, If we want to varify the intent data then we will use Intent Verification method. As the name implies, we intended what we send works properly.

atp txt

atp txt

Idling Resources

  • In order to count the time taken by the async task to perform operation in background, We implement Idkling Resources.
  • With Idling Resources implementation the espresso will paus untill the background task is done. Then it will re-continue when the device is ideal. So this approach will give us an idle test results.

atp txt

Espresso Test Results

Result 1 (Intent Test and AdapterView Test)

atp txt

atp txt

Result 2 (Idling Resources Test)

atp txt

Screens

Home Screen

atp txt

Order Screen

atp txt

Order Summary Screen

atp txt

Share Screen

atp txt

About

This is simple online Tea order mock app.(Purpose for perform Espresso Test).


Languages

Language:Java 100.0%