1
0

04-commands-implemented.t 795 B

123456789101112131415161718192021222324252627282930313233343536
  1. #!/usr/bin/perl
  2. use strict;
  3. use warnings;
  4. # TODO: find another way to do this checking, this is so fragile
  5. use Selenium::Remote::Commands;
  6. use Test::More;
  7. unless($ENV{RELEASE_TESTING}) {
  8. plan(skip_all=>"Author tests not required for installation.");
  9. }
  10. my $comm = Selenium::Remote::Commands->new->get_cmds;
  11. for my $command (keys %{$comm}) {
  12. my $found_command = 0;
  13. for my $file (
  14. qw{lib/Selenium/Remote/Driver.pm
  15. lib/Selenium/Remote/WebElement.pm}
  16. ) {
  17. open(my $fh, '<', $file) or die "Couldn't open file $file";
  18. for (<$fh>) {
  19. if (/'?command'?\s*=>\s*'$command'/
  20. or /{'?commands'?}->{'?$command'?}/) {
  21. pass("find $command");
  22. $found_command = 1;
  23. }
  24. }
  25. }
  26. if (!$found_command) {
  27. fail("find $command");
  28. }
  29. }
  30. done_testing;
  31. 1;