Why are Selenium/ JS file upload specs failing with "File not found"?

rails
selenium
chrome
rspec

#1

I have just completed migrating a Rails app from CircleCI 1.0 to 2.0, and have got all tests successfully passing.

All but one!

Failure/Error: attach_file 'file', File.join(Rails.root, 'spec', 'support', 'images', 'test_image.jpg'), visible: false
     Selenium::WebDriver::Error::ExpectedError:
       invalid argument: File not found : /home/circleci/project/spec/support/images/test_image.jpg

test_image.jpg does exist, it is used by other specs that are successfully passing.

This is the only spec using test_image.jpg that is also testing javascript, and hence using selenium/ chrome.

From the test output, it seems that selenium is looking in home/circleci/project rather than the Rails root folder.

Has anyone else encountered a similar issue? Is the test looking for the file in the wrong directory, or is this just how Circle 2.0 does things? How can I resolve this issue?


#2

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.