{
prevSubject: 'element',
},
- (subject, file, fileName) => {
+ (subject, file, fileName, binaryMode = true) => {
cy.window().then(window => {
- const blob = b64toBlob(file, '', 512);
+ const blob = binaryMode
+ ? b64toBlob(file, '', 512)
+ : new Blob([file], {type: 'text/plain'});
const testFile = new window.File([blob], fileName);
cy.wrap(subject).trigger('drop', {
// From https://github.com/cypress-io/cypress/issues/7306#issuecomment-1076451070=
// This command requires the async package (https://www.npmjs.com/package/async)
Cypress.Commands.add('waitForDom', () => {
- cy.window().then(win => {
+ cy.window().then({
+ // Don't timeout before waitForDom finishes
+ timeout: 10000
+ }, win => {
let timeElapsed = 0;
cy.log("Waiting for DOM mutations to complete");