Make datatable sortable by column - or auto-sort datatable columns


#1

When creating a datatable for lets say 10 conditions, each with 3 executions ( or 10 given, each has 3 whens), that gives me 30 tests.

Now if i want the tests sorted by condition, as in 1st condition, execution 1,2,3, then second condition, execution 1,2,3 i would sort the datatable by the first column.

This seems not possible now. I think a good implementation would be to give sort priority to columns by position, as in: tests get sorted first by first column, second by second etc

That way i could simply rearrange the columns with the arrows on top and the created tests would be sorted accordingly.

The sorting can help with the readability of the tests in the datatable, but more important: if the tests are to be done manually, i can sort them to be executable most easily.

In Short: make the datatable sort itself by columns from left to right.


#2

Hey @a.holl,

Thank you for taking the time to submit your suggestion.

For now, the tests are sorted by the order of the rows. For example, this datatable:

| Dataset name | p1 | p2             |
| Row 1        | 1  | a text         |
| Row 2        | 2  | another text   |
| Row 3        | 1  | a first label  |
| Row 4        | 2  | another label  |

Will created the tests sorted like this:

My test - Row1
My test - Row2
My test - Row3
My test - Row4

What you would like to do is having some sort command at the column name level so you can quickly get your datatable sorted by a parameter. If I reuse my example, a sort by “p1” would rearrange the datatable like this:

| Dataset name | p1 | p2             |
| Row 1        | 1  | a text         |
| Row 3        | 1  | a first label  |
| Row 2        | 2  | another text   |
| Row 4        | 2  | another label  |

That will create the tests sorted in this order:

My test - Row1
My test - Row3
My test - Row2
My test - Row4

Is this correct?