Closed knewter closed 8 months ago
Patching format_potential_matches
to just inspect the whole third element in the tuple rather than matching it as a single-item list led to this error result, which is at least understandable:
1) test merchant can login (TinyposWeb.MerchantCanLoginTest)
test/tinypos_web/features/merchant_login_test.exs:4
** (ArgumentError) Could not find an element with given selectors.
I was looking for an element with one of these selectors:
Selector "input[type=submit][value=Get started]"
Selector "button" with content "Get started"
I found some elements that match the selector but not the content:
<button> tag with content [{"span", [{"class", "material-icons-outlined"}], ["\n email\n "]}, {"span", [{"class", "ml-2"}], ["Email login"]}]
<button> tag with content [{"span", [{"class", "mr-2"}], ["Get Started"]}, {"span", [{"class", "material-icons-outlined"}], ["\n arrow_circle_right\n "]}]
Thanks for all the investigation @knewter. Apologies for not having released that commit sooner. I was trying to get one more thing in before cutting another release.
When I run the test, it fails but it throws an exception when trying to tell me that it failed:
This is because it's trying to print the error message, but
format_potential_matches
assumes the third element is a single-item list with just a text node in it matching the text provided.Instead, it gets this:
This may not be expected usage, but the failure note throwing an exception seemed reportable.