mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-18 03:16:01 +00:00
SYNC: mutli-sql tests
This commit is contained in:
committed by
Diflow
parent
5b246fe44c
commit
afcb226111
@@ -1,3 +1,5 @@
|
||||
const localconfig = require('../../.localconfig');
|
||||
|
||||
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'")) {
|
||||
@@ -13,8 +15,18 @@ beforeEach(() => {
|
||||
});
|
||||
|
||||
function multiTest(testName, testDefinition) {
|
||||
it(testName + ' MySQL', () => testDefinition('MySql-connection'));
|
||||
it(testName + ' Postgres', () => testDefinition('Postgres-connection'));
|
||||
if (localconfig.mysql) {
|
||||
it(testName + ' MySQL', () => testDefinition('MySql-connection'));
|
||||
}
|
||||
if (localconfig.postgres) {
|
||||
it(testName + ' Postgres', () => testDefinition('Postgres-connection'));
|
||||
}
|
||||
if (localconfig.mssql) {
|
||||
it(testName + ' Mssql', () => testDefinition('Mssql-connection'));
|
||||
}
|
||||
if (localconfig.oracle) {
|
||||
it(testName + ' Oracle', () => testDefinition('Oracle-connection'));
|
||||
}
|
||||
}
|
||||
|
||||
describe('Mutli-sql tests', () => {
|
||||
@@ -24,19 +36,31 @@ describe('Mutli-sql tests', () => {
|
||||
cy.testid('TabsPanel_buttonNewQuery').click();
|
||||
cy.wait(1000);
|
||||
cy.get('body').type("INSERT INTO categories (category_id, category_name) VALUES (5, 'test');");
|
||||
|
||||
// rollback
|
||||
cy.testid('QueryTab_beginTransactionButton').click();
|
||||
cy.contains('Query execution finished');
|
||||
cy.testid('QueryTab_executeButton').click();
|
||||
cy.contains('Query execution finished');
|
||||
cy.testid('QueryTab_rollbackTransactionButton').click();
|
||||
cy.contains('Query execution finished');
|
||||
|
||||
// should contain 4 rows
|
||||
cy.testid('SqlObjectList_container').contains('categories').click();
|
||||
cy.contains('Guitars').click();
|
||||
cy.testid('TableDataTab_refreshGrid').click();
|
||||
cy.contains('Rows: 4');
|
||||
|
||||
// commit
|
||||
cy.contains('Query #1').click();
|
||||
cy.testid('QueryTab_beginTransactionButton').click();
|
||||
cy.contains('Query execution finished');
|
||||
cy.testid('QueryTab_executeButton').click();
|
||||
cy.contains('Query execution finished');
|
||||
cy.testid('QueryTab_commitTransactionButton').click();
|
||||
cy.contains('Query execution finished');
|
||||
|
||||
// should contain 5 rows
|
||||
cy.testid('SqlObjectList_container').contains('categories').click();
|
||||
cy.contains('Guitars').click();
|
||||
cy.testid('TableDataTab_refreshGrid').click();
|
||||
|
||||
Reference in New Issue
Block a user