-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add integration test for the partial results example plugin
- Loading branch information
Showing
2 changed files
with
48 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0 and the Server Side Public License, v 1; you may not use this file except | ||
* in compliance with, at your election, the Elastic License 2.0 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
|
||
import expect from '@kbn/expect'; | ||
import { FtrProviderContext } from 'test/functional/ftr_provider_context'; | ||
|
||
// eslint-disable-next-line import/no-default-export | ||
export default function ({ getService, getPageObjects }: FtrProviderContext) { | ||
const testSubjects = getService('testSubjects'); | ||
const PageObjects = getPageObjects(['common']); | ||
|
||
describe('Partial Results Example', function () { | ||
before(async () => { | ||
this.tags('ciGroup2'); | ||
await PageObjects.common.navigateToApp('partialResultsExample'); | ||
|
||
const element = await testSubjects.find('example-help'); | ||
|
||
await element.click(); | ||
await element.click(); | ||
await element.click(); | ||
}); | ||
|
||
it('should trace mouse events', async () => { | ||
const events = await Promise.all( | ||
( | ||
await testSubjects.findAll('example-column-event') | ||
).map((wrapper) => wrapper.getVisibleText()) | ||
); | ||
expect(events).to.eql(['mousedown', 'mouseup', 'click']); | ||
}); | ||
|
||
it('should keep track of the events number', async () => { | ||
const counters = await Promise.all( | ||
( | ||
await testSubjects.findAll('example-column-count') | ||
).map((wrapper) => wrapper.getVisibleText()) | ||
); | ||
expect(counters).to.eql(['3', '3', '3']); | ||
}); | ||
}); | ||
} |