Skip to content

Commit

Permalink
Merge pull request #34 from 10up/feature/add-chrome-web-security-config
Browse files Browse the repository at this point in the history
Set `chromeWebSecurity` config value to `false` by default
  • Loading branch information
dkotter authored Aug 25, 2023
2 parents a244e94 + 2f4248b commit 79089fa
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/tests/bin/initialize.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash
npm run env run tests-wordpress "chmod -c ugo+w /var/www/html"
npm run env run tests-cli "wp rewrite structure '/%postname%/' --hard"
npm run env run tests-wordpress chmod -- -c ugo+w /var/www/html
npm run env run tests-cli wp rewrite structure '/%postname%/' -- --hard
9 changes: 6 additions & 3 deletions src/tests/cypress/config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
const { defineConfig } = require('cypress');
const { readConfig } = require('@wordpress/env/lib/config');
const { loadConfig } = require( '@wordpress/env/lib/config' );
const getCacheDirectory = require( '@wordpress/env/lib/config/get-cache-directory' );

module.exports = defineConfig({
chromeWebSecurity: false,
fixturesFolder: 'tests/cypress/fixtures',
screenshotsFolder: 'tests/cypress/screenshots',
videosFolder: 'tests/cypress/videos',
Expand All @@ -18,13 +20,14 @@ module.exports = defineConfig({

/**
* Set WP URL as baseUrl in Cypress config.
*
*
* @param {Function} on function that used to register listeners on various events.
* @param {object} config Cypress Config object.
* @returns config Updated Cypress Config object.
*/
const setBaseUrl = async (on, config) => {
const wpEnvConfig = await readConfig('wp-env');
const cacheDirectory = await getCacheDirectory();
const wpEnvConfig = await loadConfig( cacheDirectory );

if (wpEnvConfig) {
const port = wpEnvConfig.env.tests.port || null;
Expand Down

0 comments on commit 79089fa

Please sign in to comment.