(core) port test/home tests

Summary:
This ports the useful parts of the test/home tests to test/nbrowser (a chunk of the DocMenu tests were already covered).

I ripped out a chunk of test/browser code that is now no longer used.

I made a few changes to unrelated tests that happened to fail.

Test Plan: ported tests

Reviewers: georgegevoian

Reviewed By: georgegevoian

Differential Revision: https://phab.getgrist.com/D3888
This commit is contained in:
Paul Fitzpatrick
2023-05-02 12:19:45 -04:00
parent 5f9f4868ae
commit 8810aa3bd3
4 changed files with 10 additions and 24 deletions

View File

@@ -4,11 +4,10 @@
import FormData from 'form-data';
import * as fse from 'fs-extra';
import defaults = require('lodash/defaults');
import {WebElement} from 'mocha-webdriver';
import {Key, WebDriver, WebElement} from 'mocha-webdriver';
import fetch from 'node-fetch';
import {authenticator} from 'otplib';
import * as path from 'path';
import { Key, WebDriver } from 'selenium-webdriver';
import {UserProfile} from 'app/common/LoginSessionAPI';
import {BehavioralPrompt, UserPrefs, WelcomePopup} from 'app/common/Prefs';

View File

@@ -273,6 +273,11 @@ export class TestServerMerged implements IMochaServer {
* Returns the path to the database.
*/
private _getDatabaseFile(): string {
if (process.env.TYPEORM_TYPE === 'postgres') {
const db = process.env.TYPEORM_DATABASE;
if (!db) { throw new Error("Missing TYPEORM_DATABASE"); }
return db;
}
return path.join(this.testDir, 'landing.db');
}
}