mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-18 02:06:01 +00:00
generate screenshots
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
const path = require('path');
|
||||
|
||||
// ***********************************************
|
||||
// This example commands.js shows you how to
|
||||
// create various custom commands and overwrite
|
||||
@@ -33,11 +35,45 @@ Cypress.Commands.add('themeshot', file => {
|
||||
win.__changeCurrentTheme('theme-dark');
|
||||
});
|
||||
|
||||
// cy.screenshot(`${file}-dark`, {
|
||||
// onAfterScreenshot: (doc, props) => {
|
||||
// cy.task('renameFile', {
|
||||
// from: props.path,
|
||||
// to: path.resolve(__dirname, `../../screenshots/${file}-dark.png`),
|
||||
// });
|
||||
|
||||
// // fs.rename(props.path, path.resolve(path.join(__dirname, `../../screenshots/${file}-dark.png`)));
|
||||
// },
|
||||
// });
|
||||
|
||||
cy.screenshot(`${file}-dark`);
|
||||
// .then(props => {
|
||||
// return cy.task('renameFile', {
|
||||
// from: props.path,
|
||||
// to: path.resolve(__dirname, `../../screenshots/${file}-dark.png`),
|
||||
// });
|
||||
// });
|
||||
|
||||
cy.window().then(win => {
|
||||
win.__changeCurrentTheme('theme-light');
|
||||
});
|
||||
|
||||
cy.screenshot(`${file}-light`);
|
||||
// .then(props => {
|
||||
// return cy.task('renameFile', {
|
||||
// from: props.path,
|
||||
// to: path.resolve(__dirname, `../../screenshots/${file}-light.png`),
|
||||
// });
|
||||
// });
|
||||
|
||||
// cy.screenshot(`${file}-light`, {
|
||||
// onAfterScreenshot: (doc, props) => {
|
||||
// cy.task('renameFile', {
|
||||
// from: props.path,
|
||||
// to: path.resolve(__dirname, `../../screenshots/${file}-light.png`),
|
||||
// });
|
||||
|
||||
// // fs.rename(props.path, path.resolve(path.join(__dirname, `../../screenshots/${file}-light.png`)));
|
||||
// },
|
||||
// });
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user