Project

General

Profile

Patch #34119 » 34119-v2.diff

Go MAEDA, 2020-12-02 09:47

View differences:

test/application_system_test_case.rb (作業コピー)
30 30
  # Allow running tests using a remote Selenium hub
31 31
  options[:url] = ENV['SELENIUM_REMOTE_URL'] if ENV['SELENIUM_REMOTE_URL']
32 32
  options[:desired_capabilities] = Selenium::WebDriver::Remote::Capabilities.chrome(
33
                  'chromeOptions' => {
33
                  'goog:chromeOptions' => {
34 34
                    'prefs' => {
35 35
                      'download.default_directory' => DOWNLOADS_PATH,
36 36
                      'download.prompt_for_download' => false,
......
76 76
  end
77 77

  
78 78
  def clear_downloaded_files
79
    # https://github.com/SeleniumHQ/selenium/issues/5292
80
    FileUtils.rm downloaded_files if Redmine::Platform.mswin?
79
    FileUtils.rm downloaded_files
81 80
  end
82 81

  
83 82
  def downloaded_files(filename='*')
84
    # https://github.com/SeleniumHQ/selenium/issues/5292
85
    downloaded_path = Redmine::Platform.mswin? ? DOWNLOADS_PATH : "#{ENV['HOME']}/Downloads"
86
    Dir.glob("#{downloaded_path}/#{filename}").
83
    Dir.glob("#{DOWNLOADS_PATH}/#{filename}").
87 84
      reject{|f| f=~/\.(tmp|crdownload)$/}.sort_by{|f| File.mtime(f)}
88 85
  end
89 86

  
test/system/issues_test.rb (作業コピー)
519 519
    click_on 'CSV'
520 520
    click_on 'Export'
521 521

  
522
    # https://github.com/SeleniumHQ/selenium/issues/5292
523
    # if issues.csv exists, Chrome creates issues (1).csv, issues (2).csv ...
524
    csv = CSV.read(downloaded_file("issues*.csv"))
522
    csv = CSV.read(downloaded_file("issues.csv"))
525 523
    subject_index = csv.shift.index('Subject')
526 524
    subjects = csv.map {|row| row[subject_index]}
527 525
    assert_equal subjects.sort, subjects
(2-2/2)