Get input elements with the given value

<div id="inputs">
  <input type="text" id="i1" />
  <input type="text" id="i2" />
  <input type="text" id="i3" value="fox" />
// change one of the inputs by typing "fox" into it

Find all input elements with value "fox"

// NOTE: only the elements with the markup attribute "value" are returned
cy.get('#inputs input[value=fox]').should('have.length', 1)

If we want to find the input elements with the current run-time value, we need to get all potential input elements and filter them using the cy.filter(callback) command.

cy.get('#inputs input')
  .filter((k, el) => {
    return el.value === 'fox'
  // finds both input elements with the value "fox"
  .should('have.length', 2)

Watch the video Find Input Elements With The Given Value Using cy.filter Commandopen in new window.