gojuno / composer

Reactive Android Instrumentation Test Runner. Archived. Marathon is recommended as an alternative (https://github.com/Malinskiy/marathon).
Apache License 2.0
546 stars 45 forks source link

Read external storage variable for downloading screenshots #168

Open plastiv opened 5 years ago

plastiv commented 5 years ago

Fixes https://github.com/gojuno/composer/issues/151

I've checked locally that screenshots are downloaded on both emulator 21 and 28.

NOTE: emulators 21-22 doesn't have writable sdcard mounted by default. So it has to be created first. For the reference https://github.com/square/spoon/issues/283

dailypush commented 5 years ago

Rolled back to using just pullfolder not flat mapping and that seems to have fixed it..

artem-zinnatullin commented 5 years ago

@plastiv can you address @dailypush comment?

plastiv commented 5 years ago

@dailypush Thank you for taking time to review these changes. Can you please confirm that issue is with these MR and you are able to run released composer successfully and screenshots are present in html report?

I don't understand how to reproduce NPE, which looks to be the same as https://github.com/gojuno/composer/pull/124 and likely exists regardless of this MR.

dailypush commented 5 years ago

@plastiv To a certain extent I would agree about #124 .. but maybe then merge the two for a proper working solution. As it breaks with just the suggested changes... So basically right now I have working code by just changing the folder directory to the sdcard and not using the this latest flat mapping.

.pullFolder( // TODO: Add support for internal storage and external storage strategies. folderOnDevice = "/sdcard/app_spoon-screenshots/${test.className}/${test.testName}", folderOnHostMachine = screenshotsFolderOnHostMachine, logErrors = verboseOutput )

The original code from this branch I am getting that Null exception that seems to be residing from around here (which I believe you have another branch and pull request to address?)

.map { screenshotsFolderOnHostMachine -> PulledFiles( files = emptyList(), // TODO: Pull test files. screenshots = screenshotsFolderOnHostMachine.let { when (it.exists()) { true -> it.listFiles().toList() else -> emptyList() } } )

There doesn't seem to be a unit test that would flush this out for reproducing and is a little harder to show examples.

(Not sure why we need a flatmap inside the other flatmap with a containing map?, I am not that well versed in kotlin but just seems odd )

wellavelino commented 5 years ago

Hey guys, just wondering if there's any progress with this, will be handy to have it.

CristianGM commented 4 years ago

Hum...guys? anyone is gonna work on Composer anymore? or is just abandoned?