Skip to content

Commit 3d42267

Browse files
Merge branch 'trunk' into pallavi-getCookieRuby
2 parents 008d4b8 + ec521e3 commit 3d42267

File tree

4 files changed

+34
-2
lines changed

4 files changed

+34
-2
lines changed

Rakefile

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1110,7 +1110,11 @@ namespace :all do
11101110
'rb/lib/selenium/webdriver/version.rb',
11111111
'rb/CHANGES',
11121112
'rb/Gemfile.lock',
1113-
'rust/CHANGELOG.md'])
1113+
'rust/CHANGELOG.md',
1114+
'rust/BUILD.bazel',
1115+
'rust/Cargo.Bazel.lock',
1116+
'rust/Cargo.toml',
1117+
'rust/Cargo.lock'])
11141118
end
11151119

11161120
desc 'Update all versions'
@@ -1122,6 +1126,7 @@ namespace :all do
11221126
Rake::Task['node:version'].invoke(version)
11231127
Rake::Task['py:version'].invoke(version)
11241128
Rake::Task['dotnet:version'].invoke(version)
1129+
Rake::Task['rust:version'].invoke(version)
11251130
end
11261131
end
11271132

@@ -1186,7 +1191,11 @@ end
11861191

11871192
def update_changelog(version, language, path, changelog, header)
11881193
tag = previous_tag(version, language)
1189-
log = `git --no-pager log #{tag}...HEAD --pretty=format:"--> %B" --reverse #{path}`
1194+
if language == 'javascript'
1195+
log = `git --no-pager log #{tag}...HEAD --pretty=format:"- %s" --reverse #{path}`
1196+
else
1197+
log = `git --no-pager log #{tag}...HEAD --pretty=format:"* %s" --reverse #{path}`
1198+
end
11901199
commits = log.split('>>>').map { |entry|
11911200
lines = entry.split("\n")
11921201
lines.reject! { |line| line.match?(/^(----|Co-authored|Signed-off)/) || line.empty? }

rb/lib/selenium/webdriver/bidi/network.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,10 @@ def provide_response(**args)
124124
)
125125
end
126126

127+
def set_cache_behavior(behavior, *contexts)
128+
@bidi.send_cmd('network.setCacheBehavior', cacheBehavior: behavior, contexts: contexts)
129+
end
130+
127131
def on(event, &)
128132
event = EVENTS[event] if event.is_a?(Symbol)
129133
@bidi.add_callback(event, &)

rb/sig/lib/selenium/webdriver/bidi/network.rbs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ module Selenium
2828

2929
def provide_response: -> Hash[nil, nil]
3030

31+
def set_cache_behavior: (String behavior, Array[BrowsingContext]) -> Hash[nil, nil]
32+
3133
def on: (Symbol event) { (?) -> untyped } -> Hash[nil, nil]
3234
end
3335
end

rb/spec/integration/selenium/webdriver/bidi/network_spec.rb

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,23 @@ class BiDi
176176
expect(source).to include('Hello World!')
177177
end
178178
end
179+
180+
it 'sets the cache to bypass' do
181+
reset_driver!(web_socket_url: true) do |driver|
182+
browsing_context = BrowsingContext.new(driver).create
183+
network = described_class.new(driver.bidi)
184+
network.set_cache_behavior('bypass', browsing_context)
185+
expect(network.set_cache_behavior('bypass', browsing_context)).to be_a(Hash)
186+
end
187+
end
188+
189+
it 'sets the cache to default' do
190+
reset_driver!(web_socket_url: true) do |driver|
191+
browsing_context = BrowsingContext.new(driver).create
192+
network = described_class.new(driver.bidi)
193+
expect(network.set_cache_behavior('default', browsing_context)).to be_a(Hash)
194+
end
195+
end
179196
end
180197
end
181198
end

0 commit comments

Comments
 (0)