--- /dev/null
+<html>
+<body>
+<table border="1" class="docutils" id="google-search-example">
+<colgroup>
+<col width="32%" />
+<col width="47%" />
+<col width="21%" />
+</colgroup>
+<tbody valign="top">
+<tr><td>open</td>
+<td>/</td>
+
+<td> </td>
+</tr>
+<tr><td>type</td>
+<td>q</td>
+<td>selenium rc</td>
+</tr>
+<tr><td>clickAndWait</td>
+<td>btnG</td>
+<td> </td>
+</tr>
+<tr><td>textLike</td>
+
+<td>Searches related to selenium rc</td>
+<td> </td>
+</tr>
+</tbody>
+</table>
+</body>
+</html>
use strictures 1;
use File::Find;
-use WWW::Selenium;
+use Socialtext::WikiFixture::Selenese;
use HTML::TableExtract;
use IO::All;
}
}
+sub new {
+ my ($class, $self) = @_;
+ bless $self, $class;
+}
+
sub test_directory {
- my ($self) = @_;
- my @tests = File::Find::Rule->file()->name('*.html')->in($self->{dir});
+ my ($self, $dir) = @_;
+ my @tests = File::Find::Rule->file()->name('*.html')->in($dir);
$self->run_tests_for($_) for @tests;
}
sub run_tests_for {
my ($self, $html_file) = @_;
my $rows = $self->get_rows_for($html_file);
- my $src = WWW::Selenium->new(
- host => $args->{host},
- port => $args->{port},
- browser_url => $args->{browser_url},
+ my $src = Socialtext::WikiFixture::Selenese->new(
+ host => $self->{host},
+ port => $self->{port},
+ browser => $self->{browser},
+ browser_url => $self->{browser_url},
);
$src->run_test_table($rows);
}
--- /dev/null
+#!/usr/bin/perl
+use strict;
+use warnings;
+
+use lib 'lib';
+use Test::Harness::Selenium;
+
+my $s = Test::Harness::Selenium->new({
+ host => 'localhost',
+ port => 4444,
+ browser_url => 'http://www.google.com',
+ browser => shift,
+});
+$s->run_tests_for('basic.html');