Closed michaeljacobdavis closed 6 years ago
@archlichking Looks like the CI for Node v4/5 is failing because of appium-chromedriver
using some newer language features.
https://travis-ci.org/TestArmada/nightwatch-extra/jobs/411862132#L1233
👍 great stuff, thanks for the PR, i'll remove unit test for node@4 and node@5.
Background
Microsoft Edge was returning
null
for an empty inputsvalue
property. This led to errors like:A fix to avoid this error was added by https://github.com/TestArmada/nightwatch-extra/pull/108/files.
I added a test for this https://github.com/TestArmada/nightwatch-extra/pull/120/files#diff-e041bab4fb9b10009bf9334cde429064R143
The problem with this fix is is doing
client.elValueContains(selector, "")
on an empty input will now failI'm feel like that is incorrect and added the test https://github.com/TestArmada/nightwatch-extra/pull/120/files#diff-e041bab4fb9b10009bf9334cde429064R159 to make sure it passes.
Fixing Edge
For browsers returning
null
for empty inputs, we have no way to consistently test empty fields (since it could benull
or""
).We fix this by doing a null check and if true, fixing the
actual
value to what it should be via the spec https://github.com/TestArmada/nightwatch-extra/pull/120/files#diff-ffe0c41e69cbb1693549935cd322fd51R15and testing it with https://github.com/TestArmada/nightwatch-extra/pull/120/files#diff-e041bab4fb9b10009bf9334cde429064R149
I'd love some feedback on if I'm missing any edge cases or browser quirks. For non-input elements, value will be
undefined
so I don't see any false positives that way. Any other cases where thevalue
of an input would benull
?