mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-25 00:36:00 +00:00
next E2E tests
This commit is contained in:
@@ -13,20 +13,20 @@ beforeEach(() => {
|
||||
});
|
||||
|
||||
describe('Data browser data', () => {
|
||||
it('Export to data archive', () => {
|
||||
cy.contains('MySql-connection').click();
|
||||
// cy.contains('MyChinook').click();
|
||||
// cy.contains('Album').click();
|
||||
cy.contains('MyChinook').rightclick();
|
||||
cy.contains('Export').click();
|
||||
cy.wait(1000);
|
||||
cy.testid('SourceTargetConfig_buttonCurrentArchive_target').click();
|
||||
cy.testid('FormTablesSelect_buttonAll_tables').click();
|
||||
// cy.wait(4000);
|
||||
// cy.contains('All tables').click();
|
||||
cy.contains('Run').click();
|
||||
cy.contains('Finished job script');
|
||||
});
|
||||
// it('Export to data archive', () => {
|
||||
// cy.contains('MySql-connection').click();
|
||||
// // cy.contains('MyChinook').click();
|
||||
// // cy.contains('Album').click();
|
||||
// cy.contains('MyChinook').rightclick();
|
||||
// cy.contains('Export').click();
|
||||
// cy.wait(1000);
|
||||
// cy.testid('SourceTargetConfig_buttonCurrentArchive_target').click();
|
||||
// cy.testid('FormTablesSelect_buttonAll_tables').click();
|
||||
// // cy.wait(4000);
|
||||
// // cy.contains('All tables').click();
|
||||
// cy.contains('Run').click();
|
||||
// cy.contains('Finished job script');
|
||||
// });
|
||||
|
||||
it('Data archive editor - macros', () => {
|
||||
cy.testid('WidgetIconPanel_archive').click();
|
||||
@@ -197,4 +197,52 @@ describe('Data browser data', () => {
|
||||
cy.contains('CREATE INDEX `IFK_CustomerSupportRepId`');
|
||||
cy.themeshot('sqlpreview');
|
||||
});
|
||||
|
||||
it('Query designer', () => {
|
||||
cy.contains('MySql-connection').click();
|
||||
cy.contains('MyChinook').click();
|
||||
cy.testid('WidgetIconPanel_file').click();
|
||||
cy.contains('customer').click();
|
||||
// cy.contains('left join').rightclick();
|
||||
cy.themeshot('querydesigner');
|
||||
});
|
||||
|
||||
it('Database diagram', () => {
|
||||
cy.contains('MySql-connection').click();
|
||||
cy.contains('MyChinook').click();
|
||||
cy.testid('WidgetIconPanel_file').click();
|
||||
cy.contains('chinook-diagram').click();
|
||||
cy.testid('WidgetIconPanel_file').click();
|
||||
// check diagram is shown
|
||||
cy.contains('MediaTypeId');
|
||||
cy.themeshot('diagram');
|
||||
});
|
||||
|
||||
it('Charts', () => {
|
||||
cy.testid('WidgetIconPanel_file').click();
|
||||
cy.contains('pie-chart').click();
|
||||
cy.contains('line-chart').click();
|
||||
cy.testid('TabsPanel_buttonSplit').click();
|
||||
cy.testid('WidgetIconPanel_file').click();
|
||||
cy.themeshot('charts');
|
||||
});
|
||||
|
||||
it('Keyboard configuration', () => {
|
||||
cy.testid('WidgetIconPanel_settings').click();
|
||||
cy.contains('Keyboard shortcuts').click();
|
||||
cy.contains('dataForm.refresh').click();
|
||||
cy.testid('CommandModal_keyboardButton').click();
|
||||
cy.themeshot('keyboard');
|
||||
});
|
||||
|
||||
it('Command palette', () => {
|
||||
cy.contains('Connections');
|
||||
cy.testid('WidgetIconPanel_menu').click();
|
||||
cy.contains('Tools').click();
|
||||
cy.contains('Command palette').click();
|
||||
// cy.realPress('F1');
|
||||
cy.realPress('PageDown');
|
||||
cy.realPress('PageDown');
|
||||
cy.testid('CommandPalette_main').themeshot('commandpalette', { padding: 50 });
|
||||
});
|
||||
});
|
||||
|
||||
@@ -30,50 +30,64 @@ Cypress.Commands.add('testid', (testId, options = {}) => {
|
||||
return cy.get(`[data-testid="${testId}"]`, options);
|
||||
});
|
||||
|
||||
Cypress.Commands.add('themeshot', file => {
|
||||
cy.window().then(win => {
|
||||
win.__changeCurrentTheme('theme-dark');
|
||||
});
|
||||
Cypress.Commands.add(
|
||||
'themeshot',
|
||||
{
|
||||
prevSubject: 'optional',
|
||||
},
|
||||
(subject, file, options) => {
|
||||
cy.window().then(win => {
|
||||
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`),
|
||||
// });
|
||||
// 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`)));
|
||||
// },
|
||||
// });
|
||||
// // 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`),
|
||||
// });
|
||||
// });
|
||||
if (subject) {
|
||||
cy.wrap(subject).screenshot(`${file}-dark`, options);
|
||||
} else {
|
||||
cy.screenshot(`${file}-dark`, options);
|
||||
}
|
||||
// .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.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`),
|
||||
// });
|
||||
// });
|
||||
if (subject) {
|
||||
cy.wrap(subject).screenshot(`${file}-light`, options);
|
||||
} else {
|
||||
cy.screenshot(`${file}-light`, options);
|
||||
}
|
||||
// .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`),
|
||||
// });
|
||||
// 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`)));
|
||||
// },
|
||||
// });
|
||||
});
|
||||
// // fs.rename(props.path, path.resolve(path.join(__dirname, `../../screenshots/${file}-light.png`)));
|
||||
// },
|
||||
// });
|
||||
}
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user