mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
make a /boot/GRIST_BOOT_KEY page for diagnosing configuration problems (#850)
This is a start at a page for diagnosing problems while setting up Grist. Starting to add some diagnostics based on feedback in github issues. We should make Grist installation easier! But when there is a problem it should be easier to diagnose than it is now, and this may help. The page is ugly and doesn't have many diagnostics yet, but we can iterate. Visit `/boot` on a Grist server for tips on how to use this feature.
This commit is contained in:
52
test/nbrowser/Boot.ts
Normal file
52
test/nbrowser/Boot.ts
Normal file
@@ -0,0 +1,52 @@
|
||||
import {assert, driver} from 'mocha-webdriver';
|
||||
import * as gu from 'test/nbrowser/gristUtils';
|
||||
import {server, setupTestSuite} from 'test/nbrowser/testUtils';
|
||||
import * as testUtils from 'test/server/testUtils';
|
||||
|
||||
describe('Boot', function() {
|
||||
this.timeout(30000);
|
||||
setupTestSuite();
|
||||
|
||||
let oldEnv: testUtils.EnvironmentSnapshot;
|
||||
|
||||
afterEach(() => gu.checkForErrors());
|
||||
|
||||
async function hasPrompt() {
|
||||
assert.include(
|
||||
await driver.findContentWait('p', /diagnostics page/, 2000).getText(),
|
||||
'A diagnostics page can be made available');
|
||||
}
|
||||
|
||||
it('gives prompt about how to enable boot page', async function() {
|
||||
await driver.get(`${server.getHost()}/boot`);
|
||||
await hasPrompt();
|
||||
});
|
||||
|
||||
describe('with a GRIST_BOOT_KEY', function() {
|
||||
before(async function() {
|
||||
oldEnv = new testUtils.EnvironmentSnapshot();
|
||||
process.env.GRIST_BOOT_KEY = 'lala';
|
||||
await server.restart();
|
||||
});
|
||||
|
||||
after(async function() {
|
||||
oldEnv.restore();
|
||||
await server.restart();
|
||||
});
|
||||
|
||||
it('gives prompt when key is missing', async function() {
|
||||
await driver.get(`${server.getHost()}/boot`);
|
||||
await hasPrompt();
|
||||
});
|
||||
|
||||
it('gives prompt when key is wrong', async function() {
|
||||
await driver.get(`${server.getHost()}/boot/bilbo`);
|
||||
await hasPrompt();
|
||||
});
|
||||
|
||||
it('gives page when key is right', async function() {
|
||||
await driver.get(`${server.getHost()}/boot/lala`);
|
||||
await driver.findContentWait('h2', /Grist is reachable/, 2000);
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user