ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/AnyEvent-WebDriver/WebDriver.pm
(Generate patch)

Comparing AnyEvent-WebDriver/WebDriver.pm (file contents):
Revision 1.2 by root, Tue Aug 28 22:59:53 2018 UTC vs.
Revision 1.3 by root, Tue Aug 28 23:07:02 2018 UTC

61sub req_ { 61sub req_ {
62 my ($wdf, $method, $ep, $body, $cb) = @_; 62 my ($wdf, $method, $ep, $body, $cb) = @_;
63 63
64 AnyEvent::HTTP::http_request $method => "$wdf->{_ep}$ep", 64 AnyEvent::HTTP::http_request $method => "$wdf->{_ep}$ep",
65 body => $body, 65 body => $body,
66 timeout => $self->{timeout},
66 headers => { "content-type" => "application/json; charset=utf-8", "cache-control" => "no-cache" }, 67 headers => { "content-type" => "application/json; charset=utf-8", "cache-control" => "no-cache" },
67 ($wdf->{proxy} eq "default" ? () : (proxy => $wdf->{proxy})), 68 ($wdf->{proxy} eq "default" ? () : (proxy => $wdf->{proxy})),
68 sub { 69 sub {
69 my ($res, $hdr) = @_; 70 my ($res, $hdr) = @_;
70 71
162 163
163If true (the default), then automatically execute C<delete_session> when 164If true (the default), then automatically execute C<delete_session> when
164the WebDriver object is destroyed with an active session. IF set to a 165the WebDriver object is destroyed with an active session. IF set to a
165false value, then the session will continue to exist. 166false value, then the session will continue to exist.
166 167
168=item timeout => $seconds
169
170The HTTP timeout, in (fractional) seconds (default: C<300>, but this will
171likely drastically reduce). This timeout is reset on any activity, so it
172is not an overall requiest timeout. Also, individual requests might extend
173this timeout if they are known to take longer.
174
167=back 175=back
168 176
169=cut 177=cut
170 178
171sub new { 179sub new {
173 181
174 bless { 182 bless {
175 endpoint => "http://localhost:4444", 183 endpoint => "http://localhost:4444",
176 proxy => undef, 184 proxy => undef,
177 autodelete => 1, 185 autodelete => 1,
186 timeout => 300,
178 %kv, 187 %kv,
179 }, $class 188 }, $class
180} 189}
181 190
182sub DESTROY { 191sub DESTROY {
439 448
440=item $wd->minimize_window 449=item $wd->minimize_window
441 450
442=item $wd->fullscreen_window 451=item $wd->fullscreen_window
443 452
444Changes the window size by eithe3r maximising, minimising or making it 453Changes the window size by either maximising, minimising or making it
445fullscreen. In my experience, this might timeout if no window manager is 454fullscreen. In my experience, this might timeout if no window manager is
446running. 455running.
447 456
448=cut 457=cut
449 458

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines