OpenProject is the leading open source project management software.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
openproject/spec/support/components/work_packages/tabs_counter.rb

29 lines
823 B

require 'features/support/components/ui_autocomplete'
module Components
module WorkPackages
class Tabs
include Capybara::DSL
include RSpec::Matchers
include ::Components::UIAutocompleteHelpers
attr_reader :work_package
def initialize(work_package)
@work_package = work_package
end
# Check value of counter for the given tab
def expect_counter(tab, content)
expect(tab).to have_selector('[data-qa-selector="tab-count"]')
expect(tab).to have_selector('[data-qa-selector="tab-count"]', text: "(#{content})")
end
# Counter should not be displayed, if there are no relations or watchers
def expect_no_counter(tab)
expect(tab).to have_no_selector('[data-qa-selector="tab-count"]', wait: 10)
end
end
end
end