Skip to content

Start the work for the options page #1668

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Apr 17, 2024
35 changes: 24 additions & 11 deletions examples/ruby/spec/drivers/options_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,44 @@
describe 'Driver Options' do
let(:chrome_location) { driver_finder && ENV.fetch('CHROME_BIN', nil) }

it 'page load strategy normal' do
it 'page load strategy normal' do
options = Selenium::WebDriver::Options.chrome
options.page_load_strategy = :normal

driver = Selenium::WebDriver.for :chrome, options: options
driver.get('https://www.google.com')
driver.quit
end
end

it 'page load strategy eager' do
options = Selenium::WebDriver::Options.chrome
options.page_load_strategy = :eager
it 'page load strategy eager' do
options = Selenium::WebDriver::Options.chrome
options.page_load_strategy = :eager

driver = Selenium::WebDriver.for :chrome, options: options
driver.get('https://www.google.com')
driver.quit
end
driver = Selenium::WebDriver.for :chrome, options: options
driver.get('https://www.google.com')
driver.quit
end

it 'page load strategy none' do
it 'page load strategy none' do
options = Selenium::WebDriver::Options.chrome
options.page_load_strategy = :none

driver = Selenium::WebDriver.for :chrome, options: options
driver.get('https://www.google.com')
driver.quit
end
end

it 'sets remote capabilities', skip: 'this is example code that will not execute' do
options = Selenium::WebDriver::Options.firefox
options.platform_name = 'Windows 10'
options.browser_version = 'latest'
cloud_options = {}
cloud_options[:build] = my_test_build
cloud_options[:name] = my_test_name
options.add_option('cloud:options', cloud_options)
driver = Selenium::WebDriver.for :remote, capabilities: options
driver.get('https://www.google.com')
driver.quit
end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Browser name is set by default when using an Options class instance.
{{< badge-code >}}
{{< /tab >}}
{{< tab header="Ruby" >}}
{{< badge-code >}}
{{< gh-codeblock path="examples/ruby/spec/drivers/options_spec.rb#L10" >}}
{{< /tab >}}
{{< tab header="JavaScript" >}}
{{< badge-code >}}
Expand All @@ -67,7 +67,7 @@ it will be automatically downloaded by [Selenium Manager]({{< ref "../../seleniu
{{< badge-code >}}
{{< /tab >}}
{{< tab header="Ruby" >}}
{{< badge-code >}}
{{< gh-codeblock path="examples/ruby/spec/drivers/service_spec.rb#L35" >}}
{{< /tab >}}
{{< tab header="JavaScript" >}}
{{< badge-code >}}
Expand Down Expand Up @@ -296,7 +296,7 @@ setting `platformName` sets the OS at the remote-end.
{{< badge-code >}}
{{< /tab >}}
{{< tab header="Ruby" >}}
{{< badge-code >}}
{{< gh-codeblock path="examples/ruby/spec/drivers/options_spec.rb#L37-L38" >}}
{{< /tab >}}
{{< tab header="JavaScript" >}}
{{< badge-code >}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Browser name is set by default when using an Options class instance.
{{< badge-code >}}
{{< /tab >}}
{{< tab header="Ruby" >}}
{{< badge-code >}}
{{< gh-codeblock path="examples/ruby/spec/drivers/options_spec.rb#L10" >}}
{{< /tab >}}
{{< tab header="JavaScript" >}}
{{< badge-code >}}
Expand Down Expand Up @@ -68,7 +68,7 @@ it will be automatically downloaded by [Selenium Manager]({{< ref "../../seleniu
{{< badge-code >}}
{{< /tab >}}
{{< tab header="Ruby" >}}
{{< badge-code >}}
{{< gh-codeblock path="examples/ruby/spec/drivers/service_spec.rb#L35" >}}
{{< /tab >}}
{{< tab header="JavaScript" >}}
{{< badge-code >}}
Expand Down Expand Up @@ -290,7 +290,7 @@ fun main() {
{{< badge-code >}}
{{< /tab >}}
{{< tab header="Ruby" >}}
{{< badge-code >}}
{{< gh-codeblock path="examples/ruby/spec/drivers/options_spec.rb#L37-L38" >}}
{{< /tab >}}
{{< tab header="JavaScript" >}}
{{< badge-code >}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,27 @@ Esta capacidade é usada para definir o `browserName` para uma determinada sess
Se o navegador especificado não estiver instalado no
extremidade remota, a criação da sessão falhará.

{{< tabpane text=true >}}
{{< tab header="Java" >}}
{{< badge-code >}}
{{< /tab >}}
{{% tab header="Python" %}}
{{< badge-code >}}
{{% /tab %}}
{{< tab header="CSharp" >}}
{{< badge-code >}}
{{< /tab >}}
{{< tab header="Ruby" >}}
{{< gh-codeblock path="examples/ruby/spec/drivers/options_spec.rb#L10" >}}
{{< /tab >}}
{{< tab header="JavaScript" >}}
{{< badge-code >}}
{{< /tab >}}
{{< tab header="Kotlin" >}}
{{< badge-code >}}
{{< /tab >}}
{{< /tabpane >}}

## browserVersion

Esta capacidade é opcional, é usada para
Expand All @@ -59,7 +80,7 @@ tiver apenas 80 instalados, a criação da sessão falhará.
{{< badge-code >}}
{{< /tab >}}
{{< tab header="Ruby" >}}
{{< badge-code >}}
{{< gh-codeblock path="examples/ruby/spec/drivers/service_spec.rb#L35" >}}
{{< /tab >}}
{{< tab header="JavaScript" >}}
{{< badge-code >}}
Expand Down Expand Up @@ -286,7 +307,7 @@ setting `platformName` sets the OS at the remote-end.
{{< badge-code >}}
{{< /tab >}}
{{< tab header="Ruby" >}}
{{< badge-code >}}
{{< gh-codeblock path="examples/ruby/spec/drivers/options_spec.rb#L37-L38" >}}
{{< /tab >}}
{{< tab header="JavaScript" >}}
{{< badge-code >}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Browser name is set by default when using an Options class instance.
{{< badge-code >}}
{{< /tab >}}
{{< tab header="Ruby" >}}
{{< badge-code >}}
{{< gh-codeblock path="examples/ruby/spec/drivers/options_spec.rb#L10" >}}
{{< /tab >}}
{{< tab header="JavaScript" >}}
{{< badge-code >}}
Expand Down Expand Up @@ -71,7 +71,7 @@ it will be automatically downloaded by [Selenium Manager]({{< ref "../../seleniu
{{< badge-code >}}
{{< /tab >}}
{{< tab header="Ruby" >}}
{{< badge-code >}}
{{< gh-codeblock path="examples/ruby/spec/drivers/service_spec.rb#L35" >}}
{{< /tab >}}
{{< tab header="JavaScript" >}}
{{< badge-code >}}
Expand Down Expand Up @@ -302,7 +302,7 @@ fun main() {
{{< badge-code >}}
{{< /tab >}}
{{< tab header="Ruby" >}}
{{< badge-code >}}
{{< gh-codeblock path="examples/ruby/spec/drivers/options_spec.rb#L37-L38" >}}
{{< /tab >}}
{{< tab header="JavaScript" >}}
{{< badge-code >}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,14 +135,7 @@ browserOptions.AddAdditionalOption("cloud:options", cloudOptions);
var driver = new RemoteWebDriver(new Uri(CloudURL), browserOptions);
{{< /tab >}}
{{< tab header="Ruby" >}}
options = Selenium::WebDriver::Options.firefox
options.browser_version = 'latest'
options.platform_name = 'Windows 10'
cloud_options = {}
cloud_options[:build] = my_test_build
cloud_options[:name] = my_test_name
options.add_option('cloud:options', cloud_options)
driver = Selenium::WebDriver.for :remote, url: cloud_url, capabilities: options
{{< gh-codeblock path="examples/ruby/spec/drivers/options_spec.rb#L37-L46">}}
{{< /tab >}}
{{< tab header="Python" >}}
from selenium.webdriver.firefox.options import Options as FirefoxOptions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,14 +129,7 @@ browserOptions.AddAdditionalOption("cloud:options", cloudOptions);
var driver = new RemoteWebDriver(new Uri(CloudURL), browserOptions);
{{< /tab >}}
{{< tab header="Ruby" >}}
options = Selenium::WebDriver::Options.firefox
options.browser_version = 'latest'
options.platform_name = 'Windows 10'
cloud_options = {}
cloud_options[:build] = my_test_build
cloud_options[:name] = my_test_name
options.add_option('cloud:options', cloud_options)
driver = Selenium::WebDriver.for :remote, url: cloud_url, capabilities: options
{{< gh-codeblock path="examples/ruby/spec/drivers/options_spec.rb#L37-L46">}}
{{< /tab >}}
{{< tab header="Python" >}}
from selenium.webdriver.firefox.options import Options as FirefoxOptions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,14 +132,7 @@ browserOptions.AddAdditionalOption("cloud:options", cloudOptions);
var driver = new RemoteWebDriver(new Uri(CloudURL), browserOptions);
{{< /tab >}}
{{< tab header="Ruby" >}}
options = Selenium::WebDriver::Options.firefox
options.browser_version = 'latest'
options.platform_name = 'Windows 10'
cloud_options = {}
cloud_options[:build] = my_test_build
cloud_options[:name] = my_test_name
options.add_option('cloud:options', cloud_options)
driver = Selenium::WebDriver.for :remote, url: cloud_url, capabilities: options
{{< gh-codeblock path="examples/ruby/spec/drivers/options_spec.rb#L37-L46">}}
{{< /tab >}}
{{< tab header="Python" >}}
from selenium.webdriver.firefox.options import Options as FirefoxOptions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,14 +143,7 @@ browserOptions.AddAdditionalOption("cloud: options", cloudOptions);
var driver = new RemoteWebDriver(new Uri(CloudURL), browserOptions);
{{< /tab >}}
{{< tab header="Ruby" >}}
options = Selenium: : WebDriver: : Options.firefox
options.browser_version = 'latest'
options.platform_name = 'Windows 10'
cloud_options = {}
cloud_options[: build] = my_test_build
cloud_options[: name] = my_test_name
options.add_option('cloud: options', cloud_options)
driver = Selenium: : WebDriver.for : remote, url: cloud_url, capabilities: options
{{< gh-codeblock path="examples/ruby/spec/drivers/options_spec.rb#L37-L46">}}
{{< /tab >}}
{{< tab header="Python" >}}
from selenium.webdriver.firefox.options import Options as FirefoxOptions
Expand Down
Loading