test.js 1.4 KB

1234567891011121314151617181920212223242526272829303132333435
  1. /* global browser */
  2. // const path = require('path')
  3. const { selectFakeFile, ensureInputVisible } = require('../utils')
  4. const testURL = 'http://localhost:4567/i18n-drag-drop'
  5. describe('File upload with DragDrop + XHRUpload, i18n translated string', function test () {
  6. this.retries(2)
  7. beforeEach(async () => {
  8. await browser.url(testURL)
  9. await browser.execute(ensureInputVisible, '#uppyi18n .uppy-DragDrop-input')
  10. })
  11. it('should upload a file with XHRUpload and set progressbar to 100%', async () => {
  12. // const testImage = path.join(__dirname, '../../resources/image.jpg')
  13. // if (supportsChooseFile(capabilities)) {
  14. // const input = await browser.$('#uppyi18n .uppy-DragDrop-input')
  15. // await input.setValue(testImage)
  16. // } else {
  17. // await browser.execute(selectFakeFile, 'uppyi18n')
  18. // }
  19. await browser.execute(selectFakeFile, 'uppyi18n')
  20. await browser.pause(5000)
  21. const percent = await browser.$('#uppyi18n-progress .uppy-ProgressBar-percentage')
  22. const html = await percent.getHTML(false)
  23. expect(Number(html)).to.be.equal(100)
  24. })
  25. it('should translate text strings into Russian', async () => {
  26. const label = await browser.$('#uppyi18n .uppy-DragDrop-label')
  27. const text = await label.getText()
  28. expect(text.trim()).to.be.equal('Перенесите файлы сюда или выберите')
  29. })
  30. })