cypress-io / cypress-chrome-recorder

Export Cypress Tests from Google Chrome DevTools' Recorder
MIT License
226 stars 18 forks source link

Simple selectbox isn't working #57

Open bernhardh opened 11 months ago

bernhardh commented 11 months ago

Cypress Chrome Recorder doesn't work with simple selectboxes. Instead of using the select method, it uses the type method.

image

I have made just a very simple testpage, with an selectbox in it:

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>HTML 5 Boilerplate</title>
  </head>
  <body>

        <select id="select">
                <option></option>
                <option>Option 1</option>
                <option>Option 2</option>
                <option>Option 3</option>
                <option>Option 4</option>
        </select>
  </body>
</html>

Then I created a recording where i selected some options and exported it to cypress:

describe("Selectbox", () => {
  it("tests Selectbox", () => {
    cy.viewport(1151, 1329);
    cy.visit("https://webcaravel.at/select.html");
    cy.get("#select").type("Option 1");
    cy.get("html").click();
    cy.get("#select").type("Option 3");
  });
});

When I run this test, the selectbox doesn't change the option at all.

nagash77 commented 11 months ago

Hi @bernhardh , thank you submitting this issue. Unfortunately this issue will not be high enough priority for us to address in the near future. If you (or others int he community) are able to submit a fix for this issue we would happily accept a PR addressing this issue.