Convert discover_page to ts, remove redundunt methods#59312
Convert discover_page to ts, remove redundunt methods#59312dmlemeshko merged 3 commits intoelastic:masterfrom
Conversation
💚 Build SucceededHistory
To update your PR or re-run it, just comment with: |
| const $ = await table.parseDomContent(); | ||
| return $('mark') | ||
| .toArray() | ||
| .map(mark => $(mark).text()); |
There was a problem hiding this comment.
What's the reason for the switch to parseDomContent change? code becomes more verbose? thx!
There was a problem hiding this comment.
To speedup and minimize flakiness:
const marks = await find.allByCssSelector('mark');
return await Promise.all(marks.map(mark => mark.getVisibleText()));
With the code above _field_data test webdriver makes 51 rest call (1 - /elements, 50 for each element) The main problem is that while iterating through array of 50 elements DOM might be updated and mark.getVisibleText() will fail since element reference is no longer valid.
With the new code we make 2 rest calls (1 - /element, 1 - /innerHTML), faster and since we search in DOM snapshot there is no longer dependency UI rendering.
There was a problem hiding this comment.
it is not the best approach for every case, but here mark is in the span and I don't see a reason why taking text from DOM can be different from text we are getting with webdriver rest call.
There was a problem hiding this comment.
thank you very much for the explanation!
kertal
left a comment
There was a problem hiding this comment.
Code LGTM, reducing the number of requests and improving stability is a nice improvement. didn't test, but this is done by Lord Jenkins anyway
* convert discover_page to ts * remove deuplicated methods, improve tests
…re/files-and-filetree * 'master' of github.com:elastic/kibana: (254 commits) Convert discover_page to ts, remove redundunt methods (elastic#59312) [Fix for Vis Editor] Revert setting time field to empty string when it's undefined (elastic#58873) Delete legacy search endpoint (elastic#59341) [Uptime] Improve duration chart (elastic#58404) [Snapshot & Restore] NP migration (elastic#59109) [ML] Add support for date_nanos time field in anomaly job wizard (elastic#59017) Revert "Makes alerting and actions optional properties for interface RequestH… (elastic#59264)" Change remote_clusters ID to remoteClusters (elastic#59246) Makes alerting and actions optional properties for interface RequestH… (elastic#59264) Clean up date histogram agg type. (elastic#58805) [ML] Management: fix license unsubscribe (elastic#59365) Remove documentation for server.cors settings (elastic#59096) Edit alert flyout (elastic#58964) [SIEM] Fix rule delete/duplicate actions (elastic#59306) move mouse to close obstructing tooltip (elastic#59214) Reset page after deleting (elastic#59310) Make sure phrases input filter triggers autosuggestons (elastic#59299) Add loading count source for http requests (elastic#59245) Revert "[ML] Transforms: Deprecate custom KibanaContext. (elastic#59133)" Expose metrics service to public API (elastic#59294) ... # Conflicts: # src/plugins/console/public/application/containers/editor/legacy/console_editor/editor.tsx
* convert discover_page to ts * remove deuplicated methods, improve tests
|
Looks like this PR has backport PRs but they still haven't been merged. Please merge them ASAP to keep the branches relatively in sync. |
Summary
Convert discover_page to ts, remove redundant/duplicate methods