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

Scalable UI testing solutions かんたんまとめ

mkeeda
June 02, 2023

Scalable UI testing solutions かんたんまとめ

Google I/O 2023のセッション「Scalable UI testing solutions」の内容をまとめたスライドです
https://www.youtube.com/watch?v=L6CSaH0kDnI

mkeeda

June 02, 2023
Tweet

More Decks by mkeeda

Other Decks in Programming

Transcript

  1. Scalable UI testing solutions


    Google I/O
    2
    02
    3
    LT


    View full-size slide

  2. Summary
    Espresso Device API


    Firebase Test Lab

    with Gradle Managed Devices


    Compose Screenshot Test
    2
    https://www.youtube.com/watch?v=L
    6
    CSaH
    0
    kDnI

    View full-size slide

  3. Espresso Device API
    3

    View full-size slide



  4. Foldable device
    4

    View full-size slide

  5. Con
    fi
    guration Change


    Con
    fi
    guration Change




    Android Emulator
    33
    .
    1
    .
    10

    Android Gradle Plugin
    8
    .
    2
    .
    0
    -alpha
    04

    https://developer.android.com/studio/preview/features#espresso-
    device-api
    androidx.test.espresso:espresso-device
    5

    View full-size slide

  6. Firebase Test Lab

    with Gradle Managed Devices
    7

    View full-size slide

  7. 8
    Gradle Managed Devices
    Gradle AndroidTest


    AVD


    /CI


    AGP
    8
    .
    2
    .
    0
    -alpha
    01 

    Firebase Test Lab

    View full-size slide

  8. 10
    $ gcloud auth login
    $ gcloud config set project PROJECT_ID
    $ ./gradlew assembleDebugAndroidTest
    $ gcloud firebase test android run \
    --type instrumentation \
    --app app-debug-unaligned.apk \
    --test app-debug-test-unaligned.apk \
    --device model=Nexus6,version=21,locale=en,orientation=portrait \
    --device model=Nexus7,version=19,locale=fr,orientation=landscape
    --client-details matrixLabel="Example matrix label"

    View full-size slide

  9. Compose Screenshot Test
    11

    View full-size slide

  10. Screenshot test
    UI
    12

    View full-size slide

  11. 13
    Preview
    @Preview
    @Composable
    fun CardPreview() {
    //…
    }

    View full-size slide

  12. Host-side screenshot test
    @Preview Composable


    AndroidTest



    Android Gradle Plugin
    8
    .
    2
    .
    0
    14

    View full-size slide