4643
This commit is contained in:
@@ -5,27 +5,15 @@
|
|||||||
"integrationFolder": "tests/regression",
|
"integrationFolder": "tests/regression",
|
||||||
"testFiles": "**/*.cy.{js,jsx,ts,tsx}",
|
"testFiles": "**/*.cy.{js,jsx,ts,tsx}",
|
||||||
"supportFile": "support/e2e.js",
|
"supportFile": "support/e2e.js",
|
||||||
|
"pluginsFile": "plugins/index.js",
|
||||||
"env": {
|
"env": {
|
||||||
"apiBaseUrl": "http://localhost:7575/api/v8.0/",
|
"apiBaseUrl": "http://localhost:7575/api/v8.0/",
|
||||||
"admin": {
|
"REMOTE_BASE_URL": "https://devtest.onayanova.com/",
|
||||||
"login": "superuser",
|
"REMOTE_API_URL": "https://devtest.onayanova.com/api/v8.0/",
|
||||||
"password": "l3tm3in"
|
"admin": { "login": "superuser", "password": "l3tm3in" },
|
||||||
},
|
"accounting": { "login": "Accounting", "password": "Accounting" },
|
||||||
"accounting": {
|
"service": { "login": "Service", "password": "Service" },
|
||||||
"login": "Accounting",
|
"customer": { "login": "Customer", "password": "Customer" },
|
||||||
"password": "Accounting"
|
"bizadmin": { "login": "BizAdmin", "password": "BizAdmin" }
|
||||||
},
|
|
||||||
"service": {
|
|
||||||
"login": "Service",
|
|
||||||
"password": "Service"
|
|
||||||
},
|
|
||||||
"customer": {
|
|
||||||
"login": "Customer",
|
|
||||||
"password": "Customer"
|
|
||||||
},
|
|
||||||
"bizadmin": {
|
|
||||||
"login": "BizAdmin",
|
|
||||||
"password": "BizAdmin"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
3
e2e/local-run.bat
Normal file
3
e2e/local-run.bat
Normal 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
81
e2e/plugins/index.js
Normal 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
3
e2e/remote-run.bat
Normal 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
|
||||||
@@ -1,6 +1,27 @@
|
|||||||
// Basic smoke test, visit every form to ensure they load
|
// Basic smoke test, visit every form to ensure they load
|
||||||
|
|
||||||
describe("SMOKE SETUP", () => {
|
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", () => {
|
it("Generates test data without issue", () => {
|
||||||
cy.request({
|
cy.request({
|
||||||
url: `${Cypress.env("apiBaseUrl")}auth`,
|
url: `${Cypress.env("apiBaseUrl")}auth`,
|
||||||
|
|||||||
Reference in New Issue
Block a user