Файл загрузки Cypress выдает ошибку Не удалось выполнить 'atob' в 'окне' - PullRequest
0 голосов
/ 28 мая 2020
    cy.fixture('invitati100.xls').as('logo')
        cy.get('[name="fileLista"]').then(function($input) {
          // convert the logo base64 string to a blob
          return Cypress.Blob.base64StringToBlob(this.logo, 'application/vnd.ms-excel')
            .then((blob) => {
              // pass the blob to the fileupload jQuery plugin
              // used in your application's code
              // which initiates a programmatic upload
              $input.fileupload('add', { files: blob })
            })
    })

Выдает ошибку:

cypress_runner. : 159529 InvalidCharacterError: Failed to execute 'atob' on 'Window': The string to be decoded contains characters outside of the Latin1 range.
at http://platform/__cypress/runner/cypress_runner.js:1531:44
From previous event:
at Context.thenFn (http://platform/__cypress/runner/cypress_runner.js:69293:23)

Мы используем додзё в качестве фреймворка. Почему эта ошибка?

Спасибо!

1 Ответ

0 голосов
/ 28 мая 2020

Просто используйте этот плагин:

https://www.npmjs.com/package/cypress-file-upload

это очень просто и работает!

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...