david-dick / firefox-marionette

This is a client module to automate the Mozilla Firefox browser via the Marionette protocol
https://metacpan.org/dist/Firefox-Marionette
Other
12 stars 3 forks source link

selfie does not return a File::Temp object #5

Closed eserte closed 3 years ago

eserte commented 3 years ago

Contrary to what is written in the documentation, selfie does not return a File::Temp object, but just a filehandle. The difference between both is that for example the filename method is not available for the latter (which would be quite handy for some kind for things like system("display", $selfie->filename) without the need to create another temporary file).

It seems that a real File::Temp may be created using the following (no other code changes needed):

        my $handle = File::Temp->new(
        TEMPLATE => File::Spec->catfile(
                File::Spec->tmpdir(), 'firefox_marionette_selfie_XXXXXXXXXXX'
            )
          )

(I can create a formal PR if this problem is accepted)

david-dick commented 3 years ago

Good catch. Fix committed.