Add tabs object to addons controller for easy pane switching

VERIFIED WONTFIX

Status

Testing Graveyard
Mozmill
P4
normal
VERIFIED WONTFIX
9 years ago
2 years ago

People

(Reporter: tchung, Unassigned)

Tracking

Details

(Reporter)

Description

9 years ago
Unlike the pref controller, there doesnt seem to be a convenient method to switch between tabs.

looking for something like: 
  controller.click(new elementslib.Elem(controller.tabs.Extensions.button));

Error thrown: message: controller.tabs is undefined

Can we have this added?  Thanks.
(Reporter)

Updated

9 years ago
Summary: AddonsController doesnt have a convenient method to switch tabs → getAddonsController() doesnt have a convenient method to switch tabs
Tony, you should better use those commands which are working fine for me:

var mozmill = {}; Components.utils.import('resource://mozmill/modules/mozmill.js', mozmill);
var elementslib = {}; Components.utils.import('resource://mozmill/modules/elementslib.js', elementslib);

var setupModule = function(module) {
  controller = mozmill.getAddonsController();
}

var testRecorded = function () {
  controller.click(new elementslib.ID(controller.window.document, "search-view"));
  controller.sleep(2000);
  controller.click(new elementslib.ID(controller.window.document, "themes-view"));
  controller.sleep(2000);
  controller.click(new elementslib.ID(controller.window.document, "extensions-view"));
}

Please close this bug as WFM if it works for you too. And yes, at any time the recorder can be a helpful instrument here to find the correct element representation.
Ok, after talking on IRC I can see what you mean. Looks like the tabs object doesn't exist for the addons controller. Thanks for the hint Tony!

Setting as P4. We can use the above mentioned method right now to create Mozmill tests.
Priority: -- → P4
Summary: getAddonsController() doesnt have a convenient method to switch tabs → Add tabs object to addons controller for easy pane switching
(Reporter)

Comment 3

9 years ago
P4 is fine.  While we're at it, can we create something a similar api controller for PageInfo as well?
We currently have two tabs APIs, one for the browser controller and one for the preferences window. The one for the browser controller is actually for accessing the document of different tabs not elements. And the one for the preferences window was created before we had the Lookup object to get at anonymous nodes.

Creating a one-off API for every single window seems like a bit much for us to handle on the dev team. 

I think the best way to handle these is to create an API inside the test repository for these and as they get adopted by test authors we can merge them in to mozmill itself. The mozmill test dev team won't have time to write one of these for every single window, and the implementation of those tabs isn't consistent enough to write a general API.
(In reply to comment #4)
> preferences window. The one for the browser controller is actually for
> accessing the document of different tabs not elements. And the one for the
> preferences window was created before we had the Lookup object to get at
> anonymous nodes.

The browser windows contain a dynamically list of tabs. It makes sense to have the tabs object accessible by tests and handled by MozMill itself. But having a look at the preferences window, the add-ons manager, or the page info window shows that those windows don't really have tabs. Those buttons switch between different panes. And in the special case for the preferences window we have tabs which exist onto a pane. Personally I would be in favor to remove the tabs object from the preferences controller, just to be consistent.

> I think the best way to handle these is to create an API inside the test
> repository for these and as they get adopted by test authors we can merge them
> in to mozmill itself. The mozmill test dev team won't have time to write one 

I feel we shouldn't spend time at all here. IMO "controller.click(new elementslib.ID(controller.window.document, "extensions-view"));" isn't more complicated as using tabs.

Mikeal, for the page info controller creation we should probably file a new bug?
Status: NEW → RESOLVED
Last Resolved: 9 years ago
Resolution: --- → WONTFIX
Status: RESOLVED → VERIFIED
(Assignee)

Updated

2 years ago
Product: Testing → Testing Graveyard
You need to log in before you can comment on or make changes to this bug.