Skip to content

Commit 9a54ed5

Browse files
authored
Start the work for the options page (#1668)
* Start the work for the options page * Move upgrade to selenium examples * Update platform name * Update platform name and platform version * Add skip method --------- Co-authored-by: aguspe <[email protected]> [deploy site]
1 parent a4156d4 commit 9a54ed5

File tree

9 files changed

+60
-54
lines changed

9 files changed

+60
-54
lines changed

examples/ruby/spec/drivers/options_spec.rb

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,31 +6,44 @@
66
describe 'Driver Options' do
77
let(:chrome_location) { driver_finder && ENV.fetch('CHROME_BIN', nil) }
88

9-
it 'page load strategy normal' do
9+
it 'page load strategy normal' do
1010
options = Selenium::WebDriver::Options.chrome
1111
options.page_load_strategy = :normal
1212

1313
driver = Selenium::WebDriver.for :chrome, options: options
1414
driver.get('https://www.google.com')
1515
driver.quit
16-
end
16+
end
1717

18-
it 'page load strategy eager' do
19-
options = Selenium::WebDriver::Options.chrome
20-
options.page_load_strategy = :eager
18+
it 'page load strategy eager' do
19+
options = Selenium::WebDriver::Options.chrome
20+
options.page_load_strategy = :eager
2121

22-
driver = Selenium::WebDriver.for :chrome, options: options
23-
driver.get('https://www.google.com')
24-
driver.quit
25-
end
22+
driver = Selenium::WebDriver.for :chrome, options: options
23+
driver.get('https://www.google.com')
24+
driver.quit
25+
end
2626

27-
it 'page load strategy none' do
27+
it 'page load strategy none' do
2828
options = Selenium::WebDriver::Options.chrome
2929
options.page_load_strategy = :none
3030

3131
driver = Selenium::WebDriver.for :chrome, options: options
3232
driver.get('https://www.google.com')
3333
driver.quit
34-
end
34+
end
35+
36+
it 'sets remote capabilities', skip: 'this is example code that will not execute' do
37+
options = Selenium::WebDriver::Options.firefox
38+
options.platform_name = 'Windows 10'
39+
options.browser_version = 'latest'
40+
cloud_options = {}
41+
cloud_options[:build] = my_test_build
42+
cloud_options[:name] = my_test_name
43+
options.add_option('cloud:options', cloud_options)
44+
driver = Selenium::WebDriver.for :remote, capabilities: options
45+
driver.get('https://www.google.com')
46+
driver.quit
47+
end
3548
end
3649
end

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Browser name is set by default when using an Options class instance.
4040
{{< badge-code >}}
4141
{{< /tab >}}
4242
{{< tab header="Ruby" >}}
43-
{{< badge-code >}}
43+
{{< gh-codeblock path="examples/ruby/spec/drivers/options_spec.rb#L10" >}}
4444
{{< /tab >}}
4545
{{< tab header="JavaScript" >}}
4646
{{< badge-code >}}
@@ -67,7 +67,7 @@ it will be automatically downloaded by [Selenium Manager]({{< ref "../../seleniu
6767
{{< badge-code >}}
6868
{{< /tab >}}
6969
{{< tab header="Ruby" >}}
70-
{{< badge-code >}}
70+
{{< gh-codeblock path="examples/ruby/spec/drivers/service_spec.rb#L35" >}}
7171
{{< /tab >}}
7272
{{< tab header="JavaScript" >}}
7373
{{< badge-code >}}
@@ -296,7 +296,7 @@ setting `platformName` sets the OS at the remote-end.
296296
{{< badge-code >}}
297297
{{< /tab >}}
298298
{{< tab header="Ruby" >}}
299-
{{< badge-code >}}
299+
{{< gh-codeblock path="examples/ruby/spec/drivers/options_spec.rb#L37-L38" >}}
300300
{{< /tab >}}
301301
{{< tab header="JavaScript" >}}
302302
{{< badge-code >}}

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Browser name is set by default when using an Options class instance.
4040
{{< badge-code >}}
4141
{{< /tab >}}
4242
{{< tab header="Ruby" >}}
43-
{{< badge-code >}}
43+
{{< gh-codeblock path="examples/ruby/spec/drivers/options_spec.rb#L10" >}}
4444
{{< /tab >}}
4545
{{< tab header="JavaScript" >}}
4646
{{< badge-code >}}
@@ -68,7 +68,7 @@ it will be automatically downloaded by [Selenium Manager]({{< ref "../../seleniu
6868
{{< badge-code >}}
6969
{{< /tab >}}
7070
{{< tab header="Ruby" >}}
71-
{{< badge-code >}}
71+
{{< gh-codeblock path="examples/ruby/spec/drivers/service_spec.rb#L35" >}}
7272
{{< /tab >}}
7373
{{< tab header="JavaScript" >}}
7474
{{< badge-code >}}
@@ -290,7 +290,7 @@ fun main() {
290290
{{< badge-code >}}
291291
{{< /tab >}}
292292
{{< tab header="Ruby" >}}
293-
{{< badge-code >}}
293+
{{< gh-codeblock path="examples/ruby/spec/drivers/options_spec.rb#L37-L38" >}}
294294
{{< /tab >}}
295295
{{< tab header="JavaScript" >}}
296296
{{< badge-code >}}

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

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,27 @@ Esta capacidade é usada para definir o `browserName` para uma determinada sess
4141
Se o navegador especificado não estiver instalado no
4242
extremidade remota, a criação da sessão falhará.
4343

44+
{{< tabpane text=true >}}
45+
{{< tab header="Java" >}}
46+
{{< badge-code >}}
47+
{{< /tab >}}
48+
{{% tab header="Python" %}}
49+
{{< badge-code >}}
50+
{{% /tab %}}
51+
{{< tab header="CSharp" >}}
52+
{{< badge-code >}}
53+
{{< /tab >}}
54+
{{< tab header="Ruby" >}}
55+
{{< gh-codeblock path="examples/ruby/spec/drivers/options_spec.rb#L10" >}}
56+
{{< /tab >}}
57+
{{< tab header="JavaScript" >}}
58+
{{< badge-code >}}
59+
{{< /tab >}}
60+
{{< tab header="Kotlin" >}}
61+
{{< badge-code >}}
62+
{{< /tab >}}
63+
{{< /tabpane >}}
64+
4465
## browserVersion
4566

4667
Esta capacidade é opcional, é usada para
@@ -59,7 +80,7 @@ tiver apenas 80 instalados, a criação da sessão falhará.
5980
{{< badge-code >}}
6081
{{< /tab >}}
6182
{{< tab header="Ruby" >}}
62-
{{< badge-code >}}
83+
{{< gh-codeblock path="examples/ruby/spec/drivers/service_spec.rb#L35" >}}
6384
{{< /tab >}}
6485
{{< tab header="JavaScript" >}}
6586
{{< badge-code >}}
@@ -286,7 +307,7 @@ setting `platformName` sets the OS at the remote-end.
286307
{{< badge-code >}}
287308
{{< /tab >}}
288309
{{< tab header="Ruby" >}}
289-
{{< badge-code >}}
310+
{{< gh-codeblock path="examples/ruby/spec/drivers/options_spec.rb#L37-L38" >}}
290311
{{< /tab >}}
291312
{{< tab header="JavaScript" >}}
292313
{{< badge-code >}}

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ Browser name is set by default when using an Options class instance.
4343
{{< badge-code >}}
4444
{{< /tab >}}
4545
{{< tab header="Ruby" >}}
46-
{{< badge-code >}}
46+
{{< gh-codeblock path="examples/ruby/spec/drivers/options_spec.rb#L10" >}}
4747
{{< /tab >}}
4848
{{< tab header="JavaScript" >}}
4949
{{< badge-code >}}
@@ -71,7 +71,7 @@ it will be automatically downloaded by [Selenium Manager]({{< ref "../../seleniu
7171
{{< badge-code >}}
7272
{{< /tab >}}
7373
{{< tab header="Ruby" >}}
74-
{{< badge-code >}}
74+
{{< gh-codeblock path="examples/ruby/spec/drivers/service_spec.rb#L35" >}}
7575
{{< /tab >}}
7676
{{< tab header="JavaScript" >}}
7777
{{< badge-code >}}
@@ -302,7 +302,7 @@ fun main() {
302302
{{< badge-code >}}
303303
{{< /tab >}}
304304
{{< tab header="Ruby" >}}
305-
{{< badge-code >}}
305+
{{< gh-codeblock path="examples/ruby/spec/drivers/options_spec.rb#L37-L38" >}}
306306
{{< /tab >}}
307307
{{< tab header="JavaScript" >}}
308308
{{< badge-code >}}

website_and_docs/content/documentation/webdriver/troubleshooting/upgrade_to_selenium_4.en.md

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -135,14 +135,7 @@ browserOptions.AddAdditionalOption("cloud:options", cloudOptions);
135135
var driver = new RemoteWebDriver(new Uri(CloudURL), browserOptions);
136136
{{< /tab >}}
137137
{{< tab header="Ruby" >}}
138-
options = Selenium::WebDriver::Options.firefox
139-
options.browser_version = 'latest'
140-
options.platform_name = 'Windows 10'
141-
cloud_options = {}
142-
cloud_options[:build] = my_test_build
143-
cloud_options[:name] = my_test_name
144-
options.add_option('cloud:options', cloud_options)
145-
driver = Selenium::WebDriver.for :remote, url: cloud_url, capabilities: options
138+
{{< gh-codeblock path="examples/ruby/spec/drivers/options_spec.rb#L37-L46">}}
146139
{{< /tab >}}
147140
{{< tab header="Python" >}}
148141
from selenium.webdriver.firefox.options import Options as FirefoxOptions

website_and_docs/content/documentation/webdriver/troubleshooting/upgrade_to_selenium_4.ja.md

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -129,14 +129,7 @@ browserOptions.AddAdditionalOption("cloud:options", cloudOptions);
129129
var driver = new RemoteWebDriver(new Uri(CloudURL), browserOptions);
130130
{{< /tab >}}
131131
{{< tab header="Ruby" >}}
132-
options = Selenium::WebDriver::Options.firefox
133-
options.browser_version = 'latest'
134-
options.platform_name = 'Windows 10'
135-
cloud_options = {}
136-
cloud_options[:build] = my_test_build
137-
cloud_options[:name] = my_test_name
138-
options.add_option('cloud:options', cloud_options)
139-
driver = Selenium::WebDriver.for :remote, url: cloud_url, capabilities: options
132+
{{< gh-codeblock path="examples/ruby/spec/drivers/options_spec.rb#L37-L46">}}
140133
{{< /tab >}}
141134
{{< tab header="Python" >}}
142135
from selenium.webdriver.firefox.options import Options as FirefoxOptions

website_and_docs/content/documentation/webdriver/troubleshooting/upgrade_to_selenium_4.pt-br.md

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -132,14 +132,7 @@ browserOptions.AddAdditionalOption("cloud:options", cloudOptions);
132132
var driver = new RemoteWebDriver(new Uri(CloudURL), browserOptions);
133133
{{< /tab >}}
134134
{{< tab header="Ruby" >}}
135-
options = Selenium::WebDriver::Options.firefox
136-
options.browser_version = 'latest'
137-
options.platform_name = 'Windows 10'
138-
cloud_options = {}
139-
cloud_options[:build] = my_test_build
140-
cloud_options[:name] = my_test_name
141-
options.add_option('cloud:options', cloud_options)
142-
driver = Selenium::WebDriver.for :remote, url: cloud_url, capabilities: options
135+
{{< gh-codeblock path="examples/ruby/spec/drivers/options_spec.rb#L37-L46">}}
143136
{{< /tab >}}
144137
{{< tab header="Python" >}}
145138
from selenium.webdriver.firefox.options import Options as FirefoxOptions

website_and_docs/content/documentation/webdriver/troubleshooting/upgrade_to_selenium_4.zh-cn.md

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -143,14 +143,7 @@ browserOptions.AddAdditionalOption("cloud: options", cloudOptions);
143143
var driver = new RemoteWebDriver(new Uri(CloudURL), browserOptions);
144144
{{< /tab >}}
145145
{{< tab header="Ruby" >}}
146-
options = Selenium: : WebDriver: : Options.firefox
147-
options.browser_version = 'latest'
148-
options.platform_name = 'Windows 10'
149-
cloud_options = {}
150-
cloud_options[: build] = my_test_build
151-
cloud_options[: name] = my_test_name
152-
options.add_option('cloud: options', cloud_options)
153-
driver = Selenium: : WebDriver.for : remote, url: cloud_url, capabilities: options
146+
{{< gh-codeblock path="examples/ruby/spec/drivers/options_spec.rb#L37-L46">}}
154147
{{< /tab >}}
155148
{{< tab header="Python" >}}
156149
from selenium.webdriver.firefox.options import Options as FirefoxOptions

0 commit comments

Comments
 (0)