html-report icon indicating copy to clipboard operation
html-report copied to clipboard

Sorting Specs by name not retained when a spec is clicked

Open DvagNic opened this issue 3 years ago • 2 comments

Actual and Expected behaviour

When I sort the specs by "Name" (top left button in the specification navbar), the specs are sorted correctly. As soon as I click on any spec, the sorting reverts to the default of all failed specs at the top. I would expect the sorting to remain until I click on any other button (Name or Execution time) or search for specs.

Steps to reproduce

  1. Open a html report with more than one spec
  2. Sort by "Name" and see the sorting change
  3. Click on a spec
  4. See the sorting change

Gauge version

Gauge version: 1.4.0
Plugins
-------
html-report (4.1.0)
python (0.3.17)
screenshot (0.1.0)
xml-report (0.2.3)

Screenshots

1 2

DvagNic avatar Aug 17 '21 09:08 DvagNic

The sorting preference is not saved at the moment, worth doing this. Thanks for reporting

sriv avatar Aug 19 '21 03:08 sriv

Dev notes:

in main.js for the default theme, consider storing the sorting preference in a cookie/local storage or as a query param, and read it when initializing the sort: https://github.com/getgauge/html-report/blob/master/themes/default/assets/js/main.js#L313

If anyone wants to contribute a PR, I'll review and merge asap!

sriv avatar Aug 19 '21 04:08 sriv