Skip to content
This repository has been archived by the owner on Dec 7, 2019. It is now read-only.

Read external storage variable for downloading screenshots #168

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

plastiv
Copy link
Contributor

@plastiv plastiv commented Feb 15, 2019

Fixes #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 square/spoon#283

Copy link

@dailypush dailypush left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Should it be png file coming through or does it not matter?
  • When "pullTestFiles" executes to pull one of the files back I am seeing a non-null is null: method kotlin.collections.ArraysKt_ArraysKt.toList
    looks to be pointing to Line 184

Attempting to roll back and see if I get same issue

@dailypush
Copy link

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

@artem-zinnatullin
Copy link
Collaborator

@plastiv can you address @dailypush comment?

@plastiv
Copy link
Contributor Author

plastiv commented Mar 18, 2019

@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 #124 and likely exists regardless of this MR.

@dailypush
Copy link

dailypush commented Mar 19, 2019

@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
Copy link

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

@CristianGM
Copy link
Contributor

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Screenshots not being pulled on API 22
5 participants