Improve bookmark_options()
Currently helpers/general.py > bookmark_options(option) is essentially a general click function. I want to improve this function to be more specific to what it is named as and is intended for; a click bookmark option function.
-
Determine what this option set is referencing, as I currently don't understand where in Firefox UI this option list exists.
-
Rename the function to click_bookmark_option(option) (or whatever, based on what is actually being accessed here)
-
instead of passing in an image to click, we want to pass in a string parameter to the function to tell it which bookmark option to click for us.
-
Have the function contain all of the possible options, including their references to associated patterns. Check that the requested option pattern exists, then click it.
-
Add an appropriate wait so whatever each click does has time to occur before control is passed back to the test.
-
All images should be moved out of bookmarks_tests and into helpers image directories.
Hi Tracy,
bookmark_options() represent a simple helper function that is designed for helping us to manipulate different options that a bookmark can have like "cut", "copy", "delete", "properties" etc.
Right now the function uses images as patterns but like you said we can use strings as parameters. If we'll gonna keep images I think you're right, we can move all the "option" patterns into helpers image directories.
And also, for the 4th point that you mentioned, we already have an wait for option to be clickable but if you are referring at something else I'm a little bit confused.
Per conversation with Ionut, we are talking about the context menu of a bookmark that we want to access. I think the test case should right_click() the bookmark, then call our new function for which option to click.
def click_bookmark_option(option)
The function will then ensure the image of the option is present, then click the appropriate option.
The function could be called from any bookmark, anywhere; toolbar, Library or sidebar.