-
When User Login Success
- Make sure that result is
Resource.Success
- Make sure that actual result is equal with expected result
- Make sure that the
storyApi.login()
method has been called with given parameters. - Make sure has no interaction with
dataStore
.
- Make sure that result is
-
When User Login Failed
- Make sure that result is
Resource.Error
- Make sure that error message is equal with expected result
- Make sure that the
storyApi.login()
method has been called with given parameters. - Make sure has no interaction with
dataStore
.
- Make sure that result is
-
When User Login Failed with
Exception
- Make sure that result is
Resource.Error
- Make sure that error message is equal with expected exception message
- Make sure that the
storyApi.login()
method has been called with given parameters. - Make sure has no interaction with
dataStore
.
- Make sure that result is
-
When User Register Success
- Make sure that result is
Resource.Success
- Make sure that actual result is equal with expected result
- Make sure that the
storyApi.register()
method has been called with given parameters. - Make sure has no interaction with
dataStore
.
- Make sure that result is
-
When User Register Failed
- Make sure that result is
Resource.Error
- Make sure that error message is equal with expected result
- Make sure that the
storyApi.register()
method has been called with given parameters. - Make sure has no interaction with
dataStore
.
- Make sure that result is
-
When User Register Failed with
Exception
- Make sure that result is
Resource.Error
- Make sure that error message is equal with expected exception message
- Make sure that the
storyApi.register()
method has been called with given parameters. - Make sure has no interaction with
dataStore
.
- Make sure that result is
-
When Current User is Available
- Make sure that
user.token
is not null or empty, - Make sure that user result is equal with expected user,
- Make sure that the
dataStore.data
has been called, - Make sure has no interaction with
storyApi
.
- Make sure that
-
When Current User is Available
- Make sure that
user.token
is null or empty, - Make sure that user result is equal with expected user,
- Make sure that the
dataStore.data
has been called, - Make sure has no interaction with
storyApi
.
- Make sure that
-
When Create Story Success
- Make sure that result is
Resource.Success
- Make sure that expected result is equal with actual result
- Make sure that the
storyApi.uploadStory()
method has been called with given parameters. - Make sure that Mappings input method has been called.
- Make sure has no interaction with
database
.
- Make sure that result is
-
When Create Story Failed
- Make sure that result is
Resource.Error
- Make sure that expected error is equal with actual error
- Make sure that the
storyApi.uploadStory()
method has been called with given parameters. - Make sure that Mappings input method has been called.
- Make sure has no interaction with
database
.
- Make sure that result is
-
When Create Story Failed with
Exception
- Make sure that result is
Resource.Error
- Make sure that expected exception is equal with actual exception
- Make sure that the
storyApi.uploadStory()
method has been called with given parameters. - Make sure that Mappings input method has been called.
- Make sure has no interaction with
database
.
- Make sure that result is
-
When Get Stories Success
- Make sure that result is
Resource.Success
- Make sure that expected result is equal with actual result
- Make sure that the
storyApi.getStories()
method has been called with given parameters.
- Make sure that result is
-
When Get Stories Failed with
Exception
- Make sure that result is
Resource.Error
- Make sure that expected exception is equal with actual exception
- Make sure that the
storyApi.getStories()
method has been called with given parameters.
- Make sure that result is
-
When Create Story with empty input (Internal Validation)
- Make sure that
formState
isFormState.Submit
- Make sure that
submitState
isUiState.Error
- Make sure that the expected result is equal with actual exception
- Make sure has no interaction with
storyRepository
.
- Make sure that
-
When Create Story with invalid input (Server Validation)
- Make sure that
formState
isFormState.Submit
- Make sure that
submitState
isUiState.Error
- Make sure that expected error is equal with actual error
- Make sure that the
storyRepository.createStory()
method has been called with given input.
- Make sure that
-
When Create Story with valid input
- Make sure that
formState
isFormState.Submit
- Make sure that
submitState
isUiState.Success
- Make sure that expected message is equal with actual message
- Make sure that the
storyRepository.createStory()
method has been called with given input.
- Make sure that
-
When Collect Stories Success
- Make sure that actual result is Not Empty
- Make sure that size of
expectedResult
is equal withactualResult
- Make sure that
expectedResult
data is equal withactualResult
- Make sure that the
storyRepository.getPagedStories()
method has been called.
-
When Collect Stories Failed (empty data)
- Make sure that actual result is Empty
- Make sure that the
storyRepository.getPagedStories()
method has been called.
-
When Map is Not Ready
- Make sure has no interaction with
storyRepository
.
- Make sure has no interaction with
-
When Map Ready (Load Stories Success)
- Make sure that result is
UiState.Success
- Make sure that expected result is equal with actual result
- Make sure that the
storyRepository.getStories()
method has been called.
- Make sure that result is
-
When Map Ready (Load Stories Failed)
- Make sure that result is
UiState.Success
- Make sure that expected error is equal with actual exception
- Make sure that the
storyRepository.getStories()
method has been called.
- Make sure that result is
-
When
numLoadedStories
Change than Reload Stories- Make sure that
numLoadedStories
is equal with changenumLoadedStories
- Make sure that stories result is
UiState.Success
- Make sure that size of stories result is less than or equal with
numLoadedStories
- Make sure that expected stories is equal with actual stories
- Make sure that the
storyRepository.getPagedStories()
method has been called with valid parameters.
- Make sure that
-
When Login with empty input (Internal Validation) then Error
- Make sure that
formState
isFormState.Submit
- Make sure that
submitState
isUiState.Error
- Make sure that the expected result is equal with actual exception
- Make sure has no interaction with
storyRepository
.
- Make sure that
-
When Login with valid input (Server Validation) then Error
- Make sure that
formState
isFormState.Submit
- Make sure that
submitState
isUiState.Error
- Make sure that expected error is equal with actual error
- Make sure that the
storyRepository.signIn()
method has been called with given input.
- Make sure that
-
When Login with valid input and then Success
- Make sure that
formState
isFormState.Submit
- Make sure that
submitState
isUiState.Success
- Make sure that expected user is equal with actual user
- Make sure that the
storyRepository.signIn()
method has been called with given input. - Make sure that the
storyRepository.saveUserSession()
method has been called.
- Make sure that
-
When Register with empty input (Internal Validation) then Error
- Make sure that
formState
isFormState.Submit
- Make sure that
submitState
isUiState.Error
- Make sure that the expected result is equal with actual exception
- Make sure has no interaction with
storyRepository
.
- Make sure that
-
When Register with valid input (Server Validation) then Error
- Make sure that
formState
isFormState.Submit
- Make sure that
submitState
isUiState.Error
- Make sure that expected error is equal with actual error
- Make sure that the
storyRepository.signUp()
method has been called with given input.
- Make sure that
-
When Register with valid input and then Success
- Make sure that
formState
isFormState.Submit
- Make sure that
submitState
isUiState.Success
- Make sure that expected user is equal with actual user
- Make sure that the
storyRepository.signUp()
method has been called with given input.
- Make sure that
-
When User is Login
- Make sure that
isLogin
istrue
- Make sure that the
userRepository.getCurrentUser()
method has been called.
- Make sure that
-
When User Not Login
- Make sure that
isLogin
isfalse
- Make sure that the
userRepository.getCurrentUser()
method has been called.
- Make sure that
-
When User
logOut
- Make sure that the
userRepository.signOut()
method has been called.
- Make sure that the
-
@MediumTest - Login with valid input then
login button
enable- Make sure initial
login button
is disable - type valid email on Edit Text
email
- type valid password on Edit Text
password
- Make sure initial
login button
is enable
- Make sure initial
-
@MediumTest - type invalid input
- Make sure initial
login button
is disable - type invalid email on Edit Text
email
then make sure error message is appear - type invalid password on Edit Text
password
then make sure error message is appear - Make sure
login button
still disable
- Make sure initial
-
Register with valid input then
login button
enable- Make sure initial
register button
is disable - type valid name on Edit Text
name
- type valid email on Edit Text
email
- type valid password on Edit Text
password
- Make sure initial
register button
is enable
- Make sure initial
-
Register with invalid input then
login button
disable- Make sure initial
register button
is disable - type invalid email on Edit Text
email
then make sure error message is appear - type invalid password on Edit Text
password
then make sure error message is appear - Make sure
register button
still disable
- Make sure initial
- Check view and make sure data display equal with given bundle
- Make sure detail name is shown and text is valid
- Make sure create at is shown and text is valid
- Make sure description is shown and text is valid
- Make sure Image is shown, adn have content description
-
Launch Fragment load data Error (doesn't have cache)
- Make sure
recylerView
is hide - make sure
retryButton
is shown - make sure
errorMsg
is shown
- Make sure
-
Launch Fragment load data Error (have cache)
- Make sure
recylerView
is shown and have data - make sure
recylerView
at position 0 is shown and error layout is append on current position - make sure
retryButton
is hide - make sure
errorMsg
is hide
- Make sure
-
Launch Fragment load data Success
- Make sure
recylerView
is shown and have data - make sure
retryButton
is hide - make sure
errorMsg
is hide
- Make sure
-
End-to-End: Authentication Flow this test is when user open app than doesn't have session (unAuthenticated)
- Make sure current destination is
loginFragment
- type valid input email and password
- Make sure all input doesn't have error and
loginbutton
is enabled. - click on
loginbutton
and wait until success - Make sure current destination is
homeFragment
- Make sure
homeList
is displayed.
- Make sure current destination is
-
End-to-End: Application Flow this test is when user open app than have session (Authenticated)
- Make sure current destination is
homeFragment
- Make sure
homeList
is displayed, and perform click on list - Make sure current destination is
detailFragment
and layout is corrent - press back and maksure current destination is
homeFragment
- perform click on
floatingActionButton
and make sure current destination iscreateFragment
- Make sure current destination is
-
Refresh Load then Error IOException
- Make sure result is
MediatorResult.Error
- Make sure error throwable is IOException
- Make sure result is
-
Refresh Load then Success (EndOFPagination)
- Make sure result is
MediatorResult.Success
- Make sure
result.endOfPaginationReached
is true
- Make sure result is
-
Refresh Load then Success (More Data is Present)
- Make sure result is
MediatorResult.Success
- Make sure
result.endOfPaginationReached
is false
- Make sure result is
- Insert Story and key Success
- Make sure size of Result is Equal with given data size
- Make sure size of inserted story is equal with size of inserted remoteKey