javascript - poltergeist working on development, not on CI -
i've been writing tests site using poltergeist , capybara, , pass on development machine, failing on continuous integration platform i'm using(codeship). i've looked , tried different solutions time can work if switch selenium, rather not if possible. wondering if has advice this, i've seen tons of topics online nothing has worked me far.
in code page.should have_content("post created successfully.")
fails on of tests, cannot find message on page loaded whenever map file created (because hasn't gotten there yet reason). i've tried doing types of sleeps , wait time set 20 seconds in spec_helper.rb.
here example code:
add_mapfile_spec.rb
before(:each) sign_in_and_create_facility end scenario 'creating mapfile works locations path' add_mapfile_to_facility_from_main("bat cave", "save") page.should have_content("post created successfully.") page.should have_content("facility: bat cave") page.should have_content("definitelynotbrucewayne@digitallumens.com") page.should have_content("save.map") page.should have_content("cannot move") visit locations_path page.should have_content("definitelynotbrucewayne@digitallumens.com") page.should have_content("save.map") end
add mapfile function
def add_mapfile_to_facility_from_main(name, mapfile) visit locations_path find('#create-map').click select "#{name}", :from => "post[location_id]" attach_file('post_mapfile', file.join(rails.root.to_s, 'spec', 'fixtures', "#{mapfile}.map")) find('#submit-map').click sleep(1) end
sign_in_and_create_facility works expected know not function. js set true on these.
any appreciated, i've been struggling few days now
this due many reasons... suggest debug see screenshot generated after failure... add code below capybara configure in spec_helper:
capybara::screenshot.register_filename_prefix_formatter(:rspec) |example| "screenshot_#{example.description.gsub(' ', '-').gsub(/^.*\/spec\//,'')}" end screenshot_path = "#{project_root}/screenshot/" config.save_and_open_page_path = screenshot_path
Comments
Post a Comment