Skip to content

Commit

Permalink
Allow wp timezone to updated by config
Browse files Browse the repository at this point in the history
  • Loading branch information
Liam Defty committed Apr 9, 2020
1 parent b9157a8 commit 27ddf8d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ import '@bigbite/wp-cypress';
"pageLoadTimeout": 30000,
"wp": {
"version": "5.3.2",
"timezone": "Europe/London",
"plugins": [
"./"
],
Expand Down
13 changes: 11 additions & 2 deletions bin/configureWordPress.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,19 @@ const run = require('./utils/run');
const configureWordPress = async (configFilePath, logFile) => {
const config = JSON.parse(fs.readFileSync(configFilePath, 'utf8'));

if (config.timezone) {
await run(
async () => wpcli(`option update timezone_string ${config.timezone}`, logFile),
'Updating Timezone',
'Timezone updated',
logFile,
);
}

await run(
async () => wpcli('plugin activate wp-cypress', logFile),
'Activating WP Cypress plugin',
'WP Cypress plugin Activated',
'Activating wp-cypress plugin',
'wp-cypress plugin activated',
logFile,
);

Expand Down

0 comments on commit 27ddf8d

Please sign in to comment.