TestSelector.Test.FlokiHelpers.find_test_values

You're seeing just the function find_test_values, go back to TestSelector.Test.FlokiHelpers module for more information.
Link to this function

find_test_values(string)

View Source

Specs

find_test_values(String.t() | Floki.html_tree()) :: list()

Returns a list of test values from given elements.

Examples

iex> text = ~S(<a test-selector="hello" test-value="world"></a><a test-selector="foo" test-value="bar"></a>)
iex> find_test_values(text)
["world", "bar"]

iex> tree = [{"a", [{"test-selector", "hello"}, {"test-value", "world"}], []}, {"a", [{"test-selector", "foo"}, {"test-value", "bar"}], []}]
iex> find_test_values(tree)
["world", "bar"]
Link to this function

find_test_values(string, value)

View Source

Specs

find_test_values(String.t() | Floki.html_tree(), String.t()) ::
  Floki.html_tree()

Returns a list of elements inside a string or HTML tree.

Examples

iex> text = ~S(<a test-selector="hello" test-value="world"></a><a test-selector="foo" test-value="bar"></a>)
iex> find_test_values(text, "bar")
[{"a", [{"test-selector", "foo"}, {"test-value", "bar"}], []}]

iex> tree = [{"a", [{"test-selector", "hello"}, {"test-value", "world"}], []}, {"a", [{"test-selector", "foo"}, {"test-value", "bar"}], []}]
iex> find_test_values(tree, "world")
[{"a", [{"test-selector", "hello"}, {"test-value", "world"}], []}]