mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-18 03:16:01 +00:00
52 lines
1.9 KiB
JavaScript
52 lines
1.9 KiB
JavaScript
Cypress.on('uncaught:exception', (err, runnable) => {
|
|
// if the error message matches the one about WorkerGlobalScope importScripts
|
|
if (err.message.includes("Failed to execute 'importScripts' on 'WorkerGlobalScope'")) {
|
|
// return false to let Cypress know we intentionally want to ignore this error
|
|
return false;
|
|
}
|
|
// otherwise let Cypress throw the error
|
|
});
|
|
|
|
beforeEach(() => {
|
|
cy.visit('http://localhost:3000');
|
|
cy.viewport(1250, 900);
|
|
});
|
|
|
|
describe('Charts', () => {
|
|
it('Auto detect chart', () => {
|
|
cy.contains('MySql-connection').click();
|
|
cy.contains('charts_sample').click();
|
|
cy.testid('WidgetIconPanel_file').click();
|
|
cy.contains('chart1').click();
|
|
cy.contains('department_name');
|
|
// cy.testid('QueryTab_executeButton').click();
|
|
// cy.testid('QueryTab_openChartButton').click();
|
|
cy.testid('chart-canvas').should($c => expect($c[0].toDataURL()).to.match(/^data:image\/png;base64/));
|
|
cy.themeshot('choose-detected-chart');
|
|
});
|
|
|
|
it('Two line charts', () => {
|
|
cy.contains('MySql-connection').click();
|
|
cy.contains('MyChinook').click();
|
|
cy.testid('TabsPanel_buttonNewQuery').click();
|
|
cy.wait(1000);
|
|
cy.get('body').realType('SELECT InvoiceDate, Total from Invoice');
|
|
cy.contains('Execute').click();
|
|
cy.contains('Open chart').click();
|
|
cy.testid('chart-canvas').should($c => expect($c[0].toDataURL()).to.match(/^data:image\/png;base64/));
|
|
cy.themeshot('two-line-charts');
|
|
});
|
|
|
|
it('Invoice naive autodetection', () => {
|
|
cy.contains('MySql-connection').click();
|
|
cy.contains('MyChinook').click();
|
|
cy.testid('TabsPanel_buttonNewQuery').click();
|
|
cy.wait(1000);
|
|
cy.get('body').realType('SELECT * from Invoice');
|
|
cy.contains('Execute').click();
|
|
cy.contains('Open chart').click();
|
|
cy.testid('chart-canvas').should($c => expect($c[0].toDataURL()).to.match(/^data:image\/png;base64/));
|
|
cy.themeshot('chart-naive-autodetection');
|
|
});
|
|
});
|