Complete the code to select a file for upload using Cypress.
cy.get('input[type="file"]').[1]('example.json')
The selectFile command is used in Cypress to simulate selecting a file for upload.
Complete the code to select a file with a specific file path.
cy.get('input[type="file"]').selectFile([1]: 'cypress/fixtures/sample.png'})
The filePath option specifies the path of the file to select in selectFile.
Fix the error in the code to correctly select multiple files.
cy.get('input[type="file"]').selectFile([[1]])
To select multiple files, pass an array of file paths inside selectFile.
Fill both blanks to select a file and assert the file name is correct.
cy.get('input[type="file"]').selectFile([1]).should('have.prop', [2])
Use { filePath: 'test.pdf' } to select the file and assert the first file's name with 'files[0].name'.
Fill all three blanks to select a file with contents and verify its size.
cy.get('input[type="file"]').selectFile([1]).then(fileInput => { expect(fileInput[0].files[0].[2]).to.equal([3]) })
Use { contents: 'Hello World', fileName: 'hello.txt' } to create a file with contents, check the size property, and expect it to equal 11 bytes.