I think there will be a problem if (during beforeEach() execution) addMenu() is successful, but addMenuItem() fails. Then removeMenuItem() will fail here, and removeMenu() will not get called. Possible solutions:

1. Maybe getMenuItemState() can be used to determine if the menu item exists.

2. Call removeMenuItem() even if removeMenuItem() fails.