-
-
Notifications
You must be signed in to change notification settings - Fork 229
How to change the environment the website runs in? #68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Agreed, that would be nice to change the environment. One of my usage case is to disable translations in |
I have exactly the same issue ; no matter how I try to set the env, it always use dev. I tried to set it in :
|
i don't use panther now (I didn't like how it squeezes selenium / web driver into an unsuitable interface), but I think the solution would be to modify the code to not use the php server for its requests, but your actual server e.g. nginx / apache |
I noticed that during the tests the server runs with -t public option and when we launch it manually it has vendor/symfony/web-server-bundle/Resources/router.php (without -t) provided we have the web server bundle. I could make it work by :
After that the APP_ENV environment var is correctly used |
I'm having struggles too because on my app, web test case is using the env vars from the For this, I just change But, what I see is that the env, even if it's overriden, it is not correctly populated in the PHP web server. When I I think we definitely need a proper way to retrieve env vars in our projects instead of relying on |
Hello, have you since found a way to launch Panther with the Test environment? I have the same problem |
@bastien70 There's one specific thing about using the The solution I had was to create a custom Then, I made sure that every Panther test case use the |
Wow, I'm quite interested! Could you share an example of the code you use to do all of this? That interests me a lot |
Hmm, it's on a private project, I can't share it now, I would need to create a reproducer somewhere, I'll look into it when I have time to focus on this subject 😉 |
Okay good ! I can not wait to see it ! |
Tiny bit of information though @bastien70 : are you using Panther inside a Docker container? |
Not at all @Pierstoval . To be honest, I am new to Symfony. I have never used Docker. Right now all I can do with Panther is log a user by going to the login page and submitting the authentication information to be able to initiate the user's session. However, as said above, it relies on data in the dev environment which is problematic. |
|
By creating a new environment, it can be pretty quick if you follow the official docs about creating new environments |
@Pierstoval Thanks |
Uh oh!
There was an error while loading. Please reload this page.
When working with panther tests, the website seems to be running with
dev
mode config, even though if Idd(getenv('APP_ENV'))
it reports it's in 'test' environment. This causes lots of problems when testing because of the web profiler toolbar overlay preventing buttons from being clicked.The toolbar is disabled for the test env per the config, and the only way to prevent the toolbar from showing is by editing the
config/dev/web_profiler
and settoolbar:false
. Something I shouldn't have to do as I'm in the test environmentWhy is this crazy behaviour happening?
The text was updated successfully, but these errors were encountered: