mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-27 06:46: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`)));
|
||||
// },
|
||||
// });
|
||||
}
|
||||
);
|
||||
|
||||
1
e2e-tests/data/files/charts/line-chart
Normal file
1
e2e-tests/data/files/charts/line-chart
Normal file
@@ -0,0 +1 @@
|
||||
{"data":{"structure":{"columns":[{"columnName":"Month"},{"columnName":"Total"},{"columnName":"Invoices"}]},"rows":[{"Month":"2021-01","Total":"35.64","Invoices":"6"},{"Month":"2021-02","Total":"37.62","Invoices":"7"},{"Month":"2021-03","Total":"37.62","Invoices":"7"},{"Month":"2021-04","Total":"37.62","Invoices":"7"},{"Month":"2021-05","Total":"37.62","Invoices":"7"},{"Month":"2021-06","Total":"37.62","Invoices":"7"},{"Month":"2021-07","Total":"37.62","Invoices":"7"},{"Month":"2021-08","Total":"37.62","Invoices":"7"},{"Month":"2021-09","Total":"37.62","Invoices":"7"},{"Month":"2021-10","Total":"37.62","Invoices":"7"},{"Month":"2021-11","Total":"37.62","Invoices":"7"},{"Month":"2021-12","Total":"37.62","Invoices":"7"},{"Month":"2022-01","Total":"52.62","Invoices":"7"},{"Month":"2022-02","Total":"46.62","Invoices":"7"},{"Month":"2022-03","Total":"44.62","Invoices":"7"},{"Month":"2022-04","Total":"37.62","Invoices":"7"},{"Month":"2022-05","Total":"37.62","Invoices":"7"},{"Month":"2022-06","Total":"37.62","Invoices":"7"},{"Month":"2022-07","Total":"37.62","Invoices":"7"},{"Month":"2022-08","Total":"37.62","Invoices":"7"},{"Month":"2022-09","Total":"36.63","Invoices":"6"},{"Month":"2022-10","Total":"37.62","Invoices":"7"},{"Month":"2022-11","Total":"37.62","Invoices":"7"},{"Month":"2022-12","Total":"37.62","Invoices":"7"},{"Month":"2023-01","Total":"37.62","Invoices":"7"},{"Month":"2023-02","Total":"37.62","Invoices":"7"},{"Month":"2023-03","Total":"37.62","Invoices":"7"},{"Month":"2023-04","Total":"51.62","Invoices":"7"},{"Month":"2023-05","Total":"42.62","Invoices":"7"},{"Month":"2023-06","Total":"50.62","Invoices":"7"},{"Month":"2023-07","Total":"37.62","Invoices":"7"},{"Month":"2023-08","Total":"37.62","Invoices":"7"},{"Month":"2023-09","Total":"37.62","Invoices":"7"},{"Month":"2023-10","Total":"37.62","Invoices":"7"},{"Month":"2023-11","Total":"23.76","Invoices":"6"},{"Month":"2023-12","Total":"37.62","Invoices":"7"},{"Month":"2024-01","Total":"37.62","Invoices":"7"},{"Month":"2024-02","Total":"37.62","Invoices":"7"},{"Month":"2024-03","Total":"37.62","Invoices":"7"},{"Month":"2024-04","Total":"37.62","Invoices":"7"},{"Month":"2024-05","Total":"37.62","Invoices":"7"},{"Month":"2024-06","Total":"37.62","Invoices":"7"},{"Month":"2024-07","Total":"39.62","Invoices":"7"},{"Month":"2024-08","Total":"47.62","Invoices":"7"},{"Month":"2024-09","Total":"46.71","Invoices":"6"},{"Month":"2024-10","Total":"42.62","Invoices":"7"},{"Month":"2024-11","Total":"37.62","Invoices":"7"},{"Month":"2024-12","Total":"37.62","Invoices":"7"},{"Month":"2025-01","Total":"37.62","Invoices":"7"},{"Month":"2025-02","Total":"27.72","Invoices":"5"},{"Month":"2025-03","Total":"37.62","Invoices":"7"},{"Month":"2025-04","Total":"33.66","Invoices":"5"},{"Month":"2025-05","Total":"37.62","Invoices":"7"},{"Month":"2025-06","Total":"37.62","Invoices":"7"},{"Month":"2025-07","Total":"37.62","Invoices":"7"},{"Month":"2025-08","Total":"37.62","Invoices":"7"},{"Month":"2025-09","Total":"37.62","Invoices":"7"},{"Month":"2025-10","Total":"37.62","Invoices":"7"},{"Month":"2025-11","Total":"49.62","Invoices":"7"},{"Month":"2025-12","Total":"38.62","Invoices":"7"}]},"config":{"chartType":"line","labelColumn":"Month","dataColumn_Total":true,"dataColumn_Invoices":false,"truncateFrom":"begin","dataColumn_Month":false,"dataColumnColor_Total":"gold"}}
|
||||
1
e2e-tests/data/files/charts/pie-chart
Normal file
1
e2e-tests/data/files/charts/pie-chart
Normal file
@@ -0,0 +1 @@
|
||||
{"data":{"structure":{"columns":[{"columnName":"OS"},{"columnName":"Downloads"}]},"rows":[{"OS":"Windows","Downloads":1724},{"OS":"MaxOS","Downloads":711},{"OS":"Linux","Downloads":445},{"OS":"iOS","Downloads":105},{"OS":"Android","Downloads":77}]},"config":{"chartType":"pie","labelColumn":"OS","dataColumn_Downloads":true,"showRelativeValues":false}}
|
||||
1
e2e-tests/data/files/diagrams/chinook-diagram
Normal file
1
e2e-tests/data/files/diagrams/chinook-diagram
Normal file
File diff suppressed because one or more lines are too long
592
e2e-tests/data/files/query/customer
Normal file
592
e2e-tests/data/files/query/customer
Normal file
@@ -0,0 +1,592 @@
|
||||
{
|
||||
"tables": [
|
||||
{
|
||||
"pureName": "InvoiceLine",
|
||||
"tableRowCount": "2240",
|
||||
"tableEngine": "InnoDB",
|
||||
"objectComment": "",
|
||||
"modifyDate": "2025-01-30 07:20:38",
|
||||
"objectId": "InvoiceLine",
|
||||
"contentHash": "2025-01-30 07:20:38",
|
||||
"columns": [
|
||||
{
|
||||
"pureName": "InvoiceLine",
|
||||
"notNull": true,
|
||||
"autoIncrement": true,
|
||||
"columnName": "InvoiceLineId",
|
||||
"columnComment": "",
|
||||
"dataType": "int",
|
||||
"defaultValue": null,
|
||||
"isUnsigned": false,
|
||||
"isZerofill": false
|
||||
},
|
||||
{
|
||||
"pureName": "InvoiceLine",
|
||||
"notNull": true,
|
||||
"autoIncrement": false,
|
||||
"columnName": "InvoiceId",
|
||||
"columnComment": "",
|
||||
"dataType": "int",
|
||||
"defaultValue": null,
|
||||
"isUnsigned": false,
|
||||
"isZerofill": false
|
||||
},
|
||||
{
|
||||
"pureName": "InvoiceLine",
|
||||
"notNull": true,
|
||||
"autoIncrement": false,
|
||||
"columnName": "TrackId",
|
||||
"columnComment": "",
|
||||
"dataType": "int",
|
||||
"defaultValue": null,
|
||||
"isUnsigned": false,
|
||||
"isZerofill": false
|
||||
},
|
||||
{
|
||||
"pureName": "InvoiceLine",
|
||||
"notNull": true,
|
||||
"autoIncrement": false,
|
||||
"columnName": "UnitPrice",
|
||||
"columnComment": "",
|
||||
"dataType": "decimal(10,2)",
|
||||
"defaultValue": null,
|
||||
"isUnsigned": false,
|
||||
"isZerofill": false
|
||||
},
|
||||
{
|
||||
"pureName": "InvoiceLine",
|
||||
"notNull": true,
|
||||
"autoIncrement": false,
|
||||
"columnName": "Quantity",
|
||||
"columnComment": "",
|
||||
"dataType": "int",
|
||||
"defaultValue": null,
|
||||
"isUnsigned": false,
|
||||
"isZerofill": false
|
||||
}
|
||||
],
|
||||
"primaryKey": {
|
||||
"constraintName": "PRIMARY",
|
||||
"pureName": "InvoiceLine",
|
||||
"constraintType": "primaryKey",
|
||||
"columns": [
|
||||
{
|
||||
"columnName": "InvoiceLineId"
|
||||
}
|
||||
]
|
||||
},
|
||||
"foreignKeys": [
|
||||
{
|
||||
"constraintName": "FK_InvoiceLineInvoiceId",
|
||||
"constraintType": "foreignKey",
|
||||
"pureName": "InvoiceLine",
|
||||
"refTableName": "Invoice",
|
||||
"updateAction": "NO ACTION",
|
||||
"deleteAction": "NO ACTION",
|
||||
"columns": [
|
||||
{
|
||||
"columnName": "InvoiceId",
|
||||
"refColumnName": "InvoiceId"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"constraintName": "FK_InvoiceLineTrackId",
|
||||
"constraintType": "foreignKey",
|
||||
"pureName": "InvoiceLine",
|
||||
"refTableName": "Track",
|
||||
"updateAction": "NO ACTION",
|
||||
"deleteAction": "NO ACTION",
|
||||
"columns": [
|
||||
{
|
||||
"columnName": "TrackId",
|
||||
"refColumnName": "TrackId"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"indexes": [
|
||||
{
|
||||
"constraintName": "IFK_InvoiceLineInvoiceId",
|
||||
"indexType": "BTREE",
|
||||
"isUnique": false,
|
||||
"columns": [
|
||||
{
|
||||
"columnName": "InvoiceId",
|
||||
"isDescending": 0
|
||||
}
|
||||
],
|
||||
"pureName": "InvoiceLine",
|
||||
"constraintType": "index"
|
||||
},
|
||||
{
|
||||
"constraintName": "IFK_InvoiceLineTrackId",
|
||||
"indexType": "BTREE",
|
||||
"isUnique": false,
|
||||
"columns": [
|
||||
{
|
||||
"columnName": "TrackId",
|
||||
"isDescending": 0
|
||||
}
|
||||
],
|
||||
"pureName": "InvoiceLine",
|
||||
"constraintType": "index"
|
||||
}
|
||||
],
|
||||
"uniques": [],
|
||||
"engine": "mysql@dbgate-plugin-mysql",
|
||||
"dependencies": [],
|
||||
"objectTypeField": "tables",
|
||||
"checks": [],
|
||||
"conid": "mysql",
|
||||
"database": "MyChinook",
|
||||
"designerId": "InvoiceLine-61eb0ba0-dedc-11ef-acf9-b7e3c0869b02",
|
||||
"left": 513,
|
||||
"top": 247,
|
||||
"alias": null
|
||||
},
|
||||
{
|
||||
"pureName": "Customer",
|
||||
"tableRowCount": "59",
|
||||
"tableEngine": "InnoDB",
|
||||
"objectComment": "",
|
||||
"modifyDate": "2025-01-30 07:20:37",
|
||||
"objectId": "Customer",
|
||||
"contentHash": "2025-01-30 07:20:37",
|
||||
"columns": [
|
||||
{
|
||||
"pureName": "Customer",
|
||||
"notNull": true,
|
||||
"autoIncrement": true,
|
||||
"columnName": "CustomerId",
|
||||
"columnComment": "",
|
||||
"dataType": "int",
|
||||
"defaultValue": null,
|
||||
"isUnsigned": false,
|
||||
"isZerofill": false
|
||||
},
|
||||
{
|
||||
"pureName": "Customer",
|
||||
"notNull": true,
|
||||
"autoIncrement": false,
|
||||
"columnName": "FirstName",
|
||||
"columnComment": "",
|
||||
"dataType": "varchar(40)",
|
||||
"defaultValue": null,
|
||||
"isUnsigned": false,
|
||||
"isZerofill": false
|
||||
},
|
||||
{
|
||||
"pureName": "Customer",
|
||||
"notNull": true,
|
||||
"autoIncrement": false,
|
||||
"columnName": "LastName",
|
||||
"columnComment": "",
|
||||
"dataType": "varchar(20)",
|
||||
"defaultValue": null,
|
||||
"isUnsigned": false,
|
||||
"isZerofill": false
|
||||
},
|
||||
{
|
||||
"pureName": "Customer",
|
||||
"notNull": false,
|
||||
"autoIncrement": false,
|
||||
"columnName": "Company",
|
||||
"columnComment": "",
|
||||
"dataType": "varchar(80)",
|
||||
"defaultValue": "NULL",
|
||||
"isUnsigned": false,
|
||||
"isZerofill": false
|
||||
},
|
||||
{
|
||||
"pureName": "Customer",
|
||||
"notNull": false,
|
||||
"autoIncrement": false,
|
||||
"columnName": "Address",
|
||||
"columnComment": "",
|
||||
"dataType": "varchar(70)",
|
||||
"defaultValue": "NULL",
|
||||
"isUnsigned": false,
|
||||
"isZerofill": false
|
||||
},
|
||||
{
|
||||
"pureName": "Customer",
|
||||
"notNull": false,
|
||||
"autoIncrement": false,
|
||||
"columnName": "City",
|
||||
"columnComment": "",
|
||||
"dataType": "varchar(40)",
|
||||
"defaultValue": "NULL",
|
||||
"isUnsigned": false,
|
||||
"isZerofill": false
|
||||
},
|
||||
{
|
||||
"pureName": "Customer",
|
||||
"notNull": false,
|
||||
"autoIncrement": false,
|
||||
"columnName": "State",
|
||||
"columnComment": "",
|
||||
"dataType": "varchar(40)",
|
||||
"defaultValue": "NULL",
|
||||
"isUnsigned": false,
|
||||
"isZerofill": false
|
||||
},
|
||||
{
|
||||
"pureName": "Customer",
|
||||
"notNull": false,
|
||||
"autoIncrement": false,
|
||||
"columnName": "Country",
|
||||
"columnComment": "",
|
||||
"dataType": "varchar(40)",
|
||||
"defaultValue": "NULL",
|
||||
"isUnsigned": false,
|
||||
"isZerofill": false
|
||||
},
|
||||
{
|
||||
"pureName": "Customer",
|
||||
"notNull": false,
|
||||
"autoIncrement": false,
|
||||
"columnName": "PostalCode",
|
||||
"columnComment": "",
|
||||
"dataType": "varchar(10)",
|
||||
"defaultValue": "NULL",
|
||||
"isUnsigned": false,
|
||||
"isZerofill": false
|
||||
},
|
||||
{
|
||||
"pureName": "Customer",
|
||||
"notNull": false,
|
||||
"autoIncrement": false,
|
||||
"columnName": "Phone",
|
||||
"columnComment": "",
|
||||
"dataType": "varchar(24)",
|
||||
"defaultValue": "NULL",
|
||||
"isUnsigned": false,
|
||||
"isZerofill": false
|
||||
},
|
||||
{
|
||||
"pureName": "Customer",
|
||||
"notNull": false,
|
||||
"autoIncrement": false,
|
||||
"columnName": "Fax",
|
||||
"columnComment": "",
|
||||
"dataType": "varchar(24)",
|
||||
"defaultValue": "NULL",
|
||||
"isUnsigned": false,
|
||||
"isZerofill": false
|
||||
},
|
||||
{
|
||||
"pureName": "Customer",
|
||||
"notNull": true,
|
||||
"autoIncrement": false,
|
||||
"columnName": "Email",
|
||||
"columnComment": "",
|
||||
"dataType": "varchar(60)",
|
||||
"defaultValue": null,
|
||||
"isUnsigned": false,
|
||||
"isZerofill": false
|
||||
},
|
||||
{
|
||||
"pureName": "Customer",
|
||||
"notNull": false,
|
||||
"autoIncrement": false,
|
||||
"columnName": "SupportRepId",
|
||||
"columnComment": "",
|
||||
"dataType": "int",
|
||||
"defaultValue": "NULL",
|
||||
"isUnsigned": false,
|
||||
"isZerofill": false
|
||||
}
|
||||
],
|
||||
"primaryKey": {
|
||||
"constraintName": "PRIMARY",
|
||||
"pureName": "Customer",
|
||||
"constraintType": "primaryKey",
|
||||
"columns": [
|
||||
{
|
||||
"columnName": "CustomerId"
|
||||
}
|
||||
]
|
||||
},
|
||||
"foreignKeys": [
|
||||
{
|
||||
"constraintName": "FK_CustomerSupportRepId",
|
||||
"constraintType": "foreignKey",
|
||||
"pureName": "Customer",
|
||||
"refTableName": "Employee",
|
||||
"updateAction": "NO ACTION",
|
||||
"deleteAction": "NO ACTION",
|
||||
"columns": [
|
||||
{
|
||||
"columnName": "SupportRepId",
|
||||
"refColumnName": "EmployeeId"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"indexes": [
|
||||
{
|
||||
"constraintName": "IFK_CustomerSupportRepId",
|
||||
"indexType": "BTREE",
|
||||
"isUnique": false,
|
||||
"columns": [
|
||||
{
|
||||
"columnName": "SupportRepId",
|
||||
"isDescending": 0
|
||||
}
|
||||
],
|
||||
"pureName": "Customer",
|
||||
"constraintType": "index"
|
||||
}
|
||||
],
|
||||
"uniques": [],
|
||||
"engine": "mysql@dbgate-plugin-mysql",
|
||||
"dependencies": [
|
||||
{
|
||||
"constraintName": "FK_InvoiceCustomerId",
|
||||
"constraintType": "foreignKey",
|
||||
"pureName": "Invoice",
|
||||
"refTableName": "Customer",
|
||||
"updateAction": "NO ACTION",
|
||||
"deleteAction": "NO ACTION",
|
||||
"columns": [
|
||||
{
|
||||
"columnName": "CustomerId",
|
||||
"refColumnName": "CustomerId"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"objectTypeField": "tables",
|
||||
"checks": [],
|
||||
"conid": "mysql",
|
||||
"database": "MyChinook",
|
||||
"designerId": "5d82f690-dedc-11ef-acf9-b7e3c0869b02",
|
||||
"left": 50,
|
||||
"top": 50
|
||||
},
|
||||
{
|
||||
"pureName": "Invoice",
|
||||
"tableRowCount": "412",
|
||||
"tableEngine": "InnoDB",
|
||||
"objectComment": "",
|
||||
"modifyDate": "2025-01-30 07:20:38",
|
||||
"objectId": "Invoice",
|
||||
"contentHash": "2025-01-30 07:20:38",
|
||||
"columns": [
|
||||
{
|
||||
"pureName": "Invoice",
|
||||
"notNull": true,
|
||||
"autoIncrement": true,
|
||||
"columnName": "InvoiceId",
|
||||
"columnComment": "",
|
||||
"dataType": "int",
|
||||
"defaultValue": null,
|
||||
"isUnsigned": false,
|
||||
"isZerofill": false
|
||||
},
|
||||
{
|
||||
"pureName": "Invoice",
|
||||
"notNull": true,
|
||||
"autoIncrement": false,
|
||||
"columnName": "CustomerId",
|
||||
"columnComment": "",
|
||||
"dataType": "int",
|
||||
"defaultValue": null,
|
||||
"isUnsigned": false,
|
||||
"isZerofill": false
|
||||
},
|
||||
{
|
||||
"pureName": "Invoice",
|
||||
"notNull": true,
|
||||
"autoIncrement": false,
|
||||
"columnName": "InvoiceDate",
|
||||
"columnComment": "",
|
||||
"dataType": "datetime",
|
||||
"defaultValue": null,
|
||||
"isUnsigned": false,
|
||||
"isZerofill": false
|
||||
},
|
||||
{
|
||||
"pureName": "Invoice",
|
||||
"notNull": false,
|
||||
"autoIncrement": false,
|
||||
"columnName": "BillingAddress",
|
||||
"columnComment": "",
|
||||
"dataType": "varchar(70)",
|
||||
"defaultValue": "NULL",
|
||||
"isUnsigned": false,
|
||||
"isZerofill": false
|
||||
},
|
||||
{
|
||||
"pureName": "Invoice",
|
||||
"notNull": false,
|
||||
"autoIncrement": false,
|
||||
"columnName": "BillingCity",
|
||||
"columnComment": "",
|
||||
"dataType": "varchar(40)",
|
||||
"defaultValue": "NULL",
|
||||
"isUnsigned": false,
|
||||
"isZerofill": false
|
||||
},
|
||||
{
|
||||
"pureName": "Invoice",
|
||||
"notNull": false,
|
||||
"autoIncrement": false,
|
||||
"columnName": "BillingState",
|
||||
"columnComment": "",
|
||||
"dataType": "varchar(40)",
|
||||
"defaultValue": "NULL",
|
||||
"isUnsigned": false,
|
||||
"isZerofill": false
|
||||
},
|
||||
{
|
||||
"pureName": "Invoice",
|
||||
"notNull": false,
|
||||
"autoIncrement": false,
|
||||
"columnName": "BillingCountry",
|
||||
"columnComment": "",
|
||||
"dataType": "varchar(40)",
|
||||
"defaultValue": "NULL",
|
||||
"isUnsigned": false,
|
||||
"isZerofill": false
|
||||
},
|
||||
{
|
||||
"pureName": "Invoice",
|
||||
"notNull": false,
|
||||
"autoIncrement": false,
|
||||
"columnName": "BillingPostalCode",
|
||||
"columnComment": "",
|
||||
"dataType": "varchar(10)",
|
||||
"defaultValue": "NULL",
|
||||
"isUnsigned": false,
|
||||
"isZerofill": false
|
||||
},
|
||||
{
|
||||
"pureName": "Invoice",
|
||||
"notNull": true,
|
||||
"autoIncrement": false,
|
||||
"columnName": "Total",
|
||||
"columnComment": "",
|
||||
"dataType": "decimal(10,2)",
|
||||
"defaultValue": null,
|
||||
"isUnsigned": false,
|
||||
"isZerofill": false
|
||||
}
|
||||
],
|
||||
"primaryKey": {
|
||||
"constraintName": "PRIMARY",
|
||||
"pureName": "Invoice",
|
||||
"constraintType": "primaryKey",
|
||||
"columns": [
|
||||
{
|
||||
"columnName": "InvoiceId"
|
||||
}
|
||||
]
|
||||
},
|
||||
"foreignKeys": [
|
||||
{
|
||||
"constraintName": "FK_InvoiceCustomerId",
|
||||
"constraintType": "foreignKey",
|
||||
"pureName": "Invoice",
|
||||
"refTableName": "Customer",
|
||||
"updateAction": "NO ACTION",
|
||||
"deleteAction": "NO ACTION",
|
||||
"columns": [
|
||||
{
|
||||
"columnName": "CustomerId",
|
||||
"refColumnName": "CustomerId"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"indexes": [
|
||||
{
|
||||
"constraintName": "IFK_InvoiceCustomerId",
|
||||
"indexType": "BTREE",
|
||||
"isUnique": false,
|
||||
"columns": [
|
||||
{
|
||||
"columnName": "CustomerId",
|
||||
"isDescending": 0
|
||||
}
|
||||
],
|
||||
"pureName": "Invoice",
|
||||
"constraintType": "index"
|
||||
}
|
||||
],
|
||||
"uniques": [],
|
||||
"engine": "mysql@dbgate-plugin-mysql",
|
||||
"dependencies": [
|
||||
{
|
||||
"constraintName": "FK_InvoiceLineInvoiceId",
|
||||
"constraintType": "foreignKey",
|
||||
"pureName": "InvoiceLine",
|
||||
"refTableName": "Invoice",
|
||||
"updateAction": "NO ACTION",
|
||||
"deleteAction": "NO ACTION",
|
||||
"columns": [
|
||||
{
|
||||
"columnName": "InvoiceId",
|
||||
"refColumnName": "InvoiceId"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"objectTypeField": "tables",
|
||||
"checks": [],
|
||||
"conid": "mysql",
|
||||
"database": "MyChinook",
|
||||
"designerId": "Invoice-609cb9b0-dedc-11ef-acf9-b7e3c0869b02",
|
||||
"left": 279,
|
||||
"top": 112,
|
||||
"alias": null
|
||||
}
|
||||
],
|
||||
"references": [
|
||||
{
|
||||
"designerId": "undefined-609cb9b1-dedc-11ef-acf9-b7e3c0869b02",
|
||||
"sourceId": "Invoice-609cb9b0-dedc-11ef-acf9-b7e3c0869b02",
|
||||
"targetId": "5d82f690-dedc-11ef-acf9-b7e3c0869b02",
|
||||
"joinType": "INNER JOIN",
|
||||
"columns": [
|
||||
{
|
||||
"source": "CustomerId",
|
||||
"target": "CustomerId"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"designerId": "undefined-61eb32b0-dedc-11ef-acf9-b7e3c0869b02",
|
||||
"sourceId": "InvoiceLine-61eb0ba0-dedc-11ef-acf9-b7e3c0869b02",
|
||||
"targetId": "Invoice-609cb9b0-dedc-11ef-acf9-b7e3c0869b02",
|
||||
"joinType": "LEFT JOIN",
|
||||
"columns": [
|
||||
{
|
||||
"source": "InvoiceId",
|
||||
"target": "InvoiceId"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"columns": [
|
||||
{
|
||||
"designerId": "5d82f690-dedc-11ef-acf9-b7e3c0869b02",
|
||||
"columnName": "LastName",
|
||||
"isOutput": true,
|
||||
"filter": "NOT NULL",
|
||||
"sortOrder": 1
|
||||
},
|
||||
{
|
||||
"designerId": "5d82f690-dedc-11ef-acf9-b7e3c0869b02",
|
||||
"columnName": "FirstName",
|
||||
"isOutput": true,
|
||||
"sortOrder": 2
|
||||
},
|
||||
{
|
||||
"designerId": "Invoice-609cb9b0-dedc-11ef-acf9-b7e3c0869b02",
|
||||
"columnName": "InvoiceDate",
|
||||
"isOutput": true
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -22,6 +22,12 @@ function clearTestingData() {
|
||||
if (fs.existsSync(path.join(baseDir, 'connections-e2etests.jsonl'))) {
|
||||
fs.unlinkSync(path.join(baseDir, 'connections-e2etests.jsonl'));
|
||||
}
|
||||
if (fs.existsSync(path.join(baseDir, 'files-e2etests'))) {
|
||||
fs.rmdirSync(path.join(baseDir, 'files-e2etests'), { recursive: true });
|
||||
}
|
||||
if (fs.existsSync(path.join(baseDir, 'archive-e2etests'))) {
|
||||
fs.rmdirSync(path.join(baseDir, 'archive-e2etests'), { recursive: true });
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
const path = require('path');
|
||||
const fs = require('fs');
|
||||
const os = require('os');
|
||||
|
||||
const dbgateApi = require('dbgate-api');
|
||||
dbgateApi.initializeApiEnvironment();
|
||||
@@ -164,6 +165,17 @@ async function initRedisDatabase(inputDirectory) {
|
||||
// });
|
||||
}
|
||||
|
||||
const baseDir = path.join(os.homedir(), '.dbgate');
|
||||
|
||||
async function copyFolder(source, target) {
|
||||
if (!fs.existsSync(target)) {
|
||||
fs.mkdirSync(target, { recursive: true });
|
||||
}
|
||||
for (const file of fs.readdirSync(source)) {
|
||||
fs.copyFileSync(path.join(source, file), path.join(target, file));
|
||||
}
|
||||
}
|
||||
|
||||
async function run() {
|
||||
await initMySqlDatabase('MyChinook', path.resolve(path.join(__dirname, '../data/chinook-mysql.sql')));
|
||||
// await initMySqlDatabase('Northwind', path.resolve(path.join(__dirname, '../data/northwind-mysql.sql')));
|
||||
@@ -171,9 +183,29 @@ async function run() {
|
||||
|
||||
await initPostgresDatabase('PgChinook', path.resolve(path.join(__dirname, '../data/chinook-postgres.sql')));
|
||||
|
||||
await initMongoDatabase('MgChinook', path.resolve(path.join(__dirname, '../data/mongo')));
|
||||
await initMongoDatabase('MgChinook', path.resolve(path.join(__dirname, '../data/chinook-jsonl')));
|
||||
|
||||
await initRedisDatabase(path.resolve(path.join(__dirname, '../data/redis')));
|
||||
|
||||
await copyFolder(
|
||||
path.resolve(path.join(__dirname, '../data/chinook-jsonl')),
|
||||
path.join(baseDir, 'archive-e2etests', 'default')
|
||||
);
|
||||
|
||||
await copyFolder(
|
||||
path.resolve(path.join(__dirname, '../data/files/query')),
|
||||
path.join(baseDir, 'files-e2etests', 'query')
|
||||
);
|
||||
|
||||
await copyFolder(
|
||||
path.resolve(path.join(__dirname, '../data/files/diagrams')),
|
||||
path.join(baseDir, 'files-e2etests', 'diagrams')
|
||||
);
|
||||
|
||||
await copyFolder(
|
||||
path.resolve(path.join(__dirname, '../data/files/charts')),
|
||||
path.join(baseDir, 'files-e2etests', 'charts')
|
||||
);
|
||||
}
|
||||
|
||||
dbgateApi.runScript(run);
|
||||
|
||||
@@ -14,18 +14,16 @@
|
||||
},
|
||||
"scripts": {
|
||||
"cy:open": "cypress open --config experimentalInteractiveRunEvents=true",
|
||||
|
||||
"cy:run:add-connection": "cypress run --spec cypress/e2e/add-connection.cy.js",
|
||||
"cy:run:portal": "cypress run --spec cypress/e2e/portal.cy.js",
|
||||
"cy:run:oauth": "cypress run --spec cypress/e2e/oauth.cy.js",
|
||||
"cy:run:browse-data": "cypress run --spec cypress/e2e/browse-data.cy.js",
|
||||
|
||||
"start:add-connection": "cd .. && node packer/build/bundle.js --listen-api --run-e2e-tests",
|
||||
"start:portal": "cd .. && env-cmd -f e2e-tests/env/portal/.env node e2e-tests/init/portal.js && env-cmd -f e2e-tests/env/portal/.env node packer/build/bundle.js --listen-api --run-e2e-tests",
|
||||
"start:oauth": "cd .. && env-cmd -f e2e-tests/env/oauth/.env node packer/build/bundle.js --listen-api --run-e2e-tests",
|
||||
"start:browse-data": "cd .. && env-cmd -f e2e-tests/env/browse-data/.env node e2e-tests/init/browse-data.js && env-cmd -f e2e-tests/env/browse-data/.env node packer/build/bundle.js --listen-api --run-e2e-tests",
|
||||
|
||||
"test": "start-server-and-test start:add-connection http://localhost:3000 cy:run:add-connection && start-server-and-test start:portal http://localhost:3000 cy:run:portal && start-server-and-test start:oauth http://localhost:3000 cy:run:oauth && start-server-and-test start:browse-data http://localhost:3000 cy:run:browse-data",
|
||||
"test:ci": "yarn test"
|
||||
}
|
||||
},
|
||||
"dependencies": {}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user