1
//Click on File Upload and upload the DL
cy.get('p').contains('Upload your Document').parent('span').parent('button').click();
cy.fixture('./testData/JamesBondDL.png').then(fileContent => {
  cy.get('p').contains('Front Side').parent('div>div').find('input[type="file"]').attachFile({
    fileContent: fileContent.toString(),
    fileName: 'JamesBond.png',
    mimeType: 'image/png'
  });
});

// 我在 cypress/support/commands.js 下添加了导入包 // 即 import 'cypress-file-upload';

1

2

3

4

0 回答 0