What feature(s) would you like to see in RepoSense
Test cases use percentile instead of number of pixel to represent the point to click.
Is the feature request related to a problem?
Right now in frontend cypress tests, many test cases related to the chartView has hard-coded coordinates. As an example, in testcase subzoom panel range should work correctly when timeline is optimised in file chartView_optimiseTimeline.cy.js
cy.get('body').type(zoomKey, { release: false })
.get('#summary-charts .summary-chart__ramp .ramp')
.first()
.click(110, 20) // <- 110
.click(120, 20); // <- 120
However, browser window size and screen resolution may influence the actual coordinates and may fail these test cases. Since the test suite doesn't specify cy.viewpoint, it will default to an application viewport of 1000 × 660. The correctness depends on several hidden assumptions:
- Cypress continues using the same viewport.
- The ramp continues having approximately the same width.
If possible, describe the solution
Change to use the percentage, which is point's x coordinates divide by the whole length of the chart. The percentage would be better derived from commit timestamp and the displayed time period.
If applicable, describe alternatives you've considered
Additional context
What feature(s) would you like to see in RepoSense
Test cases use percentile instead of number of pixel to represent the point to click.
Is the feature request related to a problem?
Right now in frontend cypress tests, many test cases related to the
chartViewhas hard-coded coordinates. As an example, in testcasesubzoom panel range should work correctly when timeline is optimisedin filechartView_optimiseTimeline.cy.jsHowever, browser window size and screen resolution may influence the actual coordinates and may fail these test cases. Since the test suite doesn't specify
cy.viewpoint, it will default to an application viewport of 1000 × 660. The correctness depends on several hidden assumptions:If possible, describe the solution
Change to use the percentage, which is point's x coordinates divide by the whole length of the chart. The percentage would be better derived from commit timestamp and the displayed time period.
If applicable, describe alternatives you've considered
Additional context