81 lines
2.9 KiB
JavaScript
81 lines
2.9 KiB
JavaScript
//my sample users use obvious passwords "service/service", "accounting/accounting" triggering annoying your password is used in a hack warning in chrome
|
|
//sample users are inteded to be this easy to guess for testing and trial evaluation purposes so not changing it
|
|
// /**
|
|
// * @type {Cypress.PluginConfig}
|
|
// */
|
|
// module.exports = (on, config) => {
|
|
// on('before:browser:launch', (browser = {}, launchOptions) => {
|
|
// // Check if we are using Chrome or a Chromium-based browser
|
|
// if (browser.family === 'chromium' && browser.name !== 'electron') {
|
|
|
|
// // 1. Disable the specific password leak detection feature
|
|
// launchOptions.args.push('--disable-features=PasswordLeakDetection');
|
|
|
|
// // 2. Disable the "Save Password" and "Check Passwords" prompts
|
|
// launchOptions.preferences.default['credentials_enable_service'] = false;
|
|
// launchOptions.preferences.default['profile.password_manager_enabled'] = false;
|
|
|
|
// // 3. Specifically target the leak detection toggle in preferences
|
|
// launchOptions.preferences.default['profile.password_manager_leak_detection'] = false;
|
|
|
|
// return launchOptions;
|
|
// }
|
|
// });
|
|
// };
|
|
|
|
|
|
|
|
|
|
// module.exports = (on, config) => {
|
|
// on('before:browser:launch', (browser, launchOptions) => {
|
|
// if (browser.name === 'chrome') {
|
|
// launchOptions.args.push(
|
|
// '--disable-features=PasswordLeakDetection,PasswordManagerLeakDetection,PasswordCheck,InsecureCredentialsWarning'
|
|
// );
|
|
// }
|
|
// return launchOptions;
|
|
// });
|
|
// };
|
|
|
|
|
|
|
|
// /// <reference types="cypress" />
|
|
// // ***********************************************************
|
|
// // This example plugins/index.js can be used to load plugins
|
|
// //
|
|
// // You can change the location of this file or turn off loading
|
|
// // the plugins file with the 'pluginsFile' configuration option.
|
|
// //
|
|
// // You can read more here:
|
|
// // https://on.cypress.io/plugins-guide
|
|
// // ***********************************************************
|
|
|
|
// // This function is called when a project is opened or re-opened (e.g. due to
|
|
// // the project's config changing)
|
|
|
|
// /**
|
|
// * @type {Cypress.PluginConfig}
|
|
// */
|
|
// // eslint-disable-next-line no-unused-vars
|
|
// module.exports = (on, config) => {
|
|
// // `on` is used to hook into various events Cypress emits
|
|
// // `config` is the resolved Cypress config
|
|
// }
|
|
module.exports = (on, config) => {
|
|
on('before:browser:launch', (browser, launchOptions) => {
|
|
if (browser.name === 'chrome') {
|
|
launchOptions.args.push('--disable-gpu')
|
|
launchOptions.args.push('--no-sandbox')
|
|
launchOptions.args.push('--disable-dev-shm-usage')
|
|
}
|
|
return launchOptions
|
|
})
|
|
|
|
// If a TARGET_ENV env var was passed, override baseUrl and apiBaseUrl
|
|
if (config.env.TARGET_ENV === 'remote') {
|
|
config.baseUrl = config.env.REMOTE_BASE_URL
|
|
config.env.apiBaseUrl = config.env.REMOTE_API_URL
|
|
}
|
|
|
|
return config // <-- critical, must return config
|
|
} |