Skip to content

Ability to select by index within .select() command #757

Closed
@dhoko

Description

@dhoko

#4239

  • Operating System: GNU/Linux Ubuntu 17.04
  • Cypress Version: "_from": "cypress@^1.0.1", "_id": "cypress@1.0.2",
  • Browser Version: Google Chrome Version 61.0.3163.100 (Official Build) (64-bit)

Current behavior:

screenshot from 2017-10-18 10-02-19

Desired behavior:

I can select this option, via an index inside the argument option.

How to reproduce:

<select id="country">
   <option label="United States" value="object:44" selected="selected">United States</option>
   <option label="United Kingdom" value="object:45">United Kingdom</option>
   <option label="Switzerland" value="object:46">Switzerland</option>
   <option label="France" value="object:47">France</option>
   <option label="Germany" value="object:48">Germany</option>
   <option label="Canada" value="object:49">Canada</option>
   <option disabled="" label="------------------" value="object:50">------------------</option>
   <option label="Estonia" value="object:117">Estonia</option>
   <option label="Ethiopia" value="object:118">Ethiopia</option>
   <option label="Falkland Islands (Malvinas)" value="object:119">Falkland Islands (Malvinas)</option>
   <option label="Faroe Islands" value="object:120">Faroe Islands</option>
   <option label="Fiji" value="object:121">Fiji</option>
   <option label="Finland" value="object:122">Finland</option>
   <option label="France" value="object:123">France</option>
   <option label="French Guiana" value="object:124">French Guiana</option>
   <option label="French Polynesia" value="object:125">French Polynesia</option>
   <option label="French Southern Territories" value="object:126">French Southern Territories</option>
</select>

Test code:

cy.get('#country').select('France');

Additional Info (images, stack traces, etc)

I tried to create the patch myself (it seems the error is here ->

if (num = options.$el.length) and num > 1
) but I cannot find the file inside node_modules :/

PS: Cypress is awesome ❤️

Metadata

Metadata

Labels

good first issueGood for newcomerspkg/driverThis is due to an issue in the packages/driver directorytype: featureNew feature that does not currently exist

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions