1
0

firefox.test 603 B

12345678910111213141516171819202122232425
  1. use strict;
  2. use warnings;
  3. use Selenium::Firefox;
  4. use Test::More tests => 3;
  5. use Test::Fatal;
  6. my $driver;
  7. is( exception { $driver = Selenium::Firefox->new(
  8. extra_capabilities => {
  9. 'moz:firefoxOptions' => {
  10. args => [ '-headless' ],
  11. },
  12. },
  13. ); }, undef, "can spawn new Selenium::Firefox");
  14. my $port = $driver->port();
  15. is( exception { $driver->shutdown_binary; }, undef, "can shutdown binary correctly");
  16. sleep 2;
  17. my $cmd = "lsof -t -i :$port";
  18. my $pid = `$cmd`;
  19. chomp $pid;
  20. is($pid,'',"Destructor appears to have run shutdown_binary and whacked the driver process");