diff --git a/lib/wallaby/browser.ex b/lib/wallaby/browser.ex index e492a7d0..c31931a8 100644 --- a/lib/wallaby/browser.ex +++ b/lib/wallaby/browser.ex @@ -604,7 +604,9 @@ defmodule Wallaby.Browser do end @doc """ - Gets the Element's text value. + Gets the element's text value. + + If the element is not visible, the return value will be `""`. """ @spec text(parent) :: String.t @spec text(parent, Query.t) :: String.t diff --git a/lib/wallaby/element.ex b/lib/wallaby/element.ex index 61ac9cc7..718aade8 100644 --- a/lib/wallaby/element.ex +++ b/lib/wallaby/element.ex @@ -109,7 +109,9 @@ defmodule Wallaby.Element do end @doc """ - Returns the text from the element. + Gets the element's text value. + + If the element is not visible, the return value will be `""`. """ @spec text(t) :: String.t