gristlabs_grist-core/test/nbrowser/Smoke.ts
George Gevoian fa68b790bb (core) Remove code for unused welcome flows
Summary: Removes code that was marked for removal.

Test Plan: Existing tests still pass.

Reviewers: paulfitz

Reviewed By: paulfitz

Differential Revision: https://phab.getgrist.com/D3289
2022-02-28 13:21:28 -08:00

44 lines
1.2 KiB
TypeScript

/**
*
* This is a minimal test to make sure documents can be created, edited, and
* reopened. Grist has a very extensive test set that has not yet been ported
* to the grist-core.
*
*/
import { assert, driver } from 'mocha-webdriver';
import { server, setupTestSuite } from 'test/nbrowser/testUtils';
import * as gu from 'test/nbrowser/gristUtils';
async function openMainPage() {
await driver.get(`${server.getHost()}`);
while (true) { // eslint-disable-line no-constant-condition
try {
if (await driver.findContent('button', /Create Empty Document/).isPresent()) {
return;
}
} catch (e) {
// don't worry about transients.
}
await driver.sleep(10);
}
}
describe("Smoke", function() {
this.timeout(20000);
setupTestSuite();
it('can create, edit, and reopen a document', async function() {
this.timeout(20000);
await openMainPage();
await driver.findContent('button', /Create Empty Document/).click();
await gu.waitForDocToLoad(20000);
await gu.dismissWelcomeTourIfNeeded();
await gu.getCell('A', 1).click();
await gu.enterCell('123');
await driver.navigate().refresh();
await gu.waitForDocToLoad();
assert.equal(await gu.getCell('A', 1).getText(), '123');
});
});