chrome.test 482 B

12345678910111213141516171819
  1. use strict;
  2. use warnings;
  3. use Selenium::Chrome;
  4. use Test::More tests => 3;
  5. use Test::Fatal;
  6. my $driver;
  7. is( exception { $driver = Selenium::Chrome->new(); }, undef, "can spawn new Selenium::Chrome");
  8. my $port = $driver->port();
  9. is( exception { $driver->shutdown_binary; }, undef, "can shutdown binary correctly");
  10. sleep 2;
  11. my $cmd = "lsof -t -i :$port";
  12. my $pid = `$cmd`;
  13. chomp $pid;
  14. is($pid,'',"Destructor appears to have run shutdown_binary and whacked the driver process");