Run Capybara Tests in Parallel
Run multiple Capybara tests in parallel on BrowserStack Automate
On BrowserStack, you can run multiple Capybara tests at the same time across various browser, device and OS combinations. This is called Parallel Testing. Parallel Testing gives you the same benefits as running a multi-threaded application.
With Parallel Testing, you can run the same test on different browser/device combinations i.e. cross-browser testing, or run different tests on the same or different browser/device combinations. Parallel Testing will help you reduce the run time of your test suite, resulting in faster build times and faster releases.
Run sample test in parallel
- Clone the capybara-browserstack sample repo on GitHub, if not already done:
git clone https://github.com/browserstack/capybara-browserstack.git cd capybara-browserstack
- Install the dependencies using
bundle install
- Setup your credentials and browser/devices where you want to run your test, in the
capybara-browserstack/config/parallel.config.yml
file as shown below:
parallel.config.ymlserver: "hub-cloud.browserstack.com" user: "YOUR_USERNAME" key: "YOUR_ACCESS_KEY" common_caps: "browserstack.debug": true "name": "Bstack-[Capybara] Parallel Test" browser_caps: - "browser": "chrome" - "browser": "firefox" - "browser": "internet explorer" - "browser": "safari"
-
Run your tests in parallel on BrowserStack using following command:
bundle exec rake parallel
- You can choose to add other capabilities under the
browser_caps
as shown below, to run you test on other environments:
browser_caps: - "browser": "chrome" "browser_version": "latest" "os": "Windows" "os_version": "10" - "device": "iPhone 12 Pro" "browser": "iPhone" "os_version": "14" - "device": "Samsung Galaxy S20 Ultra" "browser": "Android" "os_version": "10.0" - "browser": "safari" "browser_version": "latest" "os": "OS X" "os_version": "Big Sur"
We're sorry to hear that. Please share your feedback so we can do better
Contact our Support team for immediate help while we work on improving our docs.
We're continuously improving our docs. We'd love to know what you liked
We're sorry to hear that. Please share your feedback so we can do better
Contact our Support team for immediate help while we work on improving our docs.
We're continuously improving our docs. We'd love to know what you liked
Thank you for your valuable feedback!