Skip to content

Commit

Permalink
Using new GettingStarted page object methods + opting out
Browse files Browse the repository at this point in the history
  • Loading branch information
ycombinator committed May 18, 2017
1 parent 4cedb89 commit 6334019
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions test/functional/apps/management/_getting_started.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import expect from 'expect.js';
export default ({ getService, getPageObjects }) => {
const kibanaServer = getService('kibanaServer');
const esArchiver = getService('esArchiver');
const remote = getService('remote');
const log = getService('log');

const PageObjects = getPageObjects(['common', 'gettingStarted']);
Expand All @@ -15,10 +16,14 @@ export default ({ getService, getPageObjects }) => {
});

describe('when user has not opted out of Getting Started page', () => {
it('redirects to the Getting Started page', async () => {
before(async () => {
await PageObjects.common.navigateToUrl('discover', '');
await remote.deleteLocalStorageItem('kibana.isGettingStartedOptedOut');
});

it('redirects to the Getting Started page', async () => {
await PageObjects.common.waitUntilUrlIncludes('getting_started');
const isLoaded = await PageObjects.gettingStarted.optOutLinkExists();
const isLoaded = await PageObjects.gettingStarted.doesContainerExist();
expect(isLoaded).to.be(true);
});
});
Expand All @@ -30,7 +35,7 @@ export default ({ getService, getPageObjects }) => {

it('does not redirect to the Getting Started page', async () => {
await PageObjects.common.navigateToUrl('discover', '');
const isLoaded = await PageObjects.gettingStarted.optOutLinkExists();
const isLoaded = await PageObjects.gettingStarted.doesContainerExist();
expect(isLoaded).to.be(false);
});
});
Expand All @@ -51,7 +56,7 @@ export default ({ getService, getPageObjects }) => {

it('does not redirect to the Getting Started page', async () => {
await PageObjects.common.navigateToUrl('discover', '');
const isLoaded = await PageObjects.gettingStarted.optOutLinkExists();
const isLoaded = await PageObjects.gettingStarted.doesContainerExist();
expect(isLoaded).to.be(false);
});
});
Expand Down

0 comments on commit 6334019

Please sign in to comment.