Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Thomas Walpole
    @twalpole
    oh - actually that probably wouldn’t matter if you’re only using RackTest
    Frank Paulo Filho
    @frankpf
    It's probably something related to caching that I'm missing though... I'll double check everything
    Thomas Walpole
    @twalpole
    are you doing file caching?
    Also - how are you setting the DB connections?
    although technically as long as you were doing transactional testing you could actually get away with only one DB since nothing would ever actually be committed
    Frank Paulo Filho
    @frankpf
    so what parallel_tests does is run your app in different processes passing a TEST_ENV_NUMBER environment variable
    so in my database.yml for example I have the database name set to test#{ENV['TEST_ENV_NUMBER']}
    Thomas Walpole
    @twalpole
    ok
    yeah — the wiki for parallel_tests has examples for most common services - https://github.com/grosser/parallel_tests/wiki
    Frank Paulo Filho
    @frankpf
    there's no way that racktest is sharing cookies at all between sessions, right? I'm not 100% sure how capybara/racktest work but racktest is purely in memory, correct?
    I checked the sessions and both processes have different Capybara::Session instances
    Thomas Walpole
    @twalpole
    not between processes - no - there is no interprocess communication used
    Frank Paulo Filho
    @frankpf
    ok. so yeah, it's probably some dependency I'm missing :) Thanks a lot for the help
    Thomas Walpole
    @twalpole
    and even if they were sharing cookies - they should be being sent to different instances of the app with separate DBs - so that shouldn’t matter
    Frank Paulo Filho
    @frankpf
    but database instance A wouldn't have the cookies defined in instance B
    Thomas Walpole
    @twalpole
    correct
    Frank Paulo Filho
    @frankpf
    so a test using those cookies for something could fail
    actually, nvm, that's not possible assuming there aren't any dependencies between tests
    Thomas Walpole
    @twalpole
    right
    Frank Paulo Filho
    @frankpf
    I got the problem fixed with help from a coworker :) I was setting namespace to test_ENV['TEST_ENV_NUMBER'] in my redis object correctly
    however, you're able to bypass the namespace by calling cache.write(..., namespace: 'abc')
    our code isn't doing that, but some gem we depend on probably is
    so the best fix is to simply use an in memory store instead of redis.
    sending it here just in case anyone ever runs into the same problem
    Thomas Walpole
    @twalpole
    umm — test_ENV['TEST_ENVNUMBER’] - doesn’t seem right — shouldn’t that be test#{ENV['TEST_ENV_NUMBER’]} to ensure it gets interpolated
    er, well - with the _ and without the italics
    You can also just run multiple redis instances
    vkutepov
    @vkutepov
    hello.
    please help me. i
    i get error :
    tittle : wrong number of arguments (given 1, expected 0)
    what is this title?
    vkutepov
    @vkutepov
    i use rspec and capybara
    vkutepov
    @vkutepov
    I pass the parameters for the test through each (data provider) maybe because of this an error?
    Thomas Walpole
    @twalpole
    what line of code is that coming from?
    vkutepov
    @vkutepov
    capybara/node/document.rb: line 31
    vkutepov
    @vkutepov
    this error is due to the allure-rspec gem. When I delete this code there is no error:
    config.include AllureRspec :: Adapter
    Thomas Walpole
    @twalpole
    I mean what line of code in your project
    simon foucher
    @simonfoucher
    Hello, having some issues using Capybara to fill in some Credit Card fields for Stripe's new 3DSecure flow - can anyone help? Thanks in advance!
    Thomas Walpole
    @twalpole
    What exactly are the issues you’re having?
    simon foucher
    @simonfoucher
    I want to fill in the CC field so I tried with:
    find(:xpath, '//div[contains(@class, "StripeElement ")]').send_keys("4000002760003184") but that gives me an error: unknown error: cannot focus element
    or with:
    fill_in('Card details', :with => "4000002760003184") this method always skips the first character, never enters a '4'.
    Thanks for your help!
    Thomas Walpole
    @twalpole
    Try clicking the element first
    find(:field, ‘Card Details’).click.fill_in(with: ‘....’)
    Thomas Walpole
    @twalpole
    It's possible the first keystroke is actually triggering the input widget to change state or something - which clicking before may trigger
    also - you're generally going to better off preferring CSS over xpath when CSS can handle things so your first try would have been find('div.StripeElement').send_keys(...) - wouldn't change whether or not it works but will be slightly faster, easier to read, and you don't have to worry about // vs .// scoping trap that you do when using XPath
    kirannandarapalli
    @kirannandarapalli
    Hi, Does anyone know how to run capybara tests on a specific version of firefox browser? Thanks in advance
    Thomas Walpole
    @twalpole
    Use the webdrivers gem to lock the correct version of geckodriver and then configure selenium in your driver registration to point at whichever Firefox version you want it to use
    simon foucher
    @simonfoucher
    @twalpole thank you for your response, looking into it today. Pretty awesome you are available to answer our questions, much appreciated.
    simon foucher
    @simonfoucher
    @twalpole so i'm still having issues, using find(:field, ‘Card Details’).click.fill_in(with: ‘....’) fails: unknown error: Element ... so I tried with find('div.StripeElement').click.fill_in(with: card_number) but that still skips the first character... There are so many different ways to do this I get a little lost in the methods. Thanks in advance