Module: Playwright::LocatorUtils

Defined in:
lib/playwright/locator_utils.rb

Instance Method Summary collapse

Instance Method Details

#get_by_alt_text(text, exact: false) ⇒ Object



10
11
12
# File 'lib/playwright/locator_utils.rb', line 10

def get_by_alt_text(text, exact: false)
  locator(get_by_alt_text_selector(text, exact: exact))
end

#get_by_label(text, exact: false) ⇒ Object



14
15
16
# File 'lib/playwright/locator_utils.rb', line 14

def get_by_label(text, exact: false)
  locator(get_by_label_selector(text, exact: exact))
end

#get_by_placeholder(text, exact: false) ⇒ Object



18
19
20
# File 'lib/playwright/locator_utils.rb', line 18

def get_by_placeholder(text, exact: false)
  locator(get_by_placeholder_selector(text, exact: exact))
end

#get_by_role(role, **options) ⇒ Object



30
31
32
# File 'lib/playwright/locator_utils.rb', line 30

def get_by_role(role, **options)
  locator(get_by_role_selector(role, **(options.compact)))
end

#get_by_test_id(test_id) ⇒ Object



5
6
7
8
# File 'lib/playwright/locator_utils.rb', line 5

def get_by_test_id(test_id)
  test_id_attribute_name = ::Playwright::LocatorUtils.instance_variable_get(:@test_id_attribute_name)
  locator(get_by_test_id_selector(test_id_attribute_name, test_id))
end

#get_by_text(text, exact: false) ⇒ Object



22
23
24
# File 'lib/playwright/locator_utils.rb', line 22

def get_by_text(text, exact: false)
  locator(get_by_text_selector(text, exact: exact))
end

#get_by_title(text, exact: false) ⇒ Object



26
27
28
# File 'lib/playwright/locator_utils.rb', line 26

def get_by_title(text, exact: false)
  locator(get_by_title_selector(text, exact: exact))
end