gristlabs_grist-core/test/nbrowser/Smoke.ts
George Gevoian da6c39aa50 (core) Add new home page cards
Summary:
New cards on the home page link to useful resources like the welcome
video, tutorial, webinars, and the Help Center. They are shown by
default to new and exisiting users, and may be hidden via a toggle.

Test Plan: Browser tests.

Reviewers: jarek

Reviewed By: jarek

Differential Revision: https://phab.getgrist.com/D4340
2024-09-17 17:32:10 -04:00

43 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.find('.test-intro-create-doc').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.find('.test-intro-create-doc').click();
await gu.waitForDocToLoad(20000);
await gu.dismissWelcomeTourIfNeeded();
await gu.getCell('A', 1).click();
await gu.enterCell('123');
await gu.refreshDismiss();
assert.equal(await gu.getCell('A', 1).getText(), '123');
});
});