inlineActions.mjs 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. import { describe, it, before, after } from 'mocha'
  2. import { assert } from 'chai'
  3. import {
  4. getRootAndWait,
  5. getActionButtons,
  6. takeScreenshotOnFailure,
  7. } from '../../lib/elements.js'
  8. describe('config: inlineActions', function () {
  9. before(async function () {
  10. await runner.start('inlineActions')
  11. })
  12. after(async () => {
  13. await runner.stop()
  14. })
  15. afterEach(function () {
  16. takeScreenshotOnFailure(this.currentTest, webdriver);
  17. });
  18. it('Inline dashboard actions are rendered as clickable buttons', async function () {
  19. await getRootAndWait()
  20. const buttons = await getActionButtons()
  21. assert.isArray(buttons, 'Action buttons should be an array')
  22. assert.isAtLeast(buttons.length, 1, 'There should be at least one action button')
  23. const texts = await Promise.all(buttons.map(b => b.getText()))
  24. const combinedText = texts.join(' ')
  25. assert.include(
  26. combinedText,
  27. 'Inline Dashboard Action',
  28. 'Inline dashboard action should be rendered as a button'
  29. )
  30. })
  31. })