Added playwright tests. (#6212)

* Added playwright tests.

* Added clear authorship color.

* Ported enter ts.

* Ported more tests.

* Commented helper tests.

* Fixed admin tests.

* Fixed.

* Fixed admin pages not there.

* Fixed waiting.

* Upload playwright report.

* Remove saucelabs

* Fixed waiting.

* Fixed upload artifact.

* Also install deps.

* Added retry mechanism.

* Added timeout for restart etherpad server.

* Fixed tests.

* Added frontend playwright tests.
This commit is contained in:
SamTV12345 2024-03-10 23:18:50 +01:00 committed by GitHub
parent db46ffb63b
commit c2699e4528
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
40 changed files with 1568 additions and 1285 deletions

View file

@ -1,6 +1,7 @@
'use strict';
import {ArgsExpressType} from "../../types/ArgsExpressType";
import path from "path";
import fs from "fs";
const settings = require('ep_etherpad-lite/node/utils/Settings');
const ADMIN_PATH = path.join(settings.root, 'src', 'templates', 'admin');
@ -16,7 +17,13 @@ exports.expressCreateServer = (hookName:string, args: ArgsExpressType, cb:Functi
args.app.get('/admin/*', (req:any, res:any, next:Function) => {
if (req.path.includes('.')) {
const relativPath = req.path.split('/admin/')[1];
res.sendFile(path.join(ADMIN_PATH, relativPath));
try {
if (fs.statSync(path.join(ADMIN_PATH, relativPath)).isFile()) {
res.sendFile(path.join(ADMIN_PATH, relativPath));
}
} catch (err) {
res.status(404).send('404: Not Found');
}
} else {
res.header('Cache-Control', 'private, no-cache, no-store, must-revalidate');
res.header('Expires', '-1');