… | |
… | |
61 | sub req_ { |
61 | sub 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 | |
163 | If true (the default), then automatically execute C<delete_session> when |
164 | If true (the default), then automatically execute C<delete_session> when |
164 | the WebDriver object is destroyed with an active session. IF set to a |
165 | the WebDriver object is destroyed with an active session. IF set to a |
165 | false value, then the session will continue to exist. |
166 | false value, then the session will continue to exist. |
166 | |
167 | |
|
|
168 | =item timeout => $seconds |
|
|
169 | |
|
|
170 | The HTTP timeout, in (fractional) seconds (default: C<300>, but this will |
|
|
171 | likely drastically reduce). This timeout is reset on any activity, so it |
|
|
172 | is not an overall requiest timeout. Also, individual requests might extend |
|
|
173 | this timeout if they are known to take longer. |
|
|
174 | |
167 | =back |
175 | =back |
168 | |
176 | |
169 | =cut |
177 | =cut |
170 | |
178 | |
171 | sub new { |
179 | sub 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 | |
182 | sub DESTROY { |
191 | sub 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 | |
444 | Changes the window size by eithe3r maximising, minimising or making it |
453 | Changes the window size by either maximising, minimising or making it |
445 | fullscreen. In my experience, this might timeout if no window manager is |
454 | fullscreen. In my experience, this might timeout if no window manager is |
446 | running. |
455 | running. |
447 | |
456 | |
448 | =cut |
457 | =cut |
449 | |
458 | |