mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-17 22:36:01 +00:00
UI tests
This commit is contained in:
2
.github/workflows/e2e-tests.yaml
vendored
2
.github/workflows/e2e-tests.yaml
vendored
@@ -33,8 +33,6 @@ jobs:
|
||||
run: |
|
||||
cd e2e-tests
|
||||
yarn ci
|
||||
env:
|
||||
CI: true
|
||||
|
||||
services:
|
||||
mysql:
|
||||
|
||||
26
common/clearDataWithBackup.js
Normal file
26
common/clearDataWithBackup.js
Normal file
@@ -0,0 +1,26 @@
|
||||
const path = require('path');
|
||||
const os = require('os');
|
||||
const fs = require('fs');
|
||||
|
||||
const baseDir = path.join(os.homedir(), '.dbgate');
|
||||
|
||||
function createTimeStamp() {
|
||||
const now = new Date();
|
||||
const year = now.getFullYear();
|
||||
const month = String(now.getMonth() + 1).padStart(2, '0'); // měsíc je 0-indexovaný
|
||||
const day = String(now.getDate()).padStart(2, '0');
|
||||
const hours = String(now.getHours()).padStart(2, '0');
|
||||
const minutes = String(now.getMinutes()).padStart(2, '0');
|
||||
const seconds = String(now.getSeconds()).padStart(2, '0');
|
||||
|
||||
// Poskládáme datum a čas do názvu souboru
|
||||
const ts = `${year}-${month}-${day}_${hours}-${minutes}-${seconds}`;
|
||||
return ts;
|
||||
}
|
||||
|
||||
if (fs.existsSync(path.join(baseDir, 'connections.jsonl'))) {
|
||||
fs.renameSync(
|
||||
path.join(baseDir, 'connections.jsonl'),
|
||||
path.join(baseDir, `connections-${createTimeStamp()}.jsonl.bak`)
|
||||
);
|
||||
}
|
||||
@@ -4,14 +4,16 @@
|
||||
"main": "index.js",
|
||||
"license": "GPL",
|
||||
"devDependencies": {
|
||||
"cross-env": "^7.0.3",
|
||||
"cypress": "^13.16.1",
|
||||
"start-server-and-test": "^2.0.8"
|
||||
},
|
||||
"scripts": {
|
||||
"cy:open": "cypress open",
|
||||
"cy:run": "cypress run",
|
||||
"start": "cd .. && node packer/build/bundle.js --listen-api --run-packer-build",
|
||||
"test": "yarn cy:run",
|
||||
"ci": "start-server-and-test http://localhost:3000"
|
||||
"start:ci": "cd .. && cross-env CI=true node packer/build/bundle.js --listen-api --run-packer-build",
|
||||
"start:local": "cd .. && node common/clearDataWithBackup.js && cross-env CI=true node packer/build/bundle.js --listen-api --run-packer-build",
|
||||
"test:ci": "start-server-and-test start:ci http://localhost:3000 cy:run",
|
||||
"test:local": "start-server-and-test start:local http://localhost:3000 cy:run"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -334,7 +334,14 @@ core-util-is@1.0.2:
|
||||
resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7"
|
||||
integrity sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ==
|
||||
|
||||
cross-spawn@^7.0.0, cross-spawn@^7.0.3:
|
||||
cross-env@^7.0.3:
|
||||
version "7.0.3"
|
||||
resolved "https://registry.yarnpkg.com/cross-env/-/cross-env-7.0.3.tgz#865264b29677dc015ba8418918965dd232fc54cf"
|
||||
integrity sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw==
|
||||
dependencies:
|
||||
cross-spawn "^7.0.1"
|
||||
|
||||
cross-spawn@^7.0.0, cross-spawn@^7.0.1, cross-spawn@^7.0.3:
|
||||
version "7.0.6"
|
||||
resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.6.tgz#8a58fe78f00dcd70c370451759dfbfaf03e8ee9f"
|
||||
integrity sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==
|
||||
|
||||
Reference in New Issue
Block a user