I think we can have some tests related to dropdown fields like:
1. Check if a dropdown does (not) have the given value(s)
2. Check if the given value(s) is (not) "selected" in the dropdown

The tests should work for both single and multi-select dropdowns.

Any thoughts?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

eliza411’s picture

Those both seem valuable to me ... lots of use cases to see that a choice is presented to some users and not to others.

kssundar’s picture

Title: Tests to manipulate dropdowns » Steps to validate dropdown values

Updating title to better reflect the summary

sachin2dhoni’s picture

Title: Steps to validate dropdown values » Tests to manipulate dropdowns
Assigned: Unassigned » sachin2dhoni
sachin2dhoni’s picture

Status: Active » Needs review
Issue tags: +sprint 17
FileSize
7.35 KB

Uploading the patch

jhedstrom’s picture

Status: Needs review » Needs work

The feature file should be tagged @api, and instead of manually logging the user in, should use the Given I am logged in as a user with the "administrator" role step as a background.

Since the mink extension uses the 'select' terminology, I'd like to continue using that here instead of 'dropdown'. Also, I wonder if this would be better as a pull request to the mink extension, since there's nothing Drupal-specific in here.

eliza411’s picture

Assigned: sachin2dhoni » eliza411
Issue summary: View changes

I'm tempted to mark this as closed, won't fix, since it's been hanging around a while and is definitely not Drupal-specific (although it is useful).

I might make the changes jhedstrom suggested and place it as a minkextension request or at least add it to the useful snippet page.