mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-27 03:13:56 +08:00
feat(cypress): add configs for not overriding screenshots (#5524)
This commit is contained in:
@ -21,4 +21,5 @@ module.exports = {
|
||||
chromeWebSecurity: false,
|
||||
defaultCommandTimeout: 10000,
|
||||
pageLoadTimeout: 20000,
|
||||
trashAssetsBeforeRuns: false,
|
||||
};
|
||||
|
||||
@ -15,6 +15,7 @@
|
||||
|
||||
// Import commands.js using ES2015 syntax:
|
||||
import "./commands";
|
||||
import "./screenshotConfigs";
|
||||
|
||||
// Alternatively you can use CommonJS syntax:
|
||||
// require('./commands')
|
||||
|
||||
21
cypress-tests/cypress/support/screenshotConfigs.js
Normal file
21
cypress-tests/cypress/support/screenshotConfigs.js
Normal file
@ -0,0 +1,21 @@
|
||||
Cypress.Screenshot.defaults({
|
||||
blackout: [".secret-info", "[data-hide=true]"],
|
||||
capture: "runner",
|
||||
overwrite: false,
|
||||
|
||||
onBeforeScreenshot($el) {
|
||||
const $clock = $el.find(".clock");
|
||||
|
||||
if ($clock) {
|
||||
$clock.hide();
|
||||
}
|
||||
},
|
||||
|
||||
onAfterScreenshot($el, props) {
|
||||
const $clock = $el.find(".clock");
|
||||
|
||||
if ($clock) {
|
||||
$clock.show();
|
||||
}
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user