test.js 1.0 KB

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