5 use Class::Method::Modifiers;
6 use ExtUtils::MakeMaker qw(prompt);
8 if (!$ENV{AUTOMATED_TESTING}) {
10 my ($orig, $self) = (shift, shift);
11 my $res = $self->$orig(@_);
13 if ('y' eq prompt "Well that didn't work, did it. Bail out?", 'y') {
22 my $CAT_SERVER_PORT = 15000 + $<;
23 my $VNC_SERVER_PORT = 5900 + $<;
24 my $SEL_SERVER_PORT = 6900 + $<;
26 sub gimme_table ($file) {
27 my $te = HTML::TableExtract->new;
28 $te->parse(do { local (@ARGV, $/) = ($file); <> });
31 [ map { (!defined or $_ eq "\240") ? () : $_ } @$_ ]
32 } ($te->tables)[0]->rows;
38 sub start_server ($port) {
39 my $server = Proc::Background->new(
43 'script/app_server.pl', '-p', $port
49 sub setup_selenium ($system, $port, $browser, $server_url) {
50 Socialtext::WikiFixture::Selenese->new(
51 selenium => do { my $s = Test::WWW::Selenium->new(
55 browser_url => $server_url,
60 --- t/sel-local-lib/lib/perl5/Socialtext/WikiFixture/Selenese.pm 2007-06-21 18:28:37.000000000 -0400
61 +++ t/sel-overrides/Socialtext/WikiFixture/Selenese.pm 2010-06-29 14:11:17.000000000 -0400
65 # Try to guess _ok methods
66 - $command .= '_ok' if { map { $_ => 1 } qw(open type) }->{$command};
67 + $command .= '_ok' if { map { $_ => 1 } qw(open type click) }->{$command};
68 $self->$command($opt1, $opt2);
72 $command = lc($1) . '_like';
77 + if ($command =~ /^(?:assert|verify)_(\w+)$/) {
78 + $command = lc($1) . '_is';
85 $sel->wait_for_page_to_load_ok($self->{selenium_timeout}, @args);
88 +sub select_and_wait {
89 + my ($self, $opt1, $opt2) = @_;
90 + my $sel = $self->{selenium};
93 + push @args, $opt2 if $opt2;
94 + $sel->select_ok($opt1, @args);
95 + $sel->wait_for_page_to_load_ok($self->{selenium_timeout}, @args);
98 =head2 text_present_like()
100 Search entire body for given text