qspin / qtaste

[NEW RELEASE VERSION 3.0.0] The QTaste is an open-source functional and non-functional test environment offering services to developers and testers. It has been implemented following a data driven testing philosophy.
http://www.qtaste.org
GNU Lesser General Public License v3.0
6 stars 11 forks source link

Add verb selectTab(String tabbedPaneComponentName, String tabName) in JavaGui #95

Closed pguermo closed 10 years ago

pguermo commented 10 years ago

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())

simjan commented 10 years ago

Wait validation before closing the issue

dergo commented 10 years ago

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).

dergo commented 10 years ago

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.

pguermo commented 10 years ago

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

dergo commented 10 years ago

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.

nfac commented 10 years ago

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.

lvboque commented 10 years ago

This feature is tested through the PlayBack testsuite! Validation OK!

dergo commented 10 years ago

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.

lvboque commented 10 years ago

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)