Skip to content

Commit

Permalink
[rb] fix download test since Linux lists files in different order
Browse files Browse the repository at this point in the history
  • Loading branch information
titusfortner committed Jan 4, 2024
1 parent c183146 commit f744519
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions rb/spec/integration/selenium/webdriver/remote/driver_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,18 +52,18 @@ module Remote

file_names = %w[file_1.txt file_2.jpg]

expect(driver.downloadable_files).to eq file_names
expect(driver.downloadable_files).to match_array(file_names)
end
end

it 'downloads a file', exclude: {browser: :safari, reason: 'grid hangs'} do
target_directory = File.join(Dir.tmpdir, SecureRandom.uuid)
target_directory = File.join(Dir.tmpdir.to_s, SecureRandom.uuid)
at_exit { FileUtils.rm_f(target_directory) }

reset_driver!(enable_downloads: true) do |driver|
browser_downloads(driver)

file_name = driver.downloadable_files.first
file_name = 'file_1.txt'
driver.download_file(file_name, target_directory)

file_content = File.read("#{target_directory}/#{file_name}").strip
Expand Down

0 comments on commit f744519

Please sign in to comment.