# Backport
This will backport the following commits from `main` to `8.9`:
- [[FTR] Implement scrollIntoView util
(#165080)](https://github.com/elastic/kibana/pull/165080)
<!--- Backport version: 8.9.7 -->
### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)
<!--BACKPORT [{"author":{"name":"Marco Antonio
Ghiani","email":"marcoantonio.ghiani01@gmail.com"},"sourceCommit":{"committedDate":"2023-08-29T13:31:27Z","message":"[FTR]
Implement scrollIntoView util (#165080)\n\n## 📓 Summary\r\n\r\nBased on
the need for
[this\r\ntest](https://github.com/elastic/kibana/pull/164493/files#diff-e0bb824023eef20a7b3742da023e25744a6c20406f59ae8400455c579153faeaR262)\r\nto
scroll into the element independently of its existence in view,
this\r\nPR exposes a new `scrollIntoView` method that replicates the
behaviour\r\nof the native
[Element\r\n.scrollIntoView](https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView)\r\nmethod.\r\n\r\n---------\r\n\r\nCo-authored-by:
Marco Antonio Ghiani <marcoantonio.ghiani@elastic.co>\r\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"56c04d88872bb22d4c941fda6262746e198c5505","branchLabelMapping":{"^v8.11.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","backport:prev-minor","v7.17.13","v8.11.0"],"number":165080,"url":"https://github.com/elastic/kibana/pull/165080","mergeCommit":{"message":"[FTR]
Implement scrollIntoView util (#165080)\n\n## 📓 Summary\r\n\r\nBased on
the need for
[this\r\ntest](https://github.com/elastic/kibana/pull/164493/files#diff-e0bb824023eef20a7b3742da023e25744a6c20406f59ae8400455c579153faeaR262)\r\nto
scroll into the element independently of its existence in view,
this\r\nPR exposes a new `scrollIntoView` method that replicates the
behaviour\r\nof the native
[Element\r\n.scrollIntoView](https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView)\r\nmethod.\r\n\r\n---------\r\n\r\nCo-authored-by:
Marco Antonio Ghiani <marcoantonio.ghiani@elastic.co>\r\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"56c04d88872bb22d4c941fda6262746e198c5505"}},"sourceBranch":"main","suggestedTargetBranches":["7.17"],"targetPullRequestStates":[{"branch":"7.17","label":"v7.17.13","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.11.0","labelRegex":"^v8.11.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/165080","number":165080,"mergeCommit":{"message":"[FTR]
Implement scrollIntoView util (#165080)\n\n## 📓 Summary\r\n\r\nBased on
the need for
[this\r\ntest](https://github.com/elastic/kibana/pull/164493/files#diff-e0bb824023eef20a7b3742da023e25744a6c20406f59ae8400455c579153faeaR262)\r\nto
scroll into the element independently of its existence in view,
this\r\nPR exposes a new `scrollIntoView` method that replicates the
behaviour\r\nof the native
[Element\r\n.scrollIntoView](https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView)\r\nmethod.\r\n\r\n---------\r\n\r\nCo-authored-by:
Marco Antonio Ghiani <marcoantonio.ghiani@elastic.co>\r\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"56c04d88872bb22d4c941fda6262746e198c5505"}}]}]
BACKPORT-->
Co-authored-by: Marco Antonio Ghiani <marcoantonio.ghiani01@gmail.com>
# Backport
This will backport the following commits from `main` to `8.9`:
- [[ftr/WebElementWrapper] workaround for chromedriver incorrect error
response (#163231)](https://github.com/elastic/kibana/pull/163231)
<!--- Backport version: 8.9.7 -->
### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)
<!--BACKPORT [{"author":{"name":"Dzmitry
Lemechko","email":"dzmitry.lemechko@elastic.co"},"sourceCommit":{"committedDate":"2023-08-07T10:32:02Z","message":"[ftr/WebElementWrapper]
workaround for chromedriver incorrect error response
(#163231)\n\nRelated to #156821\r\n\r\nIt seems like Chromedriver 115
has regression again: sometimes it\r\nreturns NoSuchElementError instead
of
StaleElementReferenceError.\r\n[chromedriver/issues#534](https://bugs.chromium.org/p/chromedriver/issues/detail?id=4534)\r\n\r\nThe
fix on our side is by adding error message to retry list. The
list\r\nreferences the errors we would like to retry command on. It only
work\r\nfor single element search where we store locator.\r\nE.g. it
will help with retrying on\r\n\r\n```\r\nawait
testSubjects.click('...');\r\n```\r\n\r\nbut still fail when you
do\r\n\r\n```\r\nconst elements = await
testSubjects.findAll('...');\r\nawait
elements[1].click();\r\n```\r\n\r\nFor viz tests stability I suggest
reviewing
#161202","sha":"585d108db7dc2239c274453964bc04ce2993f7a3","branchLabelMapping":{"^v8.10.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v8.10.0","v8.9.1"],"number":163231,"url":"https://github.com/elastic/kibana/pull/163231","mergeCommit":{"message":"[ftr/WebElementWrapper]
workaround for chromedriver incorrect error response
(#163231)\n\nRelated to #156821\r\n\r\nIt seems like Chromedriver 115
has regression again: sometimes it\r\nreturns NoSuchElementError instead
of
StaleElementReferenceError.\r\n[chromedriver/issues#534](https://bugs.chromium.org/p/chromedriver/issues/detail?id=4534)\r\n\r\nThe
fix on our side is by adding error message to retry list. The
list\r\nreferences the errors we would like to retry command on. It only
work\r\nfor single element search where we store locator.\r\nE.g. it
will help with retrying on\r\n\r\n```\r\nawait
testSubjects.click('...');\r\n```\r\n\r\nbut still fail when you
do\r\n\r\n```\r\nconst elements = await
testSubjects.findAll('...');\r\nawait
elements[1].click();\r\n```\r\n\r\nFor viz tests stability I suggest
reviewing
#161202","sha":"585d108db7dc2239c274453964bc04ce2993f7a3"}},"sourceBranch":"main","suggestedTargetBranches":["8.9"],"targetPullRequestStates":[{"branch":"main","label":"v8.10.0","labelRegex":"^v8.10.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/163231","number":163231,"mergeCommit":{"message":"[ftr/WebElementWrapper]
workaround for chromedriver incorrect error response
(#163231)\n\nRelated to #156821\r\n\r\nIt seems like Chromedriver 115
has regression again: sometimes it\r\nreturns NoSuchElementError instead
of
StaleElementReferenceError.\r\n[chromedriver/issues#534](https://bugs.chromium.org/p/chromedriver/issues/detail?id=4534)\r\n\r\nThe
fix on our side is by adding error message to retry list. The
list\r\nreferences the errors we would like to retry command on. It only
work\r\nfor single element search where we store locator.\r\nE.g. it
will help with retrying on\r\n\r\n```\r\nawait
testSubjects.click('...');\r\n```\r\n\r\nbut still fail when you
do\r\n\r\n```\r\nconst elements = await
testSubjects.findAll('...');\r\nawait
elements[1].click();\r\n```\r\n\r\nFor viz tests stability I suggest
reviewing
#161202","sha":"585d108db7dc2239c274453964bc04ce2993f7a3"}},{"branch":"8.9","label":"v8.9.1","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->
Co-authored-by: Dzmitry Lemechko <dzmitry.lemechko@elastic.co>
## Summary
Starting with Chrome v113 we noticed that `_area_chart.ts` suite became
flaky #156821 failing with
`WebDriverError: unknown error: unhandled inspector error:
{"code":-32000,"message":"No node with given id found"}`
Updating chromedriver to v113 did not solve the issue and more tests
started to fail with the same error.
It happens occasionally when driver returns unhandled error instead of
StaleElementReferenceException. This PR adds the error to the
`RETRY_ON_ERRORS` list, so that FTR can search for the element again and
re-try the action on it:
```
│ debg getVisibleText: elementId=29C3E81151C86107290DD8F020524333_element_290
│ debg Chromedriver issue #4440, WebElementWrapper.getVisibleText: WebDriverError: unknown error: unhandled inspector error: {"code":-32000,"message":"No node with given id found"}
│ (Session info: chrome=113.0.5672.63)
│ debg current ElementID=29C3E81151C86107290DD8F020524333_element_290
│ debg new ElementID=29C3E81151C86107290DD8F020524333_element_293
│ debg Searching again for the element 'By(css selector, [data-test-subj="visEditorInterval"] + .euiFormErrorText)', 2 attempts left
│ debg getVisibleText: elementId=29C3E81151C86107290DD8F020524333_element_293
└- ✓ pass (1.8s)
```
There is no need to use `Retry` service, `WebDriverWrapper.retryCall`
should handle the issue.
Flaky test runner 100x for Vis Editor config:
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/2236
Flaky test runner 100x for Cases config:
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/2237
And 2 more 100x:
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/2239https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/2237
Closes#145835
## Summary
Fix `Observability alerts Alerts table Flyout Can be closed` by retrying
closing flyout if it is still open. This issue happens rarely (only once
in the main and 3 times in other branches during the last 3 months -
[link](cb7380fb-67fe-5c41-873d-003d1a407dad?_g=(filters:!(('$state':(store:globalState),meta:(alias:!n,disabled:!f,index:'1f96f3c7-e086-5f46-a8e0-40d2b811928c',key:failure.name,negate:!f,params:(query:'ObservabilityApp%20Observability%20alerts%20Alerts%20table%20Flyout%20Can%20be%20closed'),type:phrase),query:(match_phrase:(failure.name:'ObservabilityApp%20Observability%20alerts%20Alerts%20table%20Flyout%20Can%20be%20closed')))),refreshInterval:(pause:!t,value:0),time:(from:now-30d%2Fd,to:now))))
By checking the
[logs](https://buildkite.com/elastic/kibana-on-merge/builds/23841), it
seems in these cases, it checks to see if the flyout is closed but for
some reason, it is still open, so I added a retry based on @spalger 's
suggestion.
Flaky test runner[200]:
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/1746
Flaky test runner[50]:
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/1750
(After last commit)
* Removed file-type from package.json deps.
Updated jimp to 0.16.1.
Updated light & dark dashboard baseline screenshots to resolve failure due to resize degradation.
* Replaced jimp with sharp and pixelmatch. Eliminates several deps, including file-type.
Eliminates quality degradation from image resizing.
* Fixed copy paste error, which lead to pass positives and errors.
* Integrated updateBaselines flag into dashboards report testing.
Fixed sharp resize to fit and not truncate the original image.
* Removed accidental '.only'
* Reverted area chart baseline.
* Removed explicit declaration of sharp from package.json.
* Adjusted dashboard screenshot size in attempt to eliminate layout scaling issues in CI testing.
* Reverted dashboard screenshot size. Lowered tolerance in dashboard PNG reporting tests to force failure and collect CI screenshots.
* Changed session save location for dashboard report images for better CI reporting.
* Fixed small dashboard baseline screenshot with correct aspect ratio.
* Updated 2 basline screenshots from CI. Lowered PNG match tolerance for dashboard screenshots to 1% for investigation of remaining screens.
* Update of dashboard controls light mode baseline.
Change of forced container width size in large dashboard layout test.
* Updated dashboard controls dark mode baseline screenshot.
Adjusted forced container width in large dashboard layout test for troubleshooting.
* Lowering tolerance of PNG compare tests from 9% to 1% for troubleshooting.
Replaced references to dedundant image service with existing, more adopted reporting service.
Ideally, the PNG functions of the reporting service would be merged with the screenshot service as an image service.
* Reverting tolerance of PNG compares to 0.09. Will create GH issues for specific teams to investigate.
* Implemented PngService to provide an accessible single reference to PNG compare testing.
Removed redundant implementations and references.
* Updated service reference and call to png compare function left out of last commit.
* Updated another missed PNG reference.
* Removed superfluous parameter.
* Update after bootstrap
* Updated area chart baseline to match new render with panel filters.
* Reverted limits in dashboard snapshot tests to original values.
* Merge and rebuild.
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* chore(NA): eslint rule for disallowing naked eslint-disable
* chore(NA): export new rule and update docs
* chore(NA): creation of rule in ts
* chore(NA): new corrected rule in ts
* refact(NA): remove old logic from older plugin
* docs(NA): update documentation
* docs(NA): update documentation
* docs(NA): update documentation
* refact(NA): include edge cases for better locating errors
* chore(NA): changed regex name
* docs(NA): correct name rule on docs
* refact(NA): use dedent in the template literals
* refact(NA): check for undefined
* fix(NA): introduces support for eslint-disable-line
* chore(NA): fix extra space
* test(NA): created more test cases
* chore(NA): rename plugin to eslint-plugin-disable
* docs(NA): update nav and operations landing page ids for eslint rule
* test(NA): use messageIds on test
* chore(NA): complete naked eslint disables with specific rules
* chore(NA): specific rules for a few naked eslint disable
* chore(NA): add focused eslint disable on big reindex_operation_with_large_error_message.ts file
* chore(NA): changes according PR feedback
* chore(NA): include specific eslint rules on latest naked eslint disable
* chore(NA): missing eslint disable specific rule
* fix(NA): remove comment for js annotator
* chore(NA): re add eslint focused disable rule to x-pack/plugins/osquery/cypress/support/coverage.ts
* chore(NA): re add eslint focused disable rule to x-pack/plugins/osquery/cypress/support/coverage.ts
* chore(NA): re add eslint focused disable rule to x-pack/plugins/osquery/cypress/support/coverage.ts
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* Translate dashboard state to URL conditionally
* Add functional tests
* Fix typo in functional test descriptions
* Remove deprecated references
* Rename useUrl to be more specific
* added page to reporting example app that contains the capture tests
* first version of PNG capture for test A
* added types file to common
* added data-shared-item attr to image, also added capture menu items
* fix image CSS by providing a fixed width and height
* explicitly add layout for print, does not seem to do anything though?
* added magic numbers of image sizes
* added reporting examples test folder
* first version of capture test for generating and comparing PNGs
* added PNG service and PNG baseline fixture
* added pdf-to-img dev dependency
* refactor compare_pngs to accept a buffer
* added comment to interface
* png service -> compare images service
* export image compare service
* added test for pdf export
* clean up log
* minor fixes and added pdf print optimized test
* added pdf and pdf print fixtures
* refactor lib function name
* Update difference thresholds
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* Initial commit, very WIP
- added link to the integrations UI instead of add integration
in fleet
- added a new piece of route state that gets passed to integration
from fleet when browsing integrations for a policy
- when the integration is being added the page will send the user
back to the policy overview instead of back to integrations UI
* remove unnecessary agent policy clear function
* added # to path so that navigation is correctly handled
* added logic to read the forward agent policy id
* remove inline select integration package from fleet add integration
* updated toast notification
* using query parameter to pass policy id back to create policy package page
* removed policyId from route path
* fix type issue
* updated the select agent field layout per the designs
* simpified item rendering in combobox and fixed combobox z-index issue
* added comment
* fix types and i18n
* updated icon and removed unused i18n
* refactor to using styled components for cusomt z-index styling
* attempt to fix integration test
* added scroll functionality for dealing with fixed footers that might be obstructing content
* fix scroll direction!
* attempting another scroll algorithm
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* bump dependency, add edge support in ftr services
* add config files
* fix browser version for msedge
* use npm ms-chromium-edge-driver
* download edge driver aside from session creation
* move dependency to dev
* update dist/index file
* bump edge-driver version
* change type to msedge to match w3c spec
* fix discover tests for Edge
* Revert "fix discover tests for Edge"
This reverts commit 87e7fdd256.
* bump driver version up
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
* Add option for Internet Explorer IE11
* WIP trying to figure out IE options/capabilities
* more attempts to get IE tests working
* more work, but still can't set font size in Dev Tools Console
* two changes for IE
* revert skip in console test
* this change *appears* to set absolute times but they don't stick
* Shakespeare passing on all 3 browsers
* add config.ie.js, change 'internet explorer' to 'ie'
* increase notifications:lifetime so ew have a chance to see the message
* fix lint error remove unused Options
* updates from PR review, remove console.log
* cleanup + reuse existing code
* make iedriver path work for x-pack tests
* try to avoid changing notification timeout
* resolve path and add correct delimiter
* remove unused code, make timepicker work on IE11
* work-around 45333 for IE11
* [WIP] removing some work-arounds
* revert work-arounds
* cleanup
* remove debugging code
* remove debugging code
* removed unused code
* reverting 2 files that didn't have any material changes
* use new setScreenshotSize
* change tolerance from 1% to 2% (originally 5%)
* retake baseline without notification dialog
* close add and save notifications
* wait for render complete when going in to FullScreen mode
* add 5 second sleep to see if it ever goes to full screen mode
* add debugging screenshots and sleeps
* try reloading the Kibana index before this test
* 30 iterations with only the first test enabled
* revert multi-run changes
* ran node scripts/build_renovate_config
* fix tslint errors
* fix tslint error
* update xpack dependency to match oss
* update yarn.lock
* revert notifications:lifetime:info change by reducing some other timeouts
* remove commented-out code
* fixed and Unskipped 2nd test
* re-arrange order of dashboard tests to pass :-(
* removed commented-out sleep
Hopefully this won't be an issue
* Add comment about the order of tests
```
loadTestFile(require.resolve('./view_edit'));
// Order of test suites *shouldn't* be important but there's a bug for the view_edit test above
// https://github.com/elastic/kibana/issues/46752
// The dashboard_snapshot test below requires the timestamped URL which breaks the view_edit test.
// If we don't use the timestamp in the URL, the colors in the charts will be different.
loadTestFile(require.resolve('./dashboard_snapshots'));
```
* [services/web_element_wrapper] add actions API methods
* fixes
* [services/browser] fix dragAnDrop to work in both w3c/non-w3c modes
* small review changes
* dragAndDrop: add default values for offset
* [Logs UI] Make column configurations reorderable
* Improve typing aand memoize callback
* Guard against index bounds and rename reorderLogColumns
* Fix useCallback memoization
* Add functional test for reordering log columns
* Use browser.keys instead of Key in functional test
* [services/lib/web_element_wrapper] use Generics in replyCall
* [services/lib/web_element_wrapper] remove redundant return types
* [services/lib/web_element_wrapper/] set retryCall timeout to 200 ms
* [services/find] explcitly pass element to have locator===null by default
* use static method to create WebElementWrapper
* missed a couple uses
* move some values to constants
* remove some unnecessary type info
* [ts] upgrade to 3.5.2
* [ts] run from cwd so that relative paths are correct
* move eslint-disable-line comment into jsx attribute
* autofix eslint violations
* avoid generic type, it's not necessary and problematic
* make elasticsearch.cluster optional, many instances don't have them
* remove invalid prop
* expand AllowUnknownProperties to cleanly handle arrays
* esfilter values can sometimes be an array of strings
* allow exception objects to have unknown properties
* define accumulator as a boolean
* fix return type
* return a 404 if beat isn't found after update
* use Object.values for better types
* define return type of get() call
* define value type for Set
* define return value of get()
* define State property type
* use less get(), so ts can infer types
* define Set item type
* map state type
* make default_operator optional, since it's not always defined
* remove seemingly unused prop
* define return type of get() fn
* define inner type for state
* don't define base types are objects with index signatues
* regenerate public api docs
* make indices privileges optional too
* remove unnecessary index-signature from Exception interface
* use variadic _arg instead
* [core/plugin] use Record<string, any> rather than {}
* replace a couple more instances of {}
* revert some unnecessary changes
* remove unused types
* [reporting] output, payload, and meta are required properties
* bump to latest patch version
* skip and adjust functional tests for Firefox
* downgrade geckodriver to 0.22.0
* [ftr] add firefox specific config file
* remove hard coded firefox adjustments
* remove firefox specific screenshot directory
* run functional tests in firefox in x-pack
* pass the logger to readConfigFile()
* rename local var
* skip xpack firefox config
* run xpack firefox functional tests in separate command
* update report name for XPack firefox results
* adjust viz shared item test
* skip shared item test
* [test/feature_controls] increase timeout to 20 sec & use forceLogout
* FF timeout on TSVB, refresh page on failure for url navigation
* [feature_controls/visualize_security] increase timeout to 20 sec
* skip dev_tools_spaces tests on FF
* run all groups 3 times
* skip more func tests
* skip more tests
* skip all feature controls tests for Firefox
* revert back changes in feature controls tests
* rename xpack report for chrome
* skip tile map for FF, wait for render before saving
* Revert "run all groups 3 times"
This reverts commit 12b4f69627.
* revert refresh on login
* apply feedback
Solution for use cases that need a query bar without a submit button or date picker that still want KQL and autocomplete. Necessary for the KQL in TSVB and KQL in filters aggregation efforts.