Skip to content

Commit

Permalink
fix async in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tsullivan committed Feb 18, 2021
1 parent 7cb8324 commit 4b01fc2
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
before(async () => {
await PageObjects.common.navigateToApp('dashboard');
log.debug('wait for dashboard landing page');
retry.tryForTime(10000, async () => {
await retry.tryForTime(10000, async () => {
testSubjects.existOrFail('dashboardLandingPage');
});
await searchSessions.markTourDone();
Expand Down Expand Up @@ -199,16 +199,16 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
it('has working pagination controls', async () => {
await esArchiver.load('data/search_sessions');

retry.try(async () => {
const searchSessionList = await PageObjects.searchSessionsManagement.getList();
expect(searchSessionList.length).to.be(10);
});
log.debug(`loading first page of sessions`);
const sessionListFirst = await PageObjects.searchSessionsManagement.getList();
expect(sessionListFirst.length).to.be(10);

await testSubjects.click('pagination-button-next');

const searchSessionList = await PageObjects.searchSessionsManagement.getList();
expect(searchSessionList.length).to.be(2);
expectSnapshot(searchSessionList.map((ss) => [ss.app, ss.name, ss.created, ss.expires]))
const sessionListSecond = await PageObjects.searchSessionsManagement.getList();
expect(sessionListSecond.length).to.be(2);

expectSnapshot(sessionListSecond.map((ss) => [ss.app, ss.name, ss.created, ss.expires]))
.toMatchInline(`
Array [
Array [
Expand Down

0 comments on commit 4b01fc2

Please sign in to comment.