mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-14 03:43:50 +00:00
V2 e2e playwright (#343)
* test: create utility for uploading test-db * chore: upgrade deps * refactor: remove unused functions * chore: create testing boilerplate * test: upload showfile
This commit is contained in:
@@ -213,13 +213,13 @@ export const shutdown = async (exitCode = 0) => {
|
||||
|
||||
process.on('exit', (code) => console.log(`Ontime exited with code: ${code}`));
|
||||
|
||||
process.on('unhandledRejection', async () => {
|
||||
logger.error('SERVER', 'Error: unhandled rejection');
|
||||
process.on('unhandledRejection', async (error) => {
|
||||
logger.error('SERVER', `Error: unhandled rejection ${error}`);
|
||||
await shutdown(1);
|
||||
});
|
||||
|
||||
process.on('uncaughtException', async () => {
|
||||
logger.error('SERVER', 'Error: uncaught exception');
|
||||
process.on('uncaughtException', async (error) => {
|
||||
logger.error('SERVER', `Error: uncaught exception ${error}`);
|
||||
await shutdown(1);
|
||||
});
|
||||
|
||||
|
||||
@@ -288,13 +288,3 @@ export const dbUpload = async (req, res) => {
|
||||
const file = req.file.path;
|
||||
await uploadAndParse(file, req, res, options);
|
||||
};
|
||||
|
||||
// Create controller for POST request to '/ontime/dbpath'
|
||||
// Returns -
|
||||
export const dbPathToUpload = async (req, res) => {
|
||||
if (!req.body.path) {
|
||||
res.status(400).send({ message: 'Path to file not found' });
|
||||
return;
|
||||
}
|
||||
await uploadAndParse(req.body.path, req, res);
|
||||
};
|
||||
|
||||
@@ -2,7 +2,6 @@ import express from 'express';
|
||||
import { uploadFile } from '../utils/upload.js';
|
||||
import {
|
||||
dbDownload,
|
||||
dbPathToUpload,
|
||||
dbUpload,
|
||||
getAliases,
|
||||
getInfo,
|
||||
@@ -19,11 +18,11 @@ import {
|
||||
} from '../controllers/ontimeController.js';
|
||||
|
||||
import {
|
||||
viewValidator,
|
||||
validateAliases,
|
||||
validateUserFields,
|
||||
validateSettings,
|
||||
validateOSC,
|
||||
validateSettings,
|
||||
validateUserFields,
|
||||
viewValidator,
|
||||
} from '../controllers/ontimeController.validate.js';
|
||||
|
||||
export const router = express.Router();
|
||||
@@ -69,6 +68,3 @@ router.get('/osc', getOSC);
|
||||
|
||||
// create route between controller and '/ontime/osc' endpoint
|
||||
router.post('/osc', validateOSC, postOSC);
|
||||
|
||||
// create route between controller and '/ontime/dbpath' endpoint
|
||||
router.post('/dbpath', dbPathToUpload);
|
||||
|
||||
@@ -0,0 +1,90 @@
|
||||
{
|
||||
"rundown": [],
|
||||
"eventData": {
|
||||
"title": "All about Carlos demo event",
|
||||
"publicUrl": "www.getontime.no",
|
||||
"publicInfo": "WiFi: demoproject \nPassword: ontimeproject",
|
||||
"backstageUrl": "www.getontime.no",
|
||||
"backstageInfo": "WiFi: demobackstage\nPassword: ontimeproject",
|
||||
"endMessage": ""
|
||||
},
|
||||
"settings": {
|
||||
"app": "ontime",
|
||||
"version": 2,
|
||||
"serverPort": 4001,
|
||||
"lock": null,
|
||||
"pinCode": "1234",
|
||||
"timeFormat": "24"
|
||||
},
|
||||
"viewSettings": {
|
||||
"overrideStyles": false
|
||||
},
|
||||
"aliases": [
|
||||
{
|
||||
"id": "0b0b3",
|
||||
"enabled": true,
|
||||
"alias": "test",
|
||||
"pathAndParams": "lower?bg=ff2&text=f00&size=0.6&transition=5"
|
||||
}
|
||||
],
|
||||
"userFields": {
|
||||
"user0": "user0",
|
||||
"user1": "user1",
|
||||
"user2": "user2",
|
||||
"user3": "user3",
|
||||
"user4": "user4",
|
||||
"user5": "user5",
|
||||
"user6": "user6",
|
||||
"user7": "user7",
|
||||
"user8": "user8",
|
||||
"user9": "user9"
|
||||
},
|
||||
"osc": {
|
||||
"portIn": 8888,
|
||||
"portOut": 9999,
|
||||
"targetIP": "127.0.0.1",
|
||||
"enabledIn": false,
|
||||
"enabledOut": false,
|
||||
"subscriptions": {
|
||||
"onLoad": [],
|
||||
"onStart": [],
|
||||
"onPause": [],
|
||||
"onStop": [],
|
||||
"onUpdate": [],
|
||||
"onFinish": []
|
||||
}
|
||||
},
|
||||
"http": {
|
||||
"http": {
|
||||
"user": null,
|
||||
"pwd": null,
|
||||
"messages": {
|
||||
"onLoad": {
|
||||
"url": "",
|
||||
"enabled": false
|
||||
},
|
||||
"onStart": {
|
||||
"url": "",
|
||||
"enabled": false
|
||||
},
|
||||
"onUpdate": {
|
||||
"url": "",
|
||||
"enabled": false
|
||||
},
|
||||
"onPause": {
|
||||
"url": "",
|
||||
"enabled": false
|
||||
},
|
||||
"onStop": {
|
||||
"url": "",
|
||||
"enabled": false
|
||||
},
|
||||
"onFinish": {
|
||||
"url": "",
|
||||
"enabled": false
|
||||
}
|
||||
},
|
||||
"enabled": true
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user