Upgrade to Pro — share decks privately, control downloads, hide ads and more …

How Spotify uses Test Automation

How Spotify uses Test Automation

Based on a workshop on how spotify uses test automation, presentation is created.

Viraj Parab

July 13, 2023
Tweet

More Decks by Viraj Parab

Other Decks in Technology

Transcript

  1. Page Object Pattern • Page Object allows to do and

    see that a user can on a page • Hide the underlying mechanics and show abstract-level interfaces
  2. User Account Account Issues Spoiled Accounts • Empty state verifications

    Playlist, recently played, search history, … • Concurrent Access Playback with Connect TDS(Test Data Service) • Provide a simple and scalable solution to acquire a Spotify user • Use a user pool and support tagging users • Don’t return the user currently being used
  3. Model Based Texting Abstraction of the real world • Consist

    of expected behavior and states of the system under the test • Test cases are automatically generated from models Test Case Generation 1. Smoke Test new AStarPath(new ReachedVertex(“v_Done”)) 1. Functional Test new RandomPath(new EdgeCoverage(100)) 1. Stability Test new RandomPath(new TimeDuration(30, TimeUnit.MINUTES))
  4. Cassette Testing A Fast Reproducible Integration Testing Environment With Robolectric

    Capabilities - Perform, record, and reply network requests for any given user (support OKHttp and custom protocol used at Spotify) - Simulate service binds to a pre-configured Android services (control playback, productupdates, …) - Simulate queries to a pre-configured ContentProvider - Check and assert on UI View hierarchy states - Simulate app states (foreground/background)
  5. Espresso Testing • Concise, beautiful, and reliable Android UI tests

    • Support synchronization with idling resources • Instrumented test: Have access to instrumentation information. e.g. the context of the app • Result with a recorded video, performance analysis, and more
  6. Robot Pattern (Separate what from the how) Robot is a

    class that encodes high level actions on a view or anything