This commit is contained in:
2026-02-16 14:39:46 -08:00
parent ea6e5361be
commit 5e04bde2f1
6 changed files with 75 additions and 102 deletions

View File

@@ -1,66 +1,8 @@
//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;
const fs = require('fs')
const path = require('path')
// return launchOptions;
// }
// });
// };
const ABORT_FLAG_PATH = path.join(__dirname, '..', '.abort-run')
// 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') {
@@ -77,5 +19,27 @@ module.exports = (on, config) => {
config.env.apiBaseUrl = config.env.REMOTE_API_URL
}
return config // <-- critical, must return config
// Task to set abort flag
on('task', {
setAbortFlag() {
fs.writeFileSync(ABORT_FLAG_PATH, 'ABORTED')
return null
},
checkAbortFlag() {
return fs.existsSync(ABORT_FLAG_PATH)
},
clearAbortFlag() {
if (fs.existsSync(ABORT_FLAG_PATH)) {
fs.unlinkSync(ABORT_FLAG_PATH)
}
return null
}
})
// Clean up abort flag at start of run
if (fs.existsSync(ABORT_FLAG_PATH)) {
fs.unlinkSync(ABORT_FLAG_PATH)
}
return config
}