4
0

entityFilesWithLongIntsUseStandardForm.js 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. // Issue: https://github.com/OliveTin/OliveTin/issues/616
  2. import { describe, it, before, after } from 'mocha'
  3. import { expect } from 'chai'
  4. import {
  5. getRootAndWait,
  6. getActionButtons,
  7. closeExecutionDialog,
  8. takeScreenshotOnFailure,
  9. getExecutionDialogOutput,
  10. } from '../lib/elements.js'
  11. describe('config: entities', function () {
  12. before(async function () {
  13. await runner.start('entityFilesWithLongIntsUseStandardForm')
  14. })
  15. after(async () => {
  16. await runner.stop()
  17. })
  18. afterEach(function () {
  19. takeScreenshotOnFailure(this.currentTest, webdriver);
  20. });
  21. it('Entity buttons are rendered', async function() {
  22. await getRootAndWait()
  23. const buttons = await getActionButtons()
  24. expect(buttons).to.not.be.null
  25. expect(buttons).to.have.length(5)
  26. const buttonInt10 = await buttons[2]
  27. expect(await buttonInt10.getAttribute('title')).to.be.equal('Test me INT with 10 numbers')
  28. await buttonInt10.click()
  29. expect(await getExecutionDialogOutput()).to.be.equal('1234567890\n', 'Expected output to be an int')
  30. await closeExecutionDialog()
  31. const buttonFloat10 = await buttons[0]
  32. expect(await buttonFloat10.getAttribute('title')).to.be.equal('Test me FLOAT with 10 numbers')
  33. await buttonFloat10.click()
  34. expect(await getExecutionDialogOutput()).to.be.equal('1.234568\n', 'Expected output to be a float')
  35. });
  36. });