The existing *_visible methods did not add functionality:
For #when_visible, it waited for the element to be present and then waited for the element to be visible. If an element is present, it exists and is visible. Therefore, the second wait on visibility is not necessary.
For #when_not_visible, the method did not actually work. It waited for the element to be present (ie calling #when_present) and then waited for it to be hidden. This should have been calling #when_not_present. However, like above, this is not necessary.
This change will:
#when_visible
with#when_present
#when_not_visible
with#when_not_present
The existing *_visible methods did not add functionality:
#when_visible
, it waited for the element to be present and then waited for the element to be visible. If an element is present, it exists and is visible. Therefore, the second wait on visibility is not necessary.#when_not_visible
, the method did not actually work. It waited for the element to be present (ie calling#when_present
) and then waited for it to be hidden. This should have been calling#when_not_present
. However, like above, this is not necessary.