Skip to content

Commit a852596

Browse files
authored
Add the http client configuration example for ruby (#1704)
Add the http client configuration example Co-authored-by: aguspe <[email protected]> [deploy site]
1 parent cbbcd54 commit a852596

File tree

5 files changed

+17
-6
lines changed

5 files changed

+17
-6
lines changed
Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
1-
# frozen_string_literal: true
2-
31
require 'spec_helper'
42

53
RSpec.describe 'HTTP Client' do
4+
let(:url) { 'https://www.selenium.dev/selenium/web/' }
5+
6+
it 'sets client configuration' do
7+
client = Selenium::WebDriver::Remote::Http::Default.new(open_timeout: 30, read_timeout: 30)
8+
expect(client.open_timeout).to eq 30
9+
end
10+
11+
it 'uses the custom http client' do
12+
client = Selenium::WebDriver::Remote::Http::Default.new
13+
driver = Selenium::WebDriver.for :chrome, http_client: client
14+
driver.get(url)
15+
driver.quit
16+
end
617
end

website_and_docs/content/documentation/webdriver/drivers/http_client.en.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ These allow you to set various parameters for the HTTP library
1717
{{< badge-code >}}
1818
{{< /tab >}}
1919
{{< tab header="Ruby" >}}
20-
{{< badge-code >}}
20+
{{< gh-codeblock path="examples/ruby/spec/drivers/http_client_spec.rb#L9-L10" >}}
2121
{{< /tab >}}
2222
{{< tab header="JavaScript" >}}
2323
{{< badge-code >}}

website_and_docs/content/documentation/webdriver/drivers/http_client.ja.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ These allow you to set various parameters for the HTTP library
1717
{{< badge-code >}}
1818
{{< /tab >}}
1919
{{< tab header="Ruby" >}}
20-
{{< badge-code >}}
20+
{{< gh-codeblock path="examples/ruby/spec/drivers/http_client_spec.rb#L9-L10" >}}
2121
{{< /tab >}}
2222
{{< tab header="JavaScript" >}}
2323
{{< badge-code >}}

website_and_docs/content/documentation/webdriver/drivers/http_client.pt-br.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ These allow you to set various parameters for the HTTP library
1717
{{< badge-code >}}
1818
{{< /tab >}}
1919
{{< tab header="Ruby" >}}
20-
{{< badge-code >}}
20+
{{< gh-codeblock path="examples/ruby/spec/drivers/http_client_spec.rb#L9-L10" >}}
2121
{{< /tab >}}
2222
{{< tab header="JavaScript" >}}
2323
{{< badge-code >}}

website_and_docs/content/documentation/webdriver/drivers/http_client.zh-cn.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ weight: 3
1717
{{< badge-code >}}
1818
{{< /tab >}}
1919
{{< tab header="Ruby" >}}
20-
{{< badge-code >}}
20+
{{< gh-codeblock path="examples/ruby/spec/drivers/http_client_spec.rb#L9-L10" >}}
2121
{{< /tab >}}
2222
{{< tab header="JavaScript" >}}
2323
{{< badge-code >}}

0 commit comments

Comments
 (0)