B2G/QA/Automation/Style Guide/Python Script Style: Difference between revisions

(→‎Variable naming: content added)
Line 102: Line 102:
</source>
</source>


== Using high-level methods ==
== Using high-level methods <jlorenzo>==
TBD - jlorenzo
* In a test script, make sure to only have steps that are high level.  Details can be encapsulated in the helper methods.
* In a test, make sure to only have steps that are high level (for instance: messages.send_an_sms_to_yourself() instead of detailing every single tap and click)
<source python>
# good
messages.send_an_sms_to_yourself()
# bad
messages.open_sms_app()
messages.create_new_sms(receiver)
messages.type_content(content)
messages.send()
</source>
 
== Avoid sleep() calls <njpark> ==
== Avoid sleep() calls <njpark> ==
Sleep methods can be used as follows:
Sleep methods can be used as follows:
352

edits