Commit Graph

6 Commits

Author SHA1 Message Date
DoomMortal 5299e8e607 Migration Tests to AndroidX
Fix import statements to AndroidX
2020-04-26 19:13:07 +02:00
Martijn Brekhof 3b2447607b Implemented support for handling multiple playlists in tests (#657)
Added support for handling multiple playlists in the Mock TCP server.
Refactored SlideUpPanelTests to support the new playlist handler.

Some code cleanup and enhancements
- Removed throw exception declarations from methods that never throw the exception.
- Changed deleting the test database on the test device to delete all databases.
  The former method of only deleting the test database resulted in many old databases
  that were not removed when the test run crashed.
- Enhanced robustness of testing async code by explicitly waiting for a view
  to reach a certain state.
2019-07-03 18:54:51 +01:00
Martijn Brekhof d1d8412654 Refactored unit tests (#643)
* Removed redundant configureHostInfo
  It was only used to set the Kodi backend version which is also
  set using setKodiMajorVersion.

* Removed unused annotations and throwables

* Improved robustness of SlideUpPanelTests
  Replaced explicit sleeps with the waitForView action.
  Fixed issue in waitForView action as it required the UI
  to be idle which is mostly not the case for the bottom
  panel with the progress indicator.

* Improved robustness of eventserver
  When eventserver handles a wrong payload this should not crash
  but simply show a log message and let the actual test fail.
2019-06-11 08:47:11 +01:00
Martijn Brekhof d634d9455e Refactored instrumentation tests to support RecyclerViews
* Fixed Espresso not waiting on ViewPager switching
* Removed BaseMediaActivityTests abstract class.
  Unfortunately the click action on list items now requires
  a unique item to be able to select the item to click.
  Therefore the tests from BaseMediaActivityTests have been
  moved to the specific test classes. This made the
  BaseMediaActivityTests class obsolete.
* Removed dependency on Context class in AddonsHandler and inlined
  the json data to allow the AddonsHandler to be initialized before
  the test activity is started. This was needed to have the
  AddonsActivityTests directly start the AddonsActivity, instead of
  first starting MoviesActivity and from there start the AddonsActivity.
2018-09-09 14:09:59 +01:00
Martijn Brekhof 9e65350b5a Bug/androidtests (#466)
* Fixed issue with selecting tabs

* Fixed issue with switching host on other thread than UI thread

* Fixed concurrent modification exception in JSONConnectionHandlerManager

* Fixed issue with drawer not closing

* Fixes issue with running method only supported on API 21 and higher
2017-10-10 11:06:10 +01:00
Martijn Brekhof 1cb77876be Implemented testing actionbar state (#382)
* Added JSON datafiles for TV shows and music videos
   * Implemented instrumentations tests for MoviesActivity, MusicActivity,
     TVShowActivity, and AddonsActivity.
   * Moved RestoreSearchQueryViewPagerTest to music package as it uses
     the MusicActivity
   * Moved RestoreSearchQueryListFragmentTest to movies packages as it
     uses the MoviesActivity
   * Added scripts to get JSON data for music videos, addons, and TV shows
   * Added sequence diagram for BaseMediaActivity to clarify new setup
   * Refactored BaseMediaActivity to comply with diagram
   * Refactored SyncMusicVideos and SyncTVShows so we can use the same code
     for adding test data as we use for adding real data.
   * Removed unused StringBuffer and synchronize block in MockTcpServer
2017-04-29 16:08:15 +01:00