Closed pguermo closed 10 years ago
Wait validation before closing the issue
Why select the tab based on its title instead of its name ? Title can change w.r.t. selected language for example. For me we should use the name of the component in the tab and not the title, as we do for other components (e.g. we click on a button based on its name not on its label).
Selecting the tab from the index is worse, that's why this issue has been created.
2014-09-16 10:31 GMT+02:00 Laurent Vanboquestal notifications@github.com:
It is also possible to select the tab from the index ... I don't know if it helps ...
void selectTab(String tabbedPaneComponentName, int tabIndex) throws QTasteException;
On Tue, Sep 16, 2014 at 10:17 AM, dergo notifications@github.com wrote:
Why select the tab based on its title instead of its name ? Title can change w.r.t. selected language for example. For me we should use the name of the component in the tab and not the title, as we do for other components (e.g. we click on a button based on its name not on its label).
Reply to this email directly or view it on GitHub https://github.com/qspin/qtaste/issues/95#issuecomment-55710249.
Reply to this email directly or view it on GitHub https://github.com/qspin/qtaste/issues/95#issuecomment-55711635.
Indeed David, the idea is to be able to select a tab based on an know label (i had in mind the tab has no name but only a title) instead of having to loop through all tabs and check whether the target component is visible
Actually a tab is composed of a title and a component (generally a panel), which can have a name. So it's easy to implement tab selection based on the component name.
2014-09-16 10:42 GMT+02:00 pguermo notifications@github.com:
Indeed David, the idea is to be able to select a tab based on an know label (i had in mind the tab has no name but only a title) instead of having to loop through all tabs and check whether the target component is visible
Reply to this email directly or view it on GitHub https://github.com/qspin/qtaste/issues/95#issuecomment-55712699.
Now 3 verbs are available to select a tab: selectTab (by index) selectTabTitled (by title) (NEW) selectTabId (by componentId)
Issue to be validated before close.
This feature is tested through the PlayBack testsuite! Validation OK!
TabbedPaneSelection test of PlayBack testsuite doesn't test it correctly: it just calls the methods but doesn't check that it succeeds.
Also subtitle must be updated for testChangeTabByTitle() and testChangeTabById() + remove useless title = ""
and id = ""
+ move component = testData.getValue("TAB_COMPONENT_NAME")
outside of the methods.
Tested manually with interactive mode sucessfully! But it is true that our JavaGUI api doesn't have any method to check the current selected Tab !!! ( should be added to automate validation)
Now, it is only possible to select a tab using an index and there is no way to know its Title. There is no clean way to identify a tab...
You could identify the index of the tab using the method indexOfTab on the JTabbedPane:
((JTabbedPane)component).indexOfTab(mData[0].toString())