binary.t 849 B

12345678910111213141516171819202122232425262728293031323334
  1. #! /usr/bin/perl
  2. use strict;
  3. use warnings;
  4. use Test::More;
  5. use Selenium::Binary;
  6. use Selenium::Chrome;
  7. use Selenium::PhantomJS;
  8. use FindBin;
  9. use lib $FindBin::Bin . '/lib';
  10. use TestHarness;
  11. my $harness = TestHarness->new(
  12. this_file => $FindBin::Script
  13. );
  14. my %caps = %{ $harness->base_caps };
  15. delete $caps{browser_name};
  16. PHANTOMJS: {
  17. my $ghost = Selenium::PhantomJS->new( %caps );
  18. is( $ghost->browser_name, 'phantomjs', 'binary phantomjs is okay');
  19. isnt( $ghost->port, 4444, 'phantomjs can start up its own binary');
  20. }
  21. CHROME: {
  22. $ENV{PATH} .= ':/usr/local/lib/node_modules/protractor/selenium';
  23. my $chrome = Selenium::Chrome->new( %caps );
  24. ok( $chrome->browser_name eq 'chrome', 'convenience chrome is okay' );
  25. isnt( $chrome->port, 4444, 'chrome can start up its own binary');
  26. $chrome->quit;
  27. }
  28. done_testing;