browserstack / browserstack-local-php Goto Github PK
View Code? Open in Web Editor NEWPHP bindings for BrowserStack Local
Home Page: https://www.browserstack.com
License: MIT License
PHP bindings for BrowserStack Local
Home Page: https://www.browserstack.com
License: MIT License
Hey there
I'm experiencing some issues with getting the client to stop after my tests have been run.
If I spin up a clean Docker image of my application, and execute ps -ax
inside of it I get the following as result:
PID TTY STAT TIME COMMAND
1 ? Ss 0:00 apache2 -DFOREGROUND
17 ? S 0:00 apache2 -DFOREGROUND
18 ? S 0:00 apache2 -DFOREGROUND
19 ? S 0:00 apache2 -DFOREGROUND
20 ? S 0:00 apache2 -DFOREGROUND
21 ? S 0:00 apache2 -DFOREGROUND
22 ? Rs 0:00 ps -ax
After I run my tests using the BrowserStackWebDriver
helper that has been provided by the documentation here, the client is still running. The ps -ax
output after the tests have been run:
PID TTY STAT TIME COMMAND
1 ? Ss 0:00 apache2 -DFOREGROUND
16 ? S 0:00 apache2 -DFOREGROUND
17 ? S 0:00 apache2 -DFOREGROUND
18 ? S 0:00 apache2 -DFOREGROUND
19 ? S 0:00 apache2 -DFOREGROUND
20 ? S 0:00 apache2 -DFOREGROUND
55 ? Ssl 0:00 BrowserStackLocal -logFile /var/www/html/local.log <key> -daemonInstance
76 ? S 0:00 apache2 -DFOREGROUND
78 ? S 0:00 apache2 -DFOREGROUND
79 ? S 0:00 apache2 -DFOREGROUND
80 ? S 0:00 apache2 -DFOREGROUND
81 ? S 0:00 apache2 -DFOREGROUND
105 ? Rs 0:00 ps -ax
My conclusion is that the stop()
method is not quite working as expected, I have double checked and even removed the surrounding if case (if($this->bs_local->isRunning())
) to double check this.
If I try to re-run the tests without completely restarting my app container I get the following error message, hence I'm investigating this:
Do not run Composer as root/super user! See https://getcomposer.org/root for details
> php vendor/bin/codecept run 'behavioral'
Codeception PHP Testing Framework v2.5.5
Powered by PHPUnit 7.5.9 by Sebastian Bergmann and contributors.
Running with seed:
In Local.php line 125:
Either another browserstack local client is running on your machine or some
server is listening on port 45691
run [-o|--override OVERRIDE] [-e|--ext EXT] [--report] [--html [HTML]] [--xml [XML]] [--phpunit-xml [PHPUNIT-XML]] [--tap [TAP]] [--json [JSON]] [--colors] [--no-colors] [--silent] [--steps] [-d|--debug] [--coverage [COVERAGE]] [--coverage-html [COVERAGE-HTML]] [--coverage-xml [COVERAGE-XML]] [--coverage-text [COVERAGE-TEXT]] [--coverage-crap4j [COVERAGE-CRAP4J]] [--coverage-phpunit [COVERAGE-PHPUNIT]] [--no-exit] [-g|--group GROUP] [-s|--skip SKIP] [-x|--skip-group SKIP-GROUP] [--env ENV] [-f|--fail-fast] [--no-rebuild] [--seed SEED] [--] [<suite> [<test>]]
Script php vendor/bin/codecept run handling the test event returned with error code 1
Any ideas?
Edit: I would like to prevent a "shotgun" solution for this issue as discussed here.
I run phpunit test.php for my test and get the result:
PHP Fatal error: Uncaught BrowserStack\LocalException: [0]: Key is required to start local testing!
thrown in vendor/browserstack/browserstack-local/lib/Local.php on line 125
Who know the root cause. Please let me know.
Thanks!
Is there any way to run tests on multiple devices using an array from the config file or from any other file from the project rather than using .env file variables?
In https://github.com/browserstack/browserstack-local-php/blob/master/lib/Local.php#L17 there is a hardcoded link to where local.log
is being stored, which can not be overridden. This file usually ends up in my project's root folder to great annoyance.
Could this for instance be fetched from the environment like the BROWSERSTACK_ACCESS_KEY
, but default to getcwd() . "/local.log"
it that is not set?
Would you accept a pull request on the matter?
It should say php composer.phar require browserstack/browserstack-local instead of php composer.phar require browserstack/local:dev-master
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.