Function When_I_select_file

  • When I select file:

    When I select file {string}
    

    Selects a file in an HTML5 input element.

    Parameters

    • file: string
    • Optionaloptions: DataTable

    Returns void

    Select file:

    When I select file "cypress/fixtures/example.json"
    

    Drag and drop file:

    When I select file "cypress/fixtures/example.json"
    | action | drag-drop |

    Force the action when input is not visible:

    When I select file "cypress/fixtures/example.json"
    | force | true |

    A preceding step like "When I get element by selector" is required. For example:

    When I get element by selector "input[type=file]"
    And I select file "cypress/fixtures/example.json"