Corion / WWW-Mechanize-Chrome

automate the Chrome browser
https://metacpan.org/release/WWW-Mechanize-Chrome
Artistic License 2.0
30 stars 12 forks source link

add support for finding MacOS executable #9

Closed sdondley closed 6 years ago

sdondley commented 6 years ago

OK, I added in the bit of code Corion suggested from https://github.com/Corion/WWW-Mechanize-Chrome/pull/7#issuecomment-402547106

I also needed to make a small change to the build_command_line function.

As a result of the patch, tests can now be run. However, many of them fail. I will create a new issue for these failures.

Corion commented 6 years ago

Thank you very much!

sdondley commented 6 years ago

Glad to help. But it looks like the patch may have to be corrected.

When I ran the tests before submitting the patch, I already had an instance of Chrome already open.

When I rerun the tests without an instance of Chrome already open, the tests are unable to connect to Chrome:


t/00-load.t ...................... ok
t/01-chrome-devtools-protocol.t .. # Testing with /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
t/01-chrome-devtools-protocol.t .. 1/6 Use of uninitialized value $version in sprintf at t/helper.pm line 95.
# Failed on Chrome version ''
t/01-chrome-devtools-protocol.t .. ok
t/02-chrome-devtools-tab.t ....... # Testing with /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
t/02-chrome-devtools-tab.t ....... 1/4 Use of uninitialized value $version in sprintf at t/helper.pm line 95.
# Failed on Chrome version ''
t/02-chrome-devtools-tab.t ....... ok
t/47-mech-simplest.t ............. skipped: Couldn't connect to Chrome: error when connectingInternal Exception at /Users/stevedondley/perl/raw_modules/git_repo/WWW-Mechanize-Chrome/blib/lib/WWW/Mechanize/Chrome.pm line 505.
t/49-mech-get-file.t ............. # Testing with /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
t/49-mech-get-file.t ............. 1/14 Use of uninitialized value $version in sprintf at t/helper.pm line 95.
# Failed on Chrome version ''
t/49-mech-get-file.t ............. ok
t/49-mech-nav.t .................. # Testing with /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
t/49-mech-nav.t .................. 1/4 # Failed on Chrome version ''
Couldn't remove tempfile /var/folders/nc/1y1czqf96736xppxnnkmgkrc0000gn/T/h7yY2l9XeC : No such file or directory
t/49-mech-nav.t .................. ok
t/49-port.t ...................... # Testing with /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
t/49-port.t ...................... 1/1 # Failed on Chrome version ''
Couldn't remove tempfile /var/folders/nc/1y1czqf96736xppxnnkmgkrc0000gn/T/dHevH4DznE : No such file or directory
<snip>
sdondley commented 6 years ago

Problems in last comment have been resolved by https://github.com/Corion/WWW-Mechanize-Chrome/pull/11