gristlabs_grist-core/test/nbrowser/Smoke.ts
Dmitry S 1605e18f66 (core) Enable auto triggering of Welcome Tour, and various improvements.
Summary:
- Add showGristTour preference, and trigger tour automatically.
- Tour is only triggered for new and anonymous users on a personal org, with
  edit permission.

- Automatically open the right panel at tour start.
- Don't show tours on mobile, since that's not ready (popups are cut off
  and can't be dismissed)
- Cancel previous tour if a new one is somehow started.
- Remove #repeat- trigger hash tags from the URL when the tour starts.
- Ensure Help Center popup is positioned even when left panel is collapsed.
- Polish up the content of the last two cards in the tour.

Test Plan: Added test case for triggering and opening right panel.

Reviewers: alexmojaki, paulfitz

Reviewed By: alexmojaki

Differential Revision: https://phab.getgrist.com/D2955
2021-07-30 14:17:54 -04:00

48 lines
1.4 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 {
const url = await driver.getCurrentUrl();
if (url.match(/welcome\//)) {
await driver.findContent('button', /Continue/).click();
}
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');
});
});