1
0

04-commands-implemented.t 779 B

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