-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improving the docs: browser testing! #115
Comments
Thanks for bringing this up! There is a difference between truthy and true. I don't think we should issue guidance on what type of syntax to use. It looks like all the syntax above is in Jasmine, which is the best supported tool for Protractor, but there's been talk about switching to Mocha Chai to keep it consistent with our unit tests. We also want to leave ourselves open in case there's a better tool for testing other things like React. I think we should describe what is used rather than offer guidelines here. (Also, I'm not sure what syntax uses |
Then maybe that's all the guidance needed, rather than syntax standards: "When looking at how things evaluate, be as strict as possible." (Personal note: when first starting Jasmine/Protractor browser tests at the Bureau, I had tests written using Finally, |
@sebworks has some good starter notes here: https://gist.github.com/sebworks/edb4c89c4e8c244812f2dac3d6f77a89 I'm prodding him to add to them to the repo! |
The testing guidelines have very little information about what functional browser testing looks like in D&D, and the stuff that's there now might be a bit out-of-date.
Also, in different code reviews of the same browser test spec, I've received conflicting information from reviewers about what "best practice" should be for a particular line. Maybe we could add some more guidance around what our best practices are for browser testing?
Current behavior
From the "Browser testing" section of the "Testing" guidelines page:
From the code reviews I've described: no guidance on whether we have a clear preference for
toBe.(true)
vs.toBeTruthy()
vs.toBeTrue()
, and when we might choose one over another.Expected behavior
protractor
in the description of what we use. It's used across consumerfinance.gov in general (and particularly on some specific tools)..toBeTrue()
or.toBe(true)
to evaluate the value produced by something like.isDisplayed()
rather thantoBeTruthy()
(because.isDisplayed()
will always deliver aBoolean
promise), we could state that. And if we truly want it up to the discretion of each individual programmer, we state that.The text was updated successfully, but these errors were encountered: