From 00a7b4efdfecb374e4827fa106503e689a4dd967 Mon Sep 17 00:00:00 2001 From: Mitchell Hanberg Date: Thu, 24 Oct 2019 08:36:33 -0400 Subject: [PATCH] Clarify documentation regarding retrieving hidden element text. (#474) --- lib/wallaby/browser.ex | 4 +++- lib/wallaby/element.ex | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) 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