airbnb / okreplay

📼 Record and replay OkHttp network interaction in your tests.
Apache License 2.0
781 stars 71 forks source link

Multiple flavours wrong pull directory #88

Closed ptrudec closed 4 years ago

ptrudec commented 5 years ago

I have two flavours of app: main and chain. Main has applicationId = "com.domain.app" and Chain has applicationId = "com.domain.app.chain" . When i try to pull tapes it pulls from /sdcard/okreplay/tapes/com.domain.app.chain.test/ and when i comment Chain flavour in gradle it pulls from /sdcard/okreplay/tapes/com.domain.app.test/ like it should be. Also folder on sd card is named com.domain.app.chain.test no matter if Chain is commented or not in gradle. Does this library has support for multiple flavours?

slott commented 4 years ago

I can recall this worked prior to version 1.5 - so for now I'm having a custom task to pull the tapes...

slott commented 4 years ago

Here is a little bash script that will do the work

#!/bin/bash
TAPE_PATH=/sdcard/okreplay/tapes/<applicationId>

CURRENT_DIR=`pwd`
echo $CURRENT_DIR
# This is where we want the tapes to be dumped
cd "app/src/androidTest/assets/tapes"
for d in `adb shell ls ${TAPE_PATH}`; do
    adb pull ${TAPE_PATH}/${d}
done
cd $CURRENT_DIR