kibana/test/plugin_functional
Vadim Dalecky ece2c35de1
Embeddables 👉 NP-ready (#41272)
* refactor: 💡 create registries file

* docs: ✏️ add testing command to docs

* chore: 🤖 create state folder

* chore: 🤖 WIP

* refactor: 💡 remove static imports of stateful things

Make Embeddables ./triggers tests pass

* test: 💍 add await-of for testing

* refactor: 💡 move stateless code into shim's lib/ folder

* test: 💍 add registry tests

* feat: 🎸 add Embeddable plugin public "setup" API

* feat: 🎸 create Embeddable plugin shim

* refactor: 💡 minor improvements for new plugin structure

* refactor: 💡 move test helpers into shim

* feat: 🎸 add Embeddable setup.getTrigger() method

* feat: 🎸 inject setup API into pure setup functions

* refactor: 💡 generate Embeddable setup API in a loop

* feat: 🎸 add getTriggerActions() Embeddable setup function

* feat: 🎸 add getTriggerCompatibleActions() to Embeddable shim

* chore: 🤖 uninstall await-of package

* chore: 🤖 simplify imports/exports

* test: 💍 improve testing utilities

* feat: 🎸 add executeTriggerActions() Embeddables setup method

* fix: 🐛 remove non-existing import

* chore: 🤖 cleanup actions

* refactor: 💡 move errors into dedicated errors.ts file, add test

* test: 💍 add unit test for ApplyFilterAction class

* test: 💍 import helpers correctly after refactoring

* test: 💍 fix actions tests

* feat: 🎸 clean up /lib/embeddables

* test: 💍 fix /lib/containers tests

* test: 💍 make embeddable_panel.test.tsx tests pass

* refactor: 💡 work on briging EditPanelAction action to /actions

* test: 💍 make /containers tests pass

* test: 💍 make /actions and /embeddables tests pass

* test: 💍 clean up tests from legacy platform static imports

* feat: 🎸 add getEmbeddableFactories API method

* test: 💍 add tests for factory list method

* feat: 🎸 add start life-cycle API

* feat: 🎸 unify Embeddables API

* refactor: 💡 create /css folder, move all CSS there

* feat: 🎸 improve dashboard container shim

* feat: 🎸 progress on dashboard container shim

* feat: 🎸 implement getEmbeddableFactory Embeddable API method

* feat: 🎸 improve embeddable container shim

* test: 💍 fix dashboard container expand panel tests

* test: 💍 fix dashboard grid tests

* test: 💍 fix createPanel tests

* test: 💍 fix dashboard viewport tests

* test: 💍 fix dashboard container tests

* test: 💍 add Embeddable plugin mock

* test: 💍 improve tests after merge

* refactor: 💡 move new platform code into np_ready folders

* chore: 🤖 fix some TS errors after merge

* chore: 🤖 fix more TS errors after merge

* fix: 🐛 fix TypeScript errors in kbn_tp_sample_panel_action

* fix: 🐛 fix more TypeScript errors

* fix: 🐛 fix TypeScript in functional tests

* fix: 🐛 fix more TypeScript errors

* fix: 🐛 fix more TS errors

* refactor: 💡 pass deps through constructors

* refactor: 💡 improve dependency injection and fix tests

* test: 💍 fix container integration tests

* test: 💍 fix customize_panel_modal tests after refactor

* test: 💍 fix all tests in embeddable_api

* chore: 🤖 fix linter error

* test: 💍 fix dashboard_embeddable_container tests after merge

* test: 💍 fix /src TypeScript errors

* fix: 🐛 fix Jest tests and add global typings in demo plugin

* fix: 🐛 fix build errors

* fix: 🐛 make build start without errors

* fix: 🐛 in dashboard container don't import types from ui/*

* chore: 🤖 fix linter errors

* refactor: 💡 remove getUserData, remove another ui/new_platform

* chore: 🤖 fix linter errors

* refactor: 💡 remove ui/new_platform from HelloWorldAction

* refactor: 💡 remove ui/new_platform from SendMessageAction

* refactor: 💡 remove ui/new_platform from ContactCardEmbeddableF*

* chore: 🤖 fix ESLint errors

* feat: 🎸 throw if action or trigger with given ID already exists

* feat: 🎸 throw if embeddable factory already registered

* docs: ✏️ fix tsdoc

* chore: 🤖 remove unused @ts-ignore

* refactor: 💡 remove createEmbeddables() function

* refactor: 💡 use new NP inspector plugin

* fix: 🐛 fix TypeScript errors

* chore: 🤖 improve plugin manifests

* feat: 🎸 cherry pick exported API from Embeddable plugin

* refactor: 💡 do not import constants from Kibana App

* fix: 🐛 remove unnecessary any

* chore: 🤖 uncomment SASS files

* refactor: 💡 remove IndexPattern logic out of dashboard panel

* refactor: 💡 move RefreshInterval and TimeRange to New Platform

* fix: 🐛 revert back notifications usage

* chore: 🤖 export test samples from index.ts files

* test: 💍 re-enable ApplyFilterAction integration tests

* chore: 🤖 remove unused translation

* refactor: 💡 rename variable to something less React specific

* fix: 🐛 improve CSS imports, remove unused hack, remove any type

* fix: 🐛 fix Embeddables demo plugin

* fix: 🐛 fix missing SASS variable

* fix: 🐛 re-enable translation

* fix: 🐛 uncomment saved object flyout panel logic

* refactor: 💡 pass in <SavedObjectFinder> from top level

* test: 💍 re-enable add_panel_flyout tests

* refactor: 💡 pass in <ExitFullScreenButton> through args

* fix: 🐛 import specific constants to fix functional tests

* fix: 🐛 fix CI type_check error

* test: 💍 change import paths to fix functional tests on CI

* test: 💍 fix exit button test after refactoring

* refactor: 💡 make do not change page on grid error

* test: 💍 fix functional test

* refactor: 💡 move CSS next to components

* fix: 🐛 remove missing props

* test: 💍 try fixing functional test on CI

These tests pass locally, but fail on CI. This is a stab to fix it on
CI.

* refactor: 💡 move variables.scss one folder up

* test: 💍 disable Embeddable Explorer functional tests

* chore: 🤖 remove onCoreReady in functional tests

* test: 💍 disable maps functional test for embeddables

* chore: 🤖 remove comment, export types explicitly

* refactor: 💡 remove unused `firstName`, add link to issue

* refactor: 💡 remove double underscore __ in test registry names

* refactor: 💡 remove utils folder, move bootstrap() fn to top lvl

* test: 💍 uncomment edit_panel_action tests

* test: 💍 uncomment inspect_panel_action tests
2019-08-12 12:41:18 +02:00
..
plugins Embeddables 👉 NP-ready (#41272) 2019-08-12 12:41:18 +02:00
test_suites skip flaky test (#41050) 2019-07-13 14:04:14 -07:00
config.js Embeddables 👉 NP-ready (#41272) 2019-08-12 12:41:18 +02:00
README.md Plugin test readme’s (#26632) 2018-12-04 15:23:23 -05:00

Plugin Functional Tests

This folder contains plugin functional tests, i.e. functional tests that should be executed against a Kibana instance with specific test plugins available.

To add a plugin to the instance, just place the plugin folder in the plugins directory.

Add new test suites into the test_suites folder and reference them from the config.js file. These test suites work the same as regular functional test except that they are executed against a Kibana with all plugins (from the plugins directory) installed.

Run the test

To run these tests during development you can use the following commands:

# Start the test server (can continue running)
node scripts/functional_tests_server.js --config test/plugin_functional/config.js
# Start a test run
node scripts/functional_test_runner.js --config test/plugin_functional/config.js

Run Kibana with a test plugin

In case you want to start Kibana with one of the test plugins (e.g. for developing the test plugin), you can just run:

yarn start --plugin-path=test/plugin_functional/plugins/<plugin_folder>

If you wish to start Kibana with multiple test plugins, you can run:

yarn start --plugin-path=test/plugin_functional/plugins/<plugin_folder1> --plugin-path=test/plugin_functional/plugins/<plugin_folder2> ... 

If you wish to load up specific es archived data for your test, you can do so via the es_archiver script detailed in the Scripts README.md

Another option, which will automatically use any specific settings the test environment may rely on, is to boot up the functional test server pointing to the plugin configuration file.

node scripts/functional_tests_server --config test/plugin_functional/config.js

Note: you may still need to use the es_archiver script to boot up any required data.