2023-09-08 13:05:52 +00:00
|
|
|
import {assert, driver} from 'mocha-webdriver';
|
|
|
|
import * as gu from 'test/nbrowser/gristUtils';
|
|
|
|
import {setupTestSuite} from 'test/nbrowser/testUtils';
|
|
|
|
|
|
|
|
describe('HomeIntroWithoutPlayground', function() {
|
2024-09-12 17:10:55 +00:00
|
|
|
this.timeout(20000);
|
2023-09-08 13:05:52 +00:00
|
|
|
setupTestSuite({samples: true});
|
|
|
|
gu.withEnvironmentSnapshot({'GRIST_ANON_PLAYGROUND': false});
|
|
|
|
|
|
|
|
describe("Anonymous on merged-org", function() {
|
2024-09-12 17:10:55 +00:00
|
|
|
it('should show welcome page', async function () {
|
2023-09-08 13:05:52 +00:00
|
|
|
const session = await gu.session().personalSite.anon.login();
|
|
|
|
await session.loadDocMenu('/');
|
|
|
|
assert.equal(await driver.find('.test-welcome-title').getText(), 'Welcome to Grist!');
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should not allow creating new documents', async function () {
|
|
|
|
const session = await gu.session().personalSite.anon.login();
|
|
|
|
await session.loadDocMenu('/');
|
|
|
|
|
2024-09-12 17:10:55 +00:00
|
|
|
// Check that the Add New button is disabled.
|
2023-09-08 13:05:52 +00:00
|
|
|
assert.equal(await driver.find('.test-dm-add-new').matches('[class*=-disabled]'), true);
|
|
|
|
await driver.find('.test-dm-add-new').doClick();
|
|
|
|
assert.equal(await driver.find('.test-dm-new-doc').isPresent(), false);
|
2024-09-12 17:10:55 +00:00
|
|
|
|
|
|
|
// Check that the intro buttons are also disabled.
|
|
|
|
assert.equal(await driver.find('.test-intro-create-doc').getAttribute('disabled'), 'true');
|
|
|
|
assert.equal(await driver.find('.test-intro-import-doc').getAttribute('disabled'), 'true');
|
2023-09-08 13:05:52 +00:00
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|