Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[meta] Vislib functional test replacement #794

Closed
5 of 6 tasks
markov00 opened this issue Aug 26, 2020 · 4 comments
Closed
5 of 6 tasks

[meta] Vislib functional test replacement #794

markov00 opened this issue Aug 26, 2020 · 4 comments
Assignees
Labels
meta ...meta issue :vislib Relating to vislib replacement

Comments

@markov00
Copy link
Member

markov00 commented Aug 26, 2020

Is your feature request related to a problem? Please describe.
The replacement of vislib requires also a replacement of the current functional tests available in Kibana.
These tests are checking also the rendering capabilities inside Kibana picking and analyzing DOM elements.
With the current @elastic/charts library, rendering in Canvas, this is no more possible.

Describe the solution you'd like

  • find and collect every PageObject functions, used by functional tests in Kibana, that are checking values/variables in the DOM rendered by vislib
  • analyze these functions and extract a set of possible replacement properties/statistics that can be extracted from the chart state or chart selectors (e.g. number of bars, lines, areas, points, bars values, colors, etc)
  • put those statistics into the available <ChartStatus/> component as attributes only when the debug flag is enabled
  • enable the debug flag in vislib only when running on the CI (we should be careful here because the debug currently also enable the graphical debug that can break Kibana visual regression tests)
  • replace the PageObject functions for vislib with similar tests using our exposed statistics/properties
  • where possible, extract from the functional tests the chart state (in particular the specs configurations) and create a set of VRTs in the elastic-charts repo to check the correctness of the rendering.

Describe alternatives you've considered
Enable Percy on Kibana, but we should define when we want to run it and how

Related issue in Kibana: elastic/kibana#70176

@markov00 markov00 added the enhancement New feature or request label Aug 26, 2020
@markov00 markov00 added this to the Kibana 7.10 milestone Aug 26, 2020
@markov00 markov00 added meta ...meta issue :vislib Relating to vislib replacement and removed enhancement New feature or request labels Aug 26, 2020
@VladLasitsa
Copy link

Collected the following functions that we used in function tests for area, line and bar charts:

  • getAreaChartData - Calculate needed data using height of rectangle('rect.background') and data about position of one area chart from 'path' in attribute 'd'. This area chart data which we insert in 'path' starts with a 'M'ove to a x,y location, followed by a bunch of 'L'ines from that point to the next. Those points are the values we're going to use to calculate the data values we're testing. So git rid of the one 'M' and split the rest on the 'L's.

  • getAreaChartPaths - Needed for getting number of segments in chart.

  • getLineChartData - Calculate needed data using height of rectangle('clipPath rect') and data about position of one line chart from 'circle' in attribute 'cy'.

  • getBarChartData - Calculate needed data using height of rectangle('g > g.series > rect') for one bar in chart.

  • getChartYAxisRatio - Returns the range/pixel ratio (max value - min value on y axis / position on max value - poation of min value) - needed for chart data getters. So that we can transform heights in data.

  • getYAxisLabels - Get all y - axis labels

  • getYAxisLabelsAsNumbers - Get count of y - axis labels

  • getXAxisLabels - Get all x - axis labels

@markov00
Copy link
Member Author

@VladLasitsa
on getAreaChartData are the test checking that the position of an area point in the SVG is the same as the one reported in the functional test in the SVG coordinate space? or is comparing that value to the original data used (the value coming from ES and processed by visualize editor?
Same question for Bars and Lines
Thanks

@VladLasitsa
Copy link

@markov00
As I understand getAreaChartData and other similar functions just calculate value using height and position in SVG so that in different function tests we can compare it with expected data (by expected data in test I think we mean original data(values coming from ES)).

@nickofthyme nickofthyme self-assigned this Sep 23, 2020
@markov00 markov00 changed the title Vislib functional test replacement [meta] Vislib functional test replacement Oct 7, 2020
@nickofthyme
Copy link
Collaborator

Completed in elastic/kibana@c88e285

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
meta ...meta issue :vislib Relating to vislib replacement
Projects
None yet
Development

No branches or pull requests

3 participants