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

Cucumber converts a Map from DataTable where the key order is basically random instead of using the original order #764

Closed
DavidGangel opened this issue Aug 29, 2014 · 3 comments

Comments

@DavidGangel
Copy link

Debug the follwoing code especially when it converts to Map.
You will see that on every run the key order will be different.

@OpenTheApplication
Scenario: Check the default look and feel of the search result page
Given I see the Home page
And the page is in "Logged_OUT" state
Then the searchbox has text as "NORMAL"
Given I am inputing the "free" string as searchterm
When I am clicking search icon
Then I am getting the Search result page
And I should see 16 book
And I should see "free" as the header of the page
Then I have the following filters in order and in different states:
| LANGUAGE | EXPANDED |
| PRICE | EXPANDED |
| FORMAT | EXPANDED |
| PROTECTION | COLLAPSED |
| CATEGORY | COLLAPSED |
| RATING | COLLAPSED |
| RELEASE_DATE | COLLAPSED |

@then("^I have the following filters in order and in different states:$")
public void i_have_the_following_filters_in_order_and_in_different_states(DataTable inputTable) throws Exception {
Map<FiltersEnum, State> test = inputTable.asMap(FiltersEnum.class, State.class);
System.out.print("fg");
}

@aslakhellesoy
Copy link
Contributor

I think it would make sense if the returned map is a java.util.LinkedHashMap (iteration order = insertion order).

Would you be interested in sending a pull request for this? It should be a simple change and a new unit test.

@tomdcc
Copy link
Contributor

tomdcc commented Sep 2, 2014

Yay!

@lock
Copy link

lock bot commented Oct 25, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Oct 25, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants