mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-05-01 00:23:57 +00:00
ssh connection test
This commit is contained in:
@@ -23,45 +23,36 @@ describe('Initialization', () => {
|
|||||||
cy.contains('performance_schema');
|
cy.contains('performance_schema');
|
||||||
});
|
});
|
||||||
|
|
||||||
// it('SSH connection', () => {
|
it('SSH connection', () => {
|
||||||
// const runOnCI = Cypress.env('runOnCI');
|
const runOnCI = Cypress.env('runOnCI');
|
||||||
|
|
||||||
// cy.get('body')
|
cy.visit('http://localhost:3000');
|
||||||
// .trigger('keydown', {
|
cy.contains('Connections');
|
||||||
// key: 'F1',
|
|
||||||
// code: 'F1',
|
|
||||||
// which: 112,
|
|
||||||
// keyCode: 112,
|
|
||||||
// bubbles: true,
|
|
||||||
// })
|
|
||||||
// .trigger('keyup', {
|
|
||||||
// key: 'F1',
|
|
||||||
// code: 'F1',
|
|
||||||
// which: 112,
|
|
||||||
// keyCode: 112,
|
|
||||||
// bubbles: true,
|
|
||||||
// });
|
|
||||||
// cy.get('body').type('Close all');
|
|
||||||
// cy.get('body').type('{enter}');
|
|
||||||
|
|
||||||
// cy.visit('http://localhost:3000');
|
cy.realPress("F1");
|
||||||
// cy.get('[data-testid=ConnectionList_buttonNewConnection]').click();
|
cy.realType("Close all");
|
||||||
// cy.get('[data-testid=ConnectionDriverFields_connectionType]').select('MySQL');
|
cy.realPress("Enter");
|
||||||
// cy.get('[data-testid=ConnectionDriverFields_user]').clear().type('root');
|
|
||||||
// cy.get('[data-testid=ConnectionDriverFields_password]').clear().type('root');
|
|
||||||
|
|
||||||
// cy.get('[data-testid=ConnectionSshTunnelFields_sshLogin]').clear().type('root');
|
cy.get('[data-testid=ConnectionList_buttonNewConnection]').click();
|
||||||
// cy.get('[data-testid=ConnectionSshTunnelFields_sshPassword]').clear().type('root');
|
cy.get('[data-testid=ConnectionDriverFields_connectionType]').select('MySQL');
|
||||||
// if (runOnCI) {
|
cy.get('[data-testid=ConnectionDriverFields_user]').clear().type('root');
|
||||||
// cy.get('[data-testid=ConnectionSshTunnelFields_sshHost]').clear().type('mysql-ssh');
|
cy.get('[data-testid=ConnectionDriverFields_password]').clear().type('root');
|
||||||
// } else {
|
|
||||||
// cy.get('[data-testid=ConnectionSshTunnelFields_sshPort]').clear().type('16006');
|
cy.get('[data-testid=ConnectionDriverFields_displayName]').clear().type('test-mysql-ssh-1');
|
||||||
// }
|
|
||||||
// cy.get('[data-testid=ConnectionDriverFields_displayName]').clear().type('test-mysql-ssh-1');
|
cy.get('[data-testid=ConnectionTab_tabSshTunnel]').click();
|
||||||
// cy.get('[data-testid=ConnectionTab_buttonSave]').click();
|
cy.get('[data-testid=ConnectionSshTunnelFields_useSshTunnel]').check();
|
||||||
// cy.get('[data-testid=ConnectionTab_buttonConnect]').click();
|
cy.get('[data-testid=ConnectionSshTunnelFields_sshLogin]').clear().type('root');
|
||||||
// cy.contains('performance_schema');
|
cy.get('[data-testid=ConnectionSshTunnelFields_sshPassword]').clear().type('root');
|
||||||
// });
|
if (runOnCI) {
|
||||||
|
cy.get('[data-testid=ConnectionSshTunnelFields_sshHost]').clear().type('mysql-ssh');
|
||||||
|
} else {
|
||||||
|
cy.get('[data-testid=ConnectionSshTunnelFields_sshPort]').clear().type('16006');
|
||||||
|
}
|
||||||
|
cy.get('[data-testid=ConnectionTab_buttonSave]').click();
|
||||||
|
cy.get('[data-testid=ConnectionTab_buttonConnect]').click();
|
||||||
|
cy.contains('performance_schema');
|
||||||
|
});
|
||||||
|
|
||||||
// it('import chinook DB', () => {
|
// it('import chinook DB', () => {
|
||||||
// cy.visit('http://localhost:3000');
|
// cy.visit('http://localhost:3000');
|
||||||
|
|||||||
@@ -17,4 +17,6 @@
|
|||||||
import './commands'
|
import './commands'
|
||||||
|
|
||||||
// Alternatively you can use CommonJS syntax:
|
// Alternatively you can use CommonJS syntax:
|
||||||
// require('./commands')
|
// require('./commands')
|
||||||
|
|
||||||
|
import "cypress-real-events";
|
||||||
@@ -7,6 +7,7 @@
|
|||||||
"axios": "^1.7.9",
|
"axios": "^1.7.9",
|
||||||
"cross-env": "^7.0.3",
|
"cross-env": "^7.0.3",
|
||||||
"cypress": "^13.16.1",
|
"cypress": "^13.16.1",
|
||||||
|
"cypress-real-events": "^1.13.0",
|
||||||
"kill-port": "^2.0.1",
|
"kill-port": "^2.0.1",
|
||||||
"start-server-and-test": "^2.0.8"
|
"start-server-and-test": "^2.0.8"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -350,6 +350,11 @@ cross-spawn@^7.0.0, cross-spawn@^7.0.1, cross-spawn@^7.0.3:
|
|||||||
shebang-command "^2.0.0"
|
shebang-command "^2.0.0"
|
||||||
which "^2.0.1"
|
which "^2.0.1"
|
||||||
|
|
||||||
|
cypress-real-events@^1.13.0:
|
||||||
|
version "1.13.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/cypress-real-events/-/cypress-real-events-1.13.0.tgz#6b7cd32dcac172db1493608f97a2576c7d0bd5af"
|
||||||
|
integrity sha512-LoejtK+dyZ1jaT8wGT5oASTPfsNV8/ClRp99ruN60oPj8cBJYod80iJDyNwfPAu4GCxTXOhhAv9FO65Hpwt6Hg==
|
||||||
|
|
||||||
cypress@^13.16.1:
|
cypress@^13.16.1:
|
||||||
version "13.16.1"
|
version "13.16.1"
|
||||||
resolved "https://registry.yarnpkg.com/cypress/-/cypress-13.16.1.tgz#82e776f6ad2037ccce6b6feabed768615c476258"
|
resolved "https://registry.yarnpkg.com/cypress/-/cypress-13.16.1.tgz#82e776f6ad2037ccce6b6feabed768615c476258"
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
slot?: number;
|
slot?: number;
|
||||||
component?: any;
|
component?: any;
|
||||||
props?: any;
|
props?: any;
|
||||||
|
testid?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export let tabs: TabDef[];
|
export let tabs: TabDef[];
|
||||||
@@ -27,7 +28,7 @@
|
|||||||
<div class="main" class:flex1>
|
<div class="main" class:flex1>
|
||||||
<div class="tabs">
|
<div class="tabs">
|
||||||
{#each _.compact(tabs) as tab, index}
|
{#each _.compact(tabs) as tab, index}
|
||||||
<div class="tab-item" class:selected={value == index} on:click={() => (value = index)}>
|
<div class="tab-item" class:selected={value == index} on:click={() => (value = index)} data-testid={tab.testid}>
|
||||||
<span class="ml-2">
|
<span class="ml-2">
|
||||||
{tab.label}
|
{tab.label}
|
||||||
</span>
|
</span>
|
||||||
|
|||||||
@@ -218,18 +218,22 @@
|
|||||||
label: 'General',
|
label: 'General',
|
||||||
component: ConnectionDriverFields,
|
component: ConnectionDriverFields,
|
||||||
props: { getDatabaseList, currentConnection },
|
props: { getDatabaseList, currentConnection },
|
||||||
|
testid: 'ConnectionTab_tabGeneral',
|
||||||
},
|
},
|
||||||
driver?.showConnectionTab('sshTunnel', $values) && {
|
driver?.showConnectionTab('sshTunnel', $values) && {
|
||||||
label: 'SSH Tunnel',
|
label: 'SSH Tunnel',
|
||||||
component: ConnectionSshTunnelFields,
|
component: ConnectionSshTunnelFields,
|
||||||
|
testid: 'ConnectionTab_tabSshTunnel',
|
||||||
},
|
},
|
||||||
driver?.showConnectionTab('ssl', $values) && {
|
driver?.showConnectionTab('ssl', $values) && {
|
||||||
label: 'SSL',
|
label: 'SSL',
|
||||||
component: ConnectionSslFields,
|
component: ConnectionSslFields,
|
||||||
|
testid: 'ConnectionTab_tabSsl',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'Advanced',
|
label: 'Advanced',
|
||||||
component: ConnectionAdvancedDriverFields,
|
component: ConnectionAdvancedDriverFields,
|
||||||
|
testid: 'ConnectionTab_tabAdvanced',
|
||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -100,5 +100,9 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
ORACLE_PASSWORD: Pwd2020Db
|
ORACLE_PASSWORD: Pwd2020Db
|
||||||
|
|
||||||
|
mysql-ssh:
|
||||||
|
build: ../../e2e-tests/mysql-ssh
|
||||||
|
|
||||||
|
|
||||||
# cockroachdb:
|
# cockroachdb:
|
||||||
# image: cockroachdb/cockroach
|
# image: cockroachdb/cockroach
|
||||||
|
|||||||
Reference in New Issue
Block a user