mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-18 18:26:00 +00:00
add connection test
This commit is contained in:
@@ -20,6 +20,12 @@ describe('Add connection', () => {
|
||||
cy.get('[data-testid=ConnectionDriverFields_port]').clear().type('16004');
|
||||
}
|
||||
cy.get('[data-testid=ConnectionDriverFields_displayName]').clear().type('test-mysql-1');
|
||||
|
||||
// test connection
|
||||
cy.get('[data-testid=ConnectionTab_buttonTest]').click();
|
||||
cy.contains('Connected:');
|
||||
|
||||
// save and connect
|
||||
cy.get('[data-testid=ConnectionTab_buttonSave]').click();
|
||||
cy.get('[data-testid=ConnectionTab_buttonConnect]').click();
|
||||
cy.contains('performance_schema');
|
||||
@@ -76,7 +82,7 @@ describe('Add connection', () => {
|
||||
cy.get('[data-testid=ConnectionTab_tabSshTunnel]').click();
|
||||
cy.get('[data-testid=ConnectionSshTunnelFields_useSshTunnel]').check();
|
||||
cy.get('[data-testid=ConnectionSshTunnelFields_sshMode]').select('Key file');
|
||||
cy.get('[data-testid=ConnectionSshTunnelFields_sshLogin]').clear()
|
||||
cy.get('[data-testid=ConnectionSshTunnelFields_sshLogin]').clear();
|
||||
cy.get('[data-testid=ConnectionSshTunnelFields_sshLogin]').type('root');
|
||||
cy.get('[data-testid=ConnectionSshTunnelFields_sshKeyfile]')
|
||||
.clear()
|
||||
@@ -91,8 +97,36 @@ describe('Add connection', () => {
|
||||
cy.contains('performance_schema');
|
||||
});
|
||||
|
||||
// it('import chinook DB', () => {
|
||||
// cy.visit('http://localhost:3000');
|
||||
// cy.get('[data-testid=ConnectionTab_buttonConnect]').click();
|
||||
// });
|
||||
it('ask password - mysql', () => {
|
||||
const runOnCI = Cypress.env('runOnCI');
|
||||
|
||||
cy.visit('http://localhost:3000');
|
||||
// cy.get('[data-testid=ConnectionList_buttonNewConnection]').click();
|
||||
cy.get('[data-testid=ConnectionDriverFields_connectionType]').select('MySQL');
|
||||
cy.get('[data-testid=ConnectionDriverFields_user]').clear().type('root');
|
||||
cy.get('[data-testid=ConnectionDriverFields_password]').clear().type('Pwd2020Db');
|
||||
if (runOnCI) {
|
||||
cy.get('[data-testid=ConnectionDriverFields_server]').clear().type('mysql');
|
||||
} else {
|
||||
cy.get('[data-testid=ConnectionDriverFields_port]').clear().type('16004');
|
||||
}
|
||||
cy.get('[data-testid=ConnectionDriverFields_displayName]').clear().type('test-mysql-2');
|
||||
cy.testid('ConnectionDriverFields_passwordMode').select('askPassword');
|
||||
|
||||
// test connection
|
||||
cy.get('[data-testid=ConnectionTab_buttonTest]').click();
|
||||
cy.testid('DatabaseLoginModal_password').clear().type('Pwd2020Db');
|
||||
cy.testid('DatabaseLoginModal_connect').click();
|
||||
|
||||
cy.contains('Connected:');
|
||||
|
||||
cy.get('[data-testid=ConnectionTab_buttonSave]').click();
|
||||
cy.get('[data-testid=ConnectionTab_buttonConnect]').click();
|
||||
|
||||
// again type DB password - not saved
|
||||
cy.testid('DatabaseLoginModal_password').clear().type('Pwd2020Db');
|
||||
cy.testid('DatabaseLoginModal_connect').click();
|
||||
|
||||
cy.contains('performance_schema');
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user