This commit is contained in:
2026-02-16 11:09:41 -08:00
parent e6cae41b78
commit ea6e5361be
5 changed files with 116 additions and 20 deletions

View File

@@ -5,27 +5,15 @@
"integrationFolder": "tests/regression",
"testFiles": "**/*.cy.{js,jsx,ts,tsx}",
"supportFile": "support/e2e.js",
"pluginsFile": "plugins/index.js",
"env": {
"apiBaseUrl": "http://localhost:7575/api/v8.0/",
"admin": {
"login": "superuser",
"password": "l3tm3in"
},
"accounting": {
"login": "Accounting",
"password": "Accounting"
},
"service": {
"login": "Service",
"password": "Service"
},
"customer": {
"login": "Customer",
"password": "Customer"
},
"bizadmin": {
"login": "BizAdmin",
"password": "BizAdmin"
}
"REMOTE_BASE_URL": "https://devtest.onayanova.com/",
"REMOTE_API_URL": "https://devtest.onayanova.com/api/v8.0/",
"admin": { "login": "superuser", "password": "l3tm3in" },
"accounting": { "login": "Accounting", "password": "Accounting" },
"service": { "login": "Service", "password": "Service" },
"customer": { "login": "Customer", "password": "Customer" },
"bizadmin": { "login": "BizAdmin", "password": "BizAdmin" }
}
}

3
e2e/local-run.bat Normal file
View File

@@ -0,0 +1,3 @@
./node_modules/.bin/cypress run --browser chrome --config baseUrl=http://localhost:8080 --env apiBaseUrl=http://localhost:7575/api/v8.0/
rem ./node_modules/.bin/cypress run --browser firefox --spec .\tests\regression\*.js --no-exit
rem ./node_modules/.bin/cypress run --browser chrome --no-exit

81
e2e/plugins/index.js Normal file
View File

@@ -0,0 +1,81 @@
//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
}

3
e2e/remote-run.bat Normal file
View File

@@ -0,0 +1,3 @@
./node_modules/.bin/cypress run --browser chrome --config baseUrl=https://devtest.onayanova.com/ --env TARGET_ENV=remote
rem ./node_modules/.bin/cypress run --browser firefox --spec .\tests\regression\*.js --no-exit
rem ./node_modules/.bin/cypress run --browser chrome --no-exit

View File

@@ -1,6 +1,27 @@
// Basic smoke test, visit every form to ensure they load
describe("SMOKE SETUP", () => {
before(() => {
cy.request({
url: `${Cypress.env("apiBaseUrl")}version`,
method: "GET"
}).then((resp) => {
const serverVersion = resp.body.data.version
if (serverVersion !== "8.0.0") {
Cypress.env("ABORT_RUN", true)
throw new Error(`Version mismatch: expected 8.0.0 but got ${serverVersion}`)
}
})
})
after(() => {
if (Cypress.env("ABORT_RUN")) {
Cypress.runner.stop()
}
})
it("Generates test data without issue", () => {
cy.request({
url: `${Cypress.env("apiBaseUrl")}auth`,