entityFilesWithLongIntsUseStandardForm.js 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. // Issue: https://github.com/OliveTin/OliveTin/issues/616
  2. import { describe, it, before, after } from 'mocha'
  3. import { expect } from 'chai'
  4. import { By } from 'selenium-webdriver'
  5. import {
  6. getRootAndWait,
  7. getActionButtons,
  8. takeScreenshotOnFailure,
  9. waitForLogsPage,
  10. waitForExecutionComplete,
  11. } from '../../lib/elements.js'
  12. describe('config: entityFilesWithLongIntsUseStandardForm', function () {
  13. before(async function () {
  14. await runner.start('entityFilesWithLongIntsUseStandardForm')
  15. await getRootAndWait()
  16. })
  17. after(async () => {
  18. await runner.stop()
  19. })
  20. afterEach(function () {
  21. takeScreenshotOnFailure(this.currentTest, webdriver);
  22. });
  23. it('Entity buttons are rendered', async function() {
  24. await getRootAndWait()
  25. const buttons = await getActionButtons()
  26. expect(buttons).to.not.be.null
  27. expect(buttons).to.have.length(5)
  28. // Entity buttons are in numeric key order (0,1,2,3,4); first row is "INT with 10 numbers"
  29. const buttonInt10 = await buttons[0]
  30. expect(await buttonInt10.getAttribute('title')).to.be.equal('Test me INT with 10 numbers')
  31. await buttonInt10.click()
  32. await waitForLogsPage()
  33. await waitForExecutionComplete()
  34. const statusElement = await webdriver.findElement(By.css('.execution-dialog-status'))
  35. const statusText = await statusElement.getText()
  36. // The status should indicate success (not "Executing..." or "Failed")
  37. expect(statusText).to.not.include('Executing')
  38. expect(statusText).to.not.include('Failed')
  39. // Verify that we're on the execution page by checking the URL
  40. const currentUrl = await webdriver.getCurrentUrl()
  41. expect(currentUrl).to.include('/logs/')
  42. expect(currentUrl).to.not.equal(runner.baseUrl() + '/logs')
  43. });
  44. });