Skip to content

initial-sort flag not working on the columns other than the status result one #247

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

Closed
wanam opened this issue Oct 22, 2019 · 0 comments · Fixed by #248
Closed

initial-sort flag not working on the columns other than the status result one #247

wanam opened this issue Oct 22, 2019 · 0 comments · Fixed by #248

Comments

@wanam
Copy link
Contributor

wanam commented Oct 22, 2019

I'm trying to set an initial order on the test name instead of the result status column, but it does not seem to work.

Here is what how i'm doing it:
` def pytest_html_create_batch_table_header(self, cells):

    # # Set initial-sort on test column
    cells[2].attr.class_ = 'sortable initial-sort'
    cells[0].attr.class_ = 'sortable result'

`
I see the sort icon on the 3 column but it's not sorted, it is still sorted for the first column.
Otherwise it would be great to have a hook or command line option for the default sorting column.

wanam added a commit to wanam/pytest-html that referenced this issue Oct 22, 2019
Currently it only sets the toggles for initial sort columns without actually doing the sorting.
This fixes pytest-dev#247
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant