i18n.spec.js 890 B

1234567891011121314151617181920212223242526272829303132
  1. var test = require('tape')
  2. var Driver = require('./Driver')
  3. var By = Driver.By
  4. var collectErrors = Driver.collectErrors
  5. test('i18n: make sure Uppy loads with Russian language pack', function (t) {
  6. t.plan(1)
  7. var driver = Driver.setDriver()
  8. function findLabelTextElement () {
  9. return driver.findElements(By.css('.UppyDragDrop-label')).then(function (result) {
  10. return result[0]
  11. })
  12. }
  13. driver.get('http://localhost:4000/examples/i18n')
  14. driver.wait(findLabelTextElement, 8000, 'Uppy should load within 8 seconds')
  15. .then(function (element) {
  16. element.getText().then(function (value) {
  17. collectErrors(driver).then(function () {
  18. t.equal(value, 'Выберите файл или перенесите его сюда')
  19. driver.quit()
  20. })
  21. })
  22. })
  23. .catch(function (err) {
  24. t.fail(err)
  25. driver.quit()
  26. })
  27. })