Closed alexkuc closed 3 years ago
I think I figured out the issue. Out of the box, codecept init wpbrowser
generates the following .env.testing
(part of it):
TEST_SITE_DB_DSN=
TEST_SITE_DB_HOST=
TEST_SITE_DB_NAME=
TEST_SITE_DB_USER=
TEST_SITE_DB_PASSWORD=
TEST_SITE_TABLE_PREFIX=
However, TEST_SITE_DB_HOST
and TEST_SITE_DB_NAME
is not used anymore according to docs (only DSN which contains hostname and db name).
Maybe boilerplate generator should be updated to exclude TEST_SITE_DB_HOST
and TEST_SITE_DB_NAME
?
@alexkuc Thanks for reporting the issue.
I will look into this and update this issue with news.
@lucatume maybe this is not a bug but essentially, after running WPDb
, database entries template
and stylesheet
are missing from wp_options
table (this does not affect me really - I am now using a separate database for development and testing - so this can be closed)
Environment OS: Mac High Sierra PHP version: 7.4.2 Installed Codeception version: 4.1.14 Installed wp-browser version: 3.0.2 WordPress version: 5.6 Local development environment: MAMP Pro WordPress structure and management: default
After running
acceptance
tests, my frontend is white screen (backend works fine).Investigating further reveals:
In other words, no theme is selected (executing
wp theme activate <theme-name>
fixes the issue).Question: why does this happen and how can I restore default (or desired) theme after running test?
Context: if troubleshooting issue, you go through cycle code edit -> run test -> code edit -> run test; sometimes you need to manually inspect Wordpress and this whitescreen is a bit annoying.
Edit: byacceptance
test, I meant I useWPBrowser
module (which is commonly part ofacceptance
test)Edit: I use
WPBrowser
andWPDb
modules