File tree Expand file tree Collapse file tree 4 files changed +33
-14
lines changed
examples/ruby/spec/bidi/cdp Expand file tree Collapse file tree 4 files changed +33
-14
lines changed Original file line number Diff line number Diff line change
1
+ # frozen_string_literal: true
2
+
3
+ require 'spec_helper'
4
+
5
+ RSpec . describe 'Logging' do
6
+ let ( :driver ) { start_session }
7
+
8
+ it 'sets cookie' do
9
+ driver . execute_cdp ( 'Network.setCookie' ,
10
+ name : 'cheese' ,
11
+ value : 'gouda' ,
12
+ domain : 'www.selenium.dev' ,
13
+ secure : true )
14
+
15
+ driver . get ( 'https://www.selenium.dev' )
16
+ cheese = driver . manage . cookie_named ( 'cheese' )
17
+
18
+ expect ( cheese [ :value ] ) . to eq 'gouda'
19
+ end
20
+ end
File renamed without changes.
Original file line number Diff line number Diff line change 54
54
driver . get ( 'https://www.selenium.dev/selenium/web/frameset.html' )
55
55
56
56
driver . devtools . performance . enable
57
-
58
57
metric_list = driver . devtools . performance . get_metrics . dig ( 'result' , 'metrics' )
59
58
60
59
metrics = metric_list . each_with_object ( { } ) do |metric , hash |
65
64
expect ( metrics [ 'Frames' ] ) . to eq 12
66
65
end
67
66
67
+ it 'sets cookie' do
68
+ driver . devtools . network . set_cookie ( name : 'cheese' ,
69
+ value : 'gouda' ,
70
+ domain : 'www.selenium.dev' ,
71
+ secure : true )
72
+
73
+ driver . get ( 'https://www.selenium.dev' )
74
+ cheese = driver . manage . cookie_named ( 'cheese' )
75
+
76
+ expect ( cheese [ :value ] ) . to eq 'gouda'
77
+ end
78
+
68
79
it 'waits for downloads' , except : { platform : :windows } do
69
80
driver . get ( 'https://www.selenium.dev/selenium/web/downloads/download.html' )
70
81
80
91
81
92
expect { Selenium ::WebDriver ::Wait . new . until { @completed } } . not_to raise_exception
82
93
end
83
-
84
- it 'sets cookie' do
85
- driver . devtools . network . set_cookie ( name : 'cheese' ,
86
- value : 'gouda' ,
87
- domain : 'www.selenium.dev' ,
88
- secure : true )
89
-
90
- driver . get ( 'https://www.selenium.dev' )
91
- cheese = driver . manage . cookie_named ( 'cheese' )
92
-
93
- expect ( cheese [ :value ] ) . to eq 'gouda'
94
- end
95
94
end
Original file line number Diff line number Diff line change 2
2
3
3
require 'spec_helper'
4
4
5
- RSpec . describe 'Scripts ' do
5
+ RSpec . describe 'Script ' do
6
6
let ( :driver ) { start_session }
7
7
8
8
it 'pins script' do
You can’t perform that action at this time.
0 commit comments