Test on Internal Networks
BrowserStack enables you to run your Codeception automated tests on your internal development environments, on localhost, and from behind a corporate firewall. This feature is called “Local Testing”.
Local Testing establishes a secure connection between your machine and the BrowserStack cloud. Once you set up Local Testing, all URLs work out of the box, including HTTPS URLs and those behind a proxy or firewall.
Configuring your Codeception tests for Local Testing takes just four steps:
- Install the BrowserStack Local Testing bindings:
php composer.phar require browserstack/browserstack-local
- Next, you need to update your Codeception config file, and set the
browserstack.local
capability totrue
:
class_name: AcceptanceTester modules: enabled: - \BrowserStackWebDriver config: \BrowserStackWebDriver: host: 'hub-cloud.browserstack.com' port: 80 browser: chrome url: 'http://bs-local.com:45691' capabilities: 'browserstack.user': 'YOUR_USERNAME' 'browserstack.key' : 'YOUR_ACCESS_KEY' 'browserstack.local': true
-
Run a sample test case to check whether the Local test connection has been set up properly. You can use the following sample test case, which can be found in the repo under
Codeception-BrowserStack/tests/acceptance/
directory:LocalCept.php<?php // @group local $I = new AcceptanceTester($scenario); $I->wantTo('Test BrowserStack Local Testing'); $I->amOnPage('/check'); $I->see('Up and running'); ?>
- You can now run your Codeception test using BrowserStack Local with the following command:
composer local
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!