reporting_test.rb 908 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. require 'browser_test_helper'
  2. class ReportingTest < TestCase
  3. def test_only_show_active_reporting_profiles
  4. @browser = browser_instance
  5. login(
  6. username: 'master@example.com',
  7. password: 'test',
  8. url: browser_url,
  9. )
  10. tasks_close_all()
  11. report_profile_create(
  12. data: {
  13. name: 'active_report_profile',
  14. active: true,
  15. }
  16. )
  17. report_profile_create(
  18. data: {
  19. name: 'inactive_report_profile',
  20. active: false,
  21. }
  22. )
  23. click(
  24. css: 'a[href="#manage"]',
  25. )
  26. click(
  27. css: '.content.active a[href="#manage/report_profiles"]',
  28. )
  29. click(
  30. css: 'a[href="#report"]',
  31. )
  32. watch_for(
  33. css: '.content ul.checkbox-list',
  34. )
  35. labels = @browser.find_elements(css: '.content ul.checkbox-list .label-text').map(&:text)
  36. assert_equal labels, %w[-all- active_report_profile]
  37. end
  38. end