File tree Expand file tree Collapse file tree 5 files changed +39
-28
lines changed
examples/ruby/spec/browsers
website_and_docs/content/documentation/webdriver/browsers Expand file tree Collapse file tree 5 files changed +39
-28
lines changed Original file line number Diff line number Diff line change 118
118
injected = driver . find_element ( id : 'webextensions-selenium-example' )
119
119
expect ( injected . text ) . to eq 'Content injected by webextensions-selenium-example'
120
120
end
121
+
122
+ it 'takes full page screenshot' do
123
+ driver . navigate . to 'https://www.selenium.dev/selenium/web/blank.html'
124
+ Dir . mktmpdir ( 'screenshot_test' ) do |dir |
125
+ screenshot = driver . save_full_page_screenshot ( File . join ( dir , 'screenshot.png' ) )
126
+
127
+ expect ( screenshot ) . to be_a File
128
+ end
129
+ end
130
+
131
+ it 'sets the context' do
132
+ driver . context = 'content'
133
+ expect ( driver . context ) . to eq 'content'
134
+ end
135
+ end
136
+
137
+ describe 'Profile' do
138
+ it 'creates a new profile' do
139
+ profile = Selenium ::WebDriver ::Firefox ::Profile . new
140
+ profile [ 'browser.download.dir' ] = '/tmp/webdriver-downloads'
141
+ options = Selenium ::WebDriver ::Firefox ::Options . new ( profile : profile )
142
+ expect ( options . profile ) . to eq ( profile )
143
+ end
121
144
end
122
145
123
146
def driver_finder
Original file line number Diff line number Diff line change @@ -122,11 +122,8 @@ var profile = new FirefoxProfile();
122
122
options.Profile = profile;
123
123
var driver = new FirefoxDriver(options);
124
124
{{< /tab >}}
125
- {{< tab header="Ruby" >}}
126
- profile = Selenium::WebDriver::Firefox::Profile.new
127
- profile[ 'browser.download.dir'] = "/tmp/webdriver-downloads"
128
- options = Selenium::WebDriver::Firefox::Options.new(profile: profile)
129
- driver = Selenium::WebDriver.for : firefox , options: options
125
+ {{< tab header="Ruby" text=true >}}
126
+ {{< gh-codeblock path="/examples/ruby/spec/browsers/firefox_spec.rb#L139-L141" >}}
130
127
{{< /tab >}}
131
128
{{< tab header="JavaScript" >}}
132
129
const { Builder } = require("selenium-webdriver");
@@ -426,7 +423,7 @@ please refer to the
426
423
{{< badge-code >}}
427
424
{{< /tab >}}
428
425
{{< tab header="Ruby" >}}
429
- {{< badge-code >}}
426
+ {{< gh-codeblock path="/examples/ruby/spec/browsers/firefox_spec.rb#L125" >}}
430
427
{{< /tab >}}
431
428
{{< tab header="JavaScript" >}}
432
429
{{< badge-code >}}
@@ -453,7 +450,7 @@ please refer to the
453
450
{{< badge-code >}}
454
451
{{< /tab >}}
455
452
{{< tab header="Ruby" >}}
456
- {{< badge-code >}}
453
+ {{< gh-codeblock path="/examples/ruby/spec/browsers/firefox_spec.rb#L132" >}}
457
454
{{< /tab >}}
458
455
{{< tab header="JavaScript" >}}
459
456
{{< badge-code >}}
Original file line number Diff line number Diff line change @@ -126,11 +126,8 @@ var profile = new FirefoxProfile();
126
126
options.Profile = profile;
127
127
var driver = new RemoteWebDriver(options);
128
128
{{< /tab >}}
129
- {{< tab header="Ruby" >}}
130
- profile = Selenium::WebDriver::Firefox::Profile.new
131
- profile[ 'browser.download.dir'] = "/tmp/webdriver-downloads"
132
- options = Selenium::WebDriver::Firefox::Options.new(profile: profile)
133
- driver = Selenium::WebDriver.for : firefox , options: options
129
+ {{< tab header="Ruby" text=true >}}
130
+ {{< gh-codeblock path="/examples/ruby/spec/browsers/firefox_spec.rb#L139-L141" >}}
134
131
{{< /tab >}}
135
132
{{< tab header="JavaScript" >}}
136
133
const { Builder } = require("selenium-webdriver");
@@ -433,7 +430,7 @@ please refer to the
433
430
{{< badge-code >}}
434
431
{{< /tab >}}
435
432
{{< tab header="Ruby" >}}
436
- {{< badge-code >}}
433
+ {{< gh-codeblock path="/examples/ruby/spec/browsers/firefox_spec.rb#L125" >}}
437
434
{{< /tab >}}
438
435
{{< tab header="JavaScript" >}}
439
436
{{< badge-code >}}
@@ -460,7 +457,7 @@ please refer to the
460
457
{{< badge-code >}}
461
458
{{< /tab >}}
462
459
{{< tab header="Ruby" >}}
463
- {{< badge-code >}}
460
+ {{< gh-codeblock path="/examples/ruby/spec/browsers/firefox_spec.rb#L132" >}}
464
461
{{< /tab >}}
465
462
{{< tab header="JavaScript" >}}
466
463
{{< badge-code >}}
Original file line number Diff line number Diff line change @@ -125,11 +125,8 @@ var profile = new FirefoxProfile();
125
125
options.Profile = profile;
126
126
var driver = new RemoteWebDriver(options);
127
127
{{< /tab >}}
128
- {{< tab header="Ruby" >}}
129
- profile = Selenium::WebDriver::Firefox::Profile.new
130
- profile[ 'browser.download.dir'] = "/tmp/webdriver-downloads"
131
- options = Selenium::WebDriver::Firefox::Options.new(profile: profile)
132
- driver = Selenium::WebDriver.for : firefox , options: options
128
+ {{< tab header="Ruby" text=true >}}
129
+ {{< gh-codeblock path="/examples/ruby/spec/browsers/firefox_spec.rb#L139-L141" >}}
133
130
{{< /tab >}}
134
131
{{< tab header="JavaScript" >}}
135
132
const { Builder } = require("selenium-webdriver");
@@ -431,7 +428,7 @@ please refer to the
431
428
{{< badge-code >}}
432
429
{{< /tab >}}
433
430
{{< tab header="Ruby" >}}
434
- {{< badge-code >}}
431
+ {{< gh-codeblock path="/examples/ruby/spec/browsers/firefox_spec.rb#L125" >}}
435
432
{{< /tab >}}
436
433
{{< tab header="JavaScript" >}}
437
434
{{< badge-code >}}
@@ -458,7 +455,7 @@ please refer to the
458
455
{{< badge-code >}}
459
456
{{< /tab >}}
460
457
{{< tab header="Ruby" >}}
461
- {{< badge-code >}}
458
+ {{< gh-codeblock path="/examples/ruby/spec/browsers/firefox_spec.rb#L132" >}}
462
459
{{< /tab >}}
463
460
{{< tab header="JavaScript" >}}
464
461
{{< badge-code >}}
Original file line number Diff line number Diff line change @@ -124,11 +124,8 @@ var profile = new FirefoxProfile();
124
124
options.Profile = profile;
125
125
var driver = new RemoteWebDriver(options);
126
126
{{< /tab >}}
127
- {{< tab header="Ruby" >}}
128
- profile = Selenium::WebDriver::Firefox::Profile.new
129
- profile[ 'browser.download.dir'] = "/tmp/webdriver-downloads"
130
- options = Selenium::WebDriver::Firefox::Options.new(profile: profile)
131
- driver = Selenium::WebDriver.for : firefox , options: options
127
+ {{< tab header="Ruby" text=true >}}
128
+ {{< gh-codeblock path="/examples/ruby/spec/browsers/firefox_spec.rb#L139-L141" >}}
132
129
{{< /tab >}}
133
130
{{< tab header="JavaScript" >}}
134
131
const { Builder } = require("selenium-webdriver");
@@ -428,7 +425,7 @@ please refer to the
428
425
{{< badge-code >}}
429
426
{{< /tab >}}
430
427
{{< tab header="Ruby" >}}
431
- {{< badge-code >}}
428
+ {{< gh-codeblock path="/examples/ruby/spec/browsers/firefox_spec.rb#L125" >}}
432
429
{{< /tab >}}
433
430
{{< tab header="JavaScript" >}}
434
431
{{< badge-code >}}
@@ -455,7 +452,7 @@ please refer to the
455
452
{{< badge-code >}}
456
453
{{< /tab >}}
457
454
{{< tab header="Ruby" >}}
458
- {{< badge-code >}}
455
+ {{< gh-codeblock path="/examples/ruby/spec/browsers/firefox_spec.rb#L132" >}}
459
456
{{< /tab >}}
460
457
{{< tab header="JavaScript" >}}
461
458
{{< badge-code >}}
You can’t perform that action at this time.
0 commit comments