-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Upgrade NPM packages. * Upgrade config file. * Renamed test folder * Removed plugins * upgrade support file * Update npm scripts. * Test folder path update. * downgrade typedoc package to keep doc site as it is. * Stop video to check if it can make e2e tests fast. * Fix test failing in 6.1 * Add dependencies back * Fix tests. Co-authored-by: Max Lyuchin <maxim.lyuchin@gmail.com>
- Loading branch information
1 parent
6479371
commit f716bda
Showing
23 changed files
with
669 additions
and
727 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
const { defineConfig } = require('cypress'); | ||
const { readConfig } = require('@wordpress/env/lib/config'); | ||
|
||
module.exports = defineConfig({ | ||
fixturesFolder: 'tests/cypress/fixtures', | ||
screenshotsFolder: 'tests/cypress/screenshots', | ||
videosFolder: 'tests/cypress/videos', | ||
downloadsFolder: 'tests/cypress/downloads', | ||
video: false, | ||
e2e: { | ||
setupNodeEvents(on, config) { | ||
return setBaseUrl(on, config); | ||
}, | ||
specPattern: 'tests/cypress/e2e/**/*.test.{js,jsx,ts,tsx}', | ||
supportFile: 'tests/cypress/support/e2e.js', | ||
}, | ||
reporter: 'mochawesome', | ||
reporterOptions: { | ||
reportFilename: 'mochawesome-[name]', | ||
reportDir: 'tests/cypress/reports', | ||
overwrite: false, | ||
html: false, | ||
json: true, | ||
}, | ||
}); | ||
|
||
/** | ||
* 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'); | ||
|
||
if (wpEnvConfig) { | ||
const port = wpEnvConfig.env.tests.port || null; | ||
|
||
if (port) { | ||
config.baseUrl = wpEnvConfig.env.tests.config.WP_SITEURL; | ||
} | ||
} | ||
|
||
return config; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters