mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-17 23:45:59 +00:00
query fmt func
This commit is contained in:
@@ -28,12 +28,33 @@ describe('Team edition tests', () => {
|
||||
cy.themeshot('authadmin');
|
||||
});
|
||||
|
||||
// it('OAuth authentication', () => {
|
||||
// cy.testid('AdminMenuWidget_itemAuthentication').click();
|
||||
// cy.contains('Add authentication').click();
|
||||
// cy.contains('Use database login').click();
|
||||
// cy.contains('Add authentication').click();
|
||||
// cy.contains('OAuth 2.0').click();
|
||||
// cy.themeshot('authadmin');
|
||||
// });
|
||||
it.only('OAuth authentication', () => {
|
||||
cy.testid('LoginPage_linkAdmin').click();
|
||||
cy.testid('LoginPage_password').type('adminpwd');
|
||||
cy.testid('LoginPage_submitLogin').click();
|
||||
cy.testid('AdminMenuWidget_itemAuthentication').click();
|
||||
// cy.testid('AdminAuthForm_disableButton_local').click();
|
||||
// cy.testid('AdminAuthForm_disableButton_none').click();
|
||||
cy.contains('Add authentication').click();
|
||||
cy.contains('OAuth 2.0').click();
|
||||
cy.testid('AdminAuthForm_oauthAuth_oauth').type('http://localhost:16009/dex/auth');
|
||||
cy.testid('AdminAuthForm_oauthToken_oauth').type('http://localhost:16009/dex/token');
|
||||
cy.testid('AdminAuthForm_oauthScope_oauth').type('openid');
|
||||
cy.testid('AdminAuthForm_oauthClient_oauth').type('my-app');
|
||||
cy.testid('AdminAuthForm_oauthClientSecret_oauth').type('my-secret');
|
||||
cy.testid('AdminAuthForm_oauthLoginField_oauth').type('username');
|
||||
cy.contains('Save').click();
|
||||
cy.testid('WidgetIconPanel_menu').click();
|
||||
cy.contains('File').click();
|
||||
cy.contains('Logout').click();
|
||||
cy.testid('LoginPage_linkRegularUser').click();
|
||||
cy.testid('LoginPage_loginButton_OAuth 2.0').click();
|
||||
|
||||
// login on DEX
|
||||
cy.get('#login').clear().type('test@example.com');
|
||||
cy.get('#password').clear().type('test');
|
||||
cy.get('#submit-login').click();
|
||||
// test - user is logged in
|
||||
cy.get('Database not selected');
|
||||
});
|
||||
});
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
"start:api:storage": "yarn workspace dbgate-api start:storage | pino-pretty",
|
||||
"start:api:storage:built": "yarn workspace dbgate-api start:storage:built | pino-pretty",
|
||||
"start:api:azure": "yarn workspace dbgate-api start:azure | pino-pretty",
|
||||
"start:api:e2e:team": "yarn workspace dbgate-api start:e2e:team | pino-pretty",
|
||||
"sync:pro": "cd sync && yarn start",
|
||||
"start:web": "yarn workspace dbgate-web dev",
|
||||
"start:sqltree": "yarn workspace dbgate-sqltree start",
|
||||
|
||||
@@ -75,6 +75,7 @@
|
||||
"start:storage:built": "env-cmd -f env/storage/.env cross-env DEVMODE= BUILTWEBMODE=1 node dist/bundle.js --listen-api",
|
||||
"start:singleconn": "env-cmd node src/index.js --server localhost --user root --port 3307 --engine mysql@dbgate-plugin-mysql --password test --listen-api",
|
||||
"start:azure": "env-cmd -f env/azure/.env node src/index.js --listen-api",
|
||||
"start:e2e:team": "cross-env DEVWEB=1 DEVMODE=1 env-cmd -f ../../e2e-tests/env/team/.env node src/index.js --listen-api",
|
||||
"ts": "tsc",
|
||||
"build": "webpack",
|
||||
"build:doc": "jsdoc2md --template doctpl.hbs ./src/shell/* > ../../../dbgate.github.io/_docs/apidoc.md"
|
||||
|
||||
@@ -63,6 +63,12 @@ export function formatQueryWithoutParams(driver: EngineDriver, sql: string) {
|
||||
return dmp.s;
|
||||
}
|
||||
|
||||
export async function runQueryFmt(driver, conn, query, ...args) {
|
||||
const dmp = driver.createDumper();
|
||||
dmp.put(query, ...args);
|
||||
await driver.query(conn, dmp.s);
|
||||
}
|
||||
|
||||
export const driverBase = {
|
||||
analyserClass: null,
|
||||
dumperClass: SqlDumper,
|
||||
|
||||
Reference in New Issue
Block a user