mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-29 16:53:58 +00:00
SYNC: fixed test
This commit is contained in:
committed by
Diflow
parent
bdd9dc8c9d
commit
d79f82e9b8
40
e2e-tests/cypress/e2e/multi-sql.cy.js
Normal file
40
e2e-tests/cypress/e2e/multi-sql.cy.js
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
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('Data browser data', () => {
|
||||||
|
it('Transaction', () => {
|
||||||
|
cy.contains('MySql-connection').click();
|
||||||
|
cy.contains('my_guitar_shop').click();
|
||||||
|
cy.testid('TabsPanel_buttonNewQuery').click();
|
||||||
|
cy.wait(1000);
|
||||||
|
cy.get('body').type("INSERT INTO categories (category_id, category_name) VALUES (5, 'test');");
|
||||||
|
cy.testid('QueryTab_beginTransactionButton').click();
|
||||||
|
cy.contains('Query execution finished');
|
||||||
|
cy.testid('QueryTab_executeButton').click();
|
||||||
|
cy.contains('Query execution finished');
|
||||||
|
|
||||||
|
cy.testid('SqlObjectList_container').contains('categories').click();
|
||||||
|
cy.contains('Guitars').click();
|
||||||
|
cy.testid('TableDataTab_refreshGrid').click();
|
||||||
|
cy.contains('Rows: 4');
|
||||||
|
|
||||||
|
cy.contains('Query #1').click();
|
||||||
|
cy.testid('QueryTab_commitTransactionButton').click();
|
||||||
|
cy.contains('Query execution finished');
|
||||||
|
cy.testid('SqlObjectList_container').contains('categories').click();
|
||||||
|
cy.contains('Guitars').click();
|
||||||
|
cy.testid('TableDataTab_refreshGrid').click();
|
||||||
|
cy.contains('Rows: 5');
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
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('Data browser data', () => {
|
|
||||||
});
|
|
||||||
@@ -21,7 +21,7 @@ async function createDb(connection, dropDbSql, createDbSql) {
|
|||||||
await dbgateApi.importDbFromFolder({
|
await dbgateApi.importDbFromFolder({
|
||||||
connection: {
|
connection: {
|
||||||
...connection,
|
...connection,
|
||||||
database: 'my_quitar_shop',
|
database: 'my_guitar_shop',
|
||||||
},
|
},
|
||||||
folder: path.resolve(path.join(__dirname, '../data/my-guitar-shop')),
|
folder: path.resolve(path.join(__dirname, '../data/my-guitar-shop')),
|
||||||
});
|
});
|
||||||
@@ -36,8 +36,8 @@ async function run() {
|
|||||||
port: process.env.PORT_postgres,
|
port: process.env.PORT_postgres,
|
||||||
engine: 'postgres@dbgate-plugin-postgres',
|
engine: 'postgres@dbgate-plugin-postgres',
|
||||||
},
|
},
|
||||||
'drop database if exists my_quitar_shop',
|
'drop database if exists my_guitar_shop',
|
||||||
'create database my_quitar_shop'
|
'create database my_guitar_shop'
|
||||||
);
|
);
|
||||||
|
|
||||||
await createDb(
|
await createDb(
|
||||||
@@ -48,8 +48,8 @@ async function run() {
|
|||||||
port: process.env.PORT_mysql,
|
port: process.env.PORT_mysql,
|
||||||
engine: 'mysql@dbgate-plugin-mysql',
|
engine: 'mysql@dbgate-plugin-mysql',
|
||||||
},
|
},
|
||||||
'drop database if exists my_quitar_shop',
|
'drop database if exists my_guitar_shop',
|
||||||
'create database my_quitar_shop'
|
'create database my_guitar_shop'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -36,7 +36,7 @@
|
|||||||
"test:team": "start-server-and-test start:team http://localhost:3000 cy:run:team",
|
"test:team": "start-server-and-test start:team http://localhost:3000 cy:run:team",
|
||||||
"test:multi-sql": "start-server-and-test start:multi-sql http://localhost:3000 cy:run:multi-sql",
|
"test:multi-sql": "start-server-and-test start:multi-sql http://localhost:3000 cy:run:multi-sql",
|
||||||
|
|
||||||
"test": "yarn test:add-connection && yarn test:portal && yarn test:oauth && yarn test:browse-data && yarn test:team && yaran test:multi-sql",
|
"test": "yarn test:add-connection && yarn test:portal && yarn test:oauth && yarn test:browse-data && yarn test:team && yarn test:multi-sql",
|
||||||
"test:ci": "yarn test"
|
"test:ci": "yarn test"
|
||||||
},
|
},
|
||||||
"dependencies": {}
|
"dependencies": {}
|
||||||
|
|||||||
@@ -309,6 +309,9 @@
|
|||||||
executeNumber++;
|
executeNumber++;
|
||||||
visibleResultTabs = true;
|
visibleResultTabs = true;
|
||||||
|
|
||||||
|
busy = true;
|
||||||
|
timerLabel.start();
|
||||||
|
|
||||||
let sesid = sessionId;
|
let sesid = sessionId;
|
||||||
if (!sesid) {
|
if (!sesid) {
|
||||||
const resp = await apiCall('sessions/create', {
|
const resp = await apiCall('sessions/create', {
|
||||||
@@ -318,8 +321,6 @@
|
|||||||
sesid = resp.sesid;
|
sesid = resp.sesid;
|
||||||
sessionId = sesid;
|
sessionId = sesid;
|
||||||
}
|
}
|
||||||
busy = true;
|
|
||||||
timerLabel.start();
|
|
||||||
await apiCall('sessions/execute-query', {
|
await apiCall('sessions/execute-query', {
|
||||||
sesid,
|
sesid,
|
||||||
sql,
|
sql,
|
||||||
|
|||||||
@@ -227,7 +227,12 @@
|
|||||||
{#if !filter}
|
{#if !filter}
|
||||||
<DropDownButton icon="icon plus-thick" menu={createAddMenu} />
|
<DropDownButton icon="icon plus-thick" menu={createAddMenu} />
|
||||||
{/if}
|
{/if}
|
||||||
<InlineButton on:click={handleRefreshDatabase} title="Refresh database connection and object list" square>
|
<InlineButton
|
||||||
|
on:click={handleRefreshDatabase}
|
||||||
|
title="Refresh database connection and object list"
|
||||||
|
square
|
||||||
|
data-testid="SqlObjectList_refreshButton"
|
||||||
|
>
|
||||||
<FontIcon icon="icon refresh" />
|
<FontIcon icon="icon refresh" />
|
||||||
</InlineButton>
|
</InlineButton>
|
||||||
</SearchBoxWrapper>
|
</SearchBoxWrapper>
|
||||||
@@ -245,7 +250,11 @@
|
|||||||
<FocusedConnectionInfoWidget {conid} {database} connection={$connection} />
|
<FocusedConnectionInfoWidget {conid} {database} connection={$connection} />
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
<WidgetsInnerContainer bind:this={domContainer} hideContent={differentFocusedDb}>
|
<WidgetsInnerContainer
|
||||||
|
bind:this={domContainer}
|
||||||
|
hideContent={differentFocusedDb}
|
||||||
|
data-testid="SqlObjectList_container"
|
||||||
|
>
|
||||||
{#if ($status && ($status.name == 'pending' || $status.name == 'checkStructure' || $status.name == 'loadStructure') && $objects) || !$objects}
|
{#if ($status && ($status.name == 'pending' || $status.name == 'checkStructure' || $status.name == 'loadStructure') && $objects) || !$objects}
|
||||||
<LoadingInfo message={$status?.feedback?.analysingMessage || 'Loading database structure'} />
|
<LoadingInfo message={$status?.feedback?.analysingMessage || 'Loading database structure'} />
|
||||||
{:else}
|
{:else}
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div on:drop bind:this={domDiv} class:hideContent><slot /></div>
|
<div on:drop bind:this={domDiv} class:hideContent data-testid={$$props['data-testid']}><slot /></div>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
div {
|
div {
|
||||||
|
|||||||
Reference in New Issue
Block a user