mirror of
https://gitlab.com/gitlab-org/gitlab-foss.git
synced 2025-08-06 10:19:48 +00:00
20 lines
544 B
Ruby
20 lines
544 B
Ruby
# frozen_string_literal: true
|
|
|
|
module TestidHelpers
|
|
def has_testid?(testid, context: page, **kwargs)
|
|
context.has_selector?("[data-testid='#{testid}']", **kwargs)
|
|
end
|
|
|
|
def find_by_testid(testid, context: page, **kwargs)
|
|
context.find("[data-testid='#{testid}']", **kwargs)
|
|
end
|
|
|
|
def all_by_testid(testid, context: page, **kwargs)
|
|
context.all("[data-testid='#{testid}']", **kwargs)
|
|
end
|
|
|
|
def within_testid(testid, context: page, **kwargs, &block)
|
|
context.within("[data-testid='#{testid}']", **kwargs, &block)
|
|
end
|
|
end
|