diff --git a/examples/ruby/spec/browsers/firefox_spec.rb b/examples/ruby/spec/browsers/firefox_spec.rb index ed4ef3df483e..7a56053e4838 100644 --- a/examples/ruby/spec/browsers/firefox_spec.rb +++ b/examples/ruby/spec/browsers/firefox_spec.rb @@ -118,6 +118,29 @@ injected = driver.find_element(id: 'webextensions-selenium-example') expect(injected.text).to eq 'Content injected by webextensions-selenium-example' end + + it 'takes full page screenshot' do + driver.navigate.to 'https://www.selenium.dev/selenium/web/blank.html' + Dir.mktmpdir('screenshot_test') do |dir| + screenshot = driver.save_full_page_screenshot(File.join(dir, 'screenshot.png')) + + expect(screenshot).to be_a File + end + end + + it 'sets the context' do + driver.context = 'content' + expect(driver.context).to eq 'content' + end + end + + describe 'Profile' do + it 'creates a new profile' do + profile = Selenium::WebDriver::Firefox::Profile.new + profile['browser.download.dir'] = '/tmp/webdriver-downloads' + options = Selenium::WebDriver::Firefox::Options.new(profile: profile) + expect(options.profile).to eq(profile) + end end def driver_finder diff --git a/website_and_docs/content/documentation/webdriver/browsers/firefox.en.md b/website_and_docs/content/documentation/webdriver/browsers/firefox.en.md index 510dfbdc747e..bbf2534b85f8 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/firefox.en.md +++ b/website_and_docs/content/documentation/webdriver/browsers/firefox.en.md @@ -122,11 +122,8 @@ var profile = new FirefoxProfile(); options.Profile = profile; var driver = new FirefoxDriver(options); {{< /tab >}} - {{< tab header="Ruby" >}} -profile = Selenium::WebDriver::Firefox::Profile.new -profile['browser.download.dir'] = "/tmp/webdriver-downloads" -options = Selenium::WebDriver::Firefox::Options.new(profile: profile) -driver = Selenium::WebDriver.for :firefox, options: options + {{< tab header="Ruby" text=true >}} + {{< gh-codeblock path="/examples/ruby/spec/browsers/firefox_spec.rb#L139-L141" >}} {{< /tab >}} {{< tab header="JavaScript" >}} const { Builder } = require("selenium-webdriver"); @@ -426,7 +423,7 @@ please refer to the {{< badge-code >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< badge-code >}} +{{< gh-codeblock path="/examples/ruby/spec/browsers/firefox_spec.rb#L125" >}} {{< /tab >}} {{< tab header="JavaScript" >}} {{< badge-code >}} @@ -453,7 +450,7 @@ please refer to the {{< badge-code >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< badge-code >}} +{{< gh-codeblock path="/examples/ruby/spec/browsers/firefox_spec.rb#L132" >}} {{< /tab >}} {{< tab header="JavaScript" >}} {{< badge-code >}} diff --git a/website_and_docs/content/documentation/webdriver/browsers/firefox.ja.md b/website_and_docs/content/documentation/webdriver/browsers/firefox.ja.md index 85d454f31446..6c04bb4b2aa1 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/firefox.ja.md +++ b/website_and_docs/content/documentation/webdriver/browsers/firefox.ja.md @@ -126,11 +126,8 @@ var profile = new FirefoxProfile(); options.Profile = profile; var driver = new RemoteWebDriver(options); {{< /tab >}} - {{< tab header="Ruby" >}} -profile = Selenium::WebDriver::Firefox::Profile.new -profile['browser.download.dir'] = "/tmp/webdriver-downloads" -options = Selenium::WebDriver::Firefox::Options.new(profile: profile) -driver = Selenium::WebDriver.for :firefox, options: options + {{< tab header="Ruby" text=true >}} + {{< gh-codeblock path="/examples/ruby/spec/browsers/firefox_spec.rb#L139-L141" >}} {{< /tab >}} {{< tab header="JavaScript" >}} const { Builder } = require("selenium-webdriver"); @@ -433,7 +430,7 @@ please refer to the {{< badge-code >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< badge-code >}} +{{< gh-codeblock path="/examples/ruby/spec/browsers/firefox_spec.rb#L125" >}} {{< /tab >}} {{< tab header="JavaScript" >}} {{< badge-code >}} @@ -460,7 +457,7 @@ please refer to the {{< badge-code >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< badge-code >}} +{{< gh-codeblock path="/examples/ruby/spec/browsers/firefox_spec.rb#L132" >}} {{< /tab >}} {{< tab header="JavaScript" >}} {{< badge-code >}} diff --git a/website_and_docs/content/documentation/webdriver/browsers/firefox.pt-br.md b/website_and_docs/content/documentation/webdriver/browsers/firefox.pt-br.md index 888f50aa4633..aebb96a26145 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/firefox.pt-br.md +++ b/website_and_docs/content/documentation/webdriver/browsers/firefox.pt-br.md @@ -125,11 +125,8 @@ var profile = new FirefoxProfile(); options.Profile = profile; var driver = new RemoteWebDriver(options); {{< /tab >}} - {{< tab header="Ruby" >}} -profile = Selenium::WebDriver::Firefox::Profile.new -profile['browser.download.dir'] = "/tmp/webdriver-downloads" -options = Selenium::WebDriver::Firefox::Options.new(profile: profile) -driver = Selenium::WebDriver.for :firefox, options: options + {{< tab header="Ruby" text=true >}} +{{< gh-codeblock path="/examples/ruby/spec/browsers/firefox_spec.rb#L139-L141" >}} {{< /tab >}} {{< tab header="JavaScript" >}} const { Builder } = require("selenium-webdriver"); @@ -431,7 +428,7 @@ please refer to the {{< badge-code >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< badge-code >}} +{{< gh-codeblock path="/examples/ruby/spec/browsers/firefox_spec.rb#L125" >}} {{< /tab >}} {{< tab header="JavaScript" >}} {{< badge-code >}} @@ -458,7 +455,7 @@ please refer to the {{< badge-code >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< badge-code >}} +{{< gh-codeblock path="/examples/ruby/spec/browsers/firefox_spec.rb#L132" >}} {{< /tab >}} {{< tab header="JavaScript" >}} {{< badge-code >}} diff --git a/website_and_docs/content/documentation/webdriver/browsers/firefox.zh-cn.md b/website_and_docs/content/documentation/webdriver/browsers/firefox.zh-cn.md index efa42053b88e..87b9e259a869 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/firefox.zh-cn.md +++ b/website_and_docs/content/documentation/webdriver/browsers/firefox.zh-cn.md @@ -124,11 +124,8 @@ var profile = new FirefoxProfile(); options.Profile = profile; var driver = new RemoteWebDriver(options); {{< /tab >}} - {{< tab header="Ruby" >}} -profile = Selenium::WebDriver::Firefox::Profile.new -profile['browser.download.dir'] = "/tmp/webdriver-downloads" -options = Selenium::WebDriver::Firefox::Options.new(profile: profile) -driver = Selenium::WebDriver.for :firefox, options: options + {{< tab header="Ruby" text=true >}} + {{< gh-codeblock path="/examples/ruby/spec/browsers/firefox_spec.rb#L139-L141" >}} {{< /tab >}} {{< tab header="JavaScript" >}} const { Builder } = require("selenium-webdriver"); @@ -428,7 +425,7 @@ please refer to the {{< badge-code >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< badge-code >}} +{{< gh-codeblock path="/examples/ruby/spec/browsers/firefox_spec.rb#L125" >}} {{< /tab >}} {{< tab header="JavaScript" >}} {{< badge-code >}} @@ -455,7 +452,7 @@ please refer to the {{< badge-code >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< badge-code >}} +{{< gh-codeblock path="/examples/ruby/spec/browsers/firefox_spec.rb#L132" >}} {{< /tab >}} {{< tab header="JavaScript" >}} {{< badge-code >}}