kibana/test/plugin_functional
Eyo O. Eyo 735fb1b0d4
[7.17] [Global Search] Limit characters for global search bar (#186560) (#188311)
# Backport

This will backport the following commits from `main` to `7.17`:
- [[Global Search] Limit characters for global search bar
(#186560)](https://github.com/elastic/kibana/pull/186560)

<!--- Backport version: 8.9.8 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Rachel
Shen","email":"rshen@elastic.co"},"sourceCommit":{"committedDate":"2024-07-11T14:50:20Z","message":"[Global
Search] Limit characters for global search bar (#186560)\n\n##
Summary\r\n\r\nThis PR limits the number of characters that can be input
into the\r\nglobal search bar. The character limit can be specified with
the config\r\nvalue `xpack.global_search_bar.input_max_limit` with a
default of\r\n`1000`. When an input that exceeds the configured
character limit is\r\nprovided a descriptive visual notice is displayed
to the user.\r\n\r\n## Visual \r\n<img width=\"662\" alt=\"Screenshot
2024-07-04 at 19 28
39\"\r\nsrc=\"cf30f589-fe65-40a9-b9c8-ce0f235d206e\">\r\n\r\n\r\n##
How to test\r\n\r\n- run the following command below in the browser
console, which would\r\ncreate a string that exceeds the configured
default search character\r\nlimit and copy it to your
clipboard\r\n```ts\r\n\tcopy(Array.from(new Array(1001)).reduce((acc) =>
acc+'a', ''))\r\n```\r\n- open up kibana, simply paste the value that
should exist in your\r\nclipboard in the global search input field and
you should be presented\r\nwith a result similar to the image
above.\r\n\r\n---------\r\n\r\nCo-authored-by: Eyo Okon Eyo
<eyo.eyo@elastic.co>","sha":"f57d9c5f01e8e7cdf338251ce031d597d8fd56a4","branchLabelMapping":{"^v8.16.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","auto-backport","backport:prev-MAJOR","backport:all-open"],"number":186560,"url":"https://github.com/elastic/kibana/pull/186560","mergeCommit":{"message":"[Global
Search] Limit characters for global search bar (#186560)\n\n##
Summary\r\n\r\nThis PR limits the number of characters that can be input
into the\r\nglobal search bar. The character limit can be specified with
the config\r\nvalue `xpack.global_search_bar.input_max_limit` with a
default of\r\n`1000`. When an input that exceeds the configured
character limit is\r\nprovided a descriptive visual notice is displayed
to the user.\r\n\r\n## Visual \r\n<img width=\"662\" alt=\"Screenshot
2024-07-04 at 19 28
39\"\r\nsrc=\"cf30f589-fe65-40a9-b9c8-ce0f235d206e\">\r\n\r\n\r\n##
How to test\r\n\r\n- run the following command below in the browser
console, which would\r\ncreate a string that exceeds the configured
default search character\r\nlimit and copy it to your
clipboard\r\n```ts\r\n\tcopy(Array.from(new Array(1001)).reduce((acc) =>
acc+'a', ''))\r\n```\r\n- open up kibana, simply paste the value that
should exist in your\r\nclipboard in the global search input field and
you should be presented\r\nwith a result similar to the image
above.\r\n\r\n---------\r\n\r\nCo-authored-by: Eyo Okon Eyo
<eyo.eyo@elastic.co>","sha":"f57d9c5f01e8e7cdf338251ce031d597d8fd56a4"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[]}]
BACKPORT-->

Co-authored-by: Rachel Shen <rshen@elastic.co>
2024-07-18 12:11:58 -07:00
..
plugins [7.17] Bump postcss to ^8 (#136303) (#154723) 2023-04-12 13:41:56 -07:00
services [7.x] Elastic License 2.0 (#90192) 2021-02-03 18:39:13 -08:00
test_suites [7.17] [Global Search] Limit characters for global search bar (#186560) (#188311) 2024-07-18 12:11:58 -07:00
config.ts [7.x] [Discover] Remove Angular from doc viewer (#109368) (#109786) 2021-08-26 15:44:38 -04:00
README.md [KP] Expose new es client (#73651) (#73840) 2020-07-30 21:09:14 +02: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.ts
# Start a test run
node scripts/functional_test_runner.js --config test/plugin_functional/config.ts

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.ts

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