# How can i test my custom Kibana Plugin?

**URL:** <https://discuss.elastic.co/t/how-can-i-test-my-custom-kibana-plugin/97397>\
**Category:** Kibana\
**Created:** [August 17, 2017, 11:28am UTC](https://discuss.elastic.co/t/how-can-i-test-my-custom-kibana-plugin/97397 "2017-08-17T11:28:48Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![LeeDr](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leedr/32/9289_2.png) [@LeeDr](https://discuss.elastic.co/u/LeeDr)\
**Post date:** [August 17, 2017, 4:52pm UTC](https://discuss.elastic.co/t/how-can-i-test-my-custom-kibana-plugin/97397/4 "2017-08-17T16:52:24Z")

</div>

Most of our functional UI tests (Selenium tests) load test data into Elasticsearch using the es\_archiver

For example, in this discover test it uses  
`await esArchiver.load('discover');`

> <https://github.com/elastic/kibana/blob/master/test/functional/apps/discover/_discover.js#L29>

Which is loading the set of data which is checked-in here; [https://github.com/elastic/kibana/tree/master/test/functional/fixtures/es\_archiver/discover](https://github.com/elastic/kibana/tree/master/test/functional/fixtures/es_archiver/discover)

You can run the es\_archiver from the command line to save some data you created in Elasticsearch by whatever means you want. And then in your test you would load that data. If it's time-based data (typically is) then in your test you would always set the Kibana timepicker to the same exact time so you always get the same results on that data. Like `await PageObjects.header.setAbsoluteRange(fromTime, toTime);`

If you're creating a new plugin, I would create a new Page Object file for the methods needed to access the objects in your plugin page.

You would typically run the UI tests by starting the Elasticsearch and Kibana server like  
`npm run test:ui:server`  
and then running the tests like;  
`node scripts/functional_test_runner`

See [https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md)

Regards,  
Lee

---

_[View the full topic](https://discuss.elastic.co/t/how-can-i-test-my-custom-kibana-plugin/97397)._
