librelist archives

« back to archive

Menu bar items

Menu bar items

From:
Lasslett, Jeff
Date:
2011-08-10 @ 05:59
Greetings,

I have just started using melomel/cucumber and I am trying to write a few 
'features' that test some recently developmed functionality.
Where I am having difficulty is in getting my step definitions to operate 
my applications menu bar.

I have the following step definitions:-

When /^I click menu bar item "([^"]*)"$/ do |menu_item|
  item = Melomel.find( 'mx.controls.menuClasses.MenuBarItem', :label => 
menu_item )
  item.click
end


When /^I click menu item "([^"]+)"$/ do |menu_item|
  item = Melomel.find( 'mx.controls.menuClasses.MenuItemRenderer', :label 
=> menu_item )
  item.click
end


In the first step, melomel.find() doesn't find the MenuBarItem.   This 
might be due to a MenuBarItem label not being a string.  I'm not sure.

I would appreciate any advice on using melomel/cucumber to ineract with my
flex app' s menu bar.

Thanks,

Jeff

Worldwide Confidentiality Note: Dissemination, distribution or copying of 
this email or the information herein by anyone other than the intended 
recipient, or an employee or agent of a system responsible for delivering 
the message to the intended recipient, is prohibited. If you are not the 
intended recipient, please inform the sender and delete all copies.
The company does not accept credit card information via fax or email. To 
process a payment please contact our customer service department in either
Australia (1300 735 292) or New Zealand (0800 933 966).

Re: [melomel] Menu bar items

From:
Audefroy Marc
Date:
2011-08-10 @ 07:39
Greetings,

I'm Marc Audefroy(I'm french, sorry for my mistake);

I can maybe help you because I have started using melomel/cucumber the last week.

A MenuBarItem label is a mx.core:IUITextField and this might be due to 
it's a protected properties.
Try with a other property.

I hope you have a little help. But try to contact Benb Johnson. I think 
that he may help you. 

Marc


On 10 août 2011, at 07:59, Lasslett, Jeff wrote:

> Greetings,
> 
> I have just started using melomel/cucumber and I am trying to write a 
few 'features' that test some recently developmed functionality.
> Where I am having difficulty is in getting my step definitions to 
operate my applications menu bar.
> 
> I have the following step definitions:-
> 
> When /^I click menu bar item "([^"]*)"$/ do |menu_item|
>  item = Melomel.find( 'mx.controls.menuClasses.MenuBarItem', :label => 
menu_item )
>  item.click
> end
> 
> 
> When /^I click menu item "([^"]+)"$/ do |menu_item|
>  item = Melomel.find( 'mx.controls.menuClasses.MenuItemRenderer', :label
=> menu_item )
>  item.click
> end
> 
> 
> In the first step, melomel.find() doesn't find the MenuBarItem.   This 
might be due to a MenuBarItem label not being a string.  I'm not sure.
> 
> I would appreciate any advice on using melomel/cucumber to ineract with 
my flex app' s menu bar.
> 
> Thanks,
> 
> Jeff
> 
> Worldwide Confidentiality Note: Dissemination, distribution or copying 
of this email or the information herein by anyone other than the intended 
recipient, or an employee or agent of a system responsible for delivering 
the message to the intended recipient, is prohibited. If you are not the 
intended recipient, please inform the sender and delete all copies.
> The company does not accept credit card information via fax or email. To
process a payment please contact our customer service department in either
Australia (1300 735 292) or New Zealand (0800 933 966).

Re: [melomel] Menu bar items

From:
Lasslett, Jeff
Date:
2011-08-10 @ 23:20
Hi Ben,

Thanks for your reply.  I'd like to do option 2.  I'll get something going
that will be useful to others and send you that pull request.  :-)

Jeff


________________________________________
From: melomel@librelist.com [melomel@librelist.com] On Behalf Of Ben 
Johnson [benbjohnson@yahoo.com]
Sent: Thursday, 11 August 2011 5:47 AM
To: melomel@librelist.com
Subject: Re: [melomel] Menu bar items

Jeff-

Marc is right that the 'label' property is a protected UITextField object 
and you can't do a string comparison on it. There are two options to find 
your menu items:

1. Create and use a subclass of MenuBarItem that has a field called 
labelText that is a getter function that retrieves label.text. Then in 
your Melomel.find() call just use :labelText instead of :label. This is 
intrusive in your app since you'd have to add a new class just for your 
testing. However, it's fairly easy.

2. The cleaner approach is to create a method similar to 
melomel.core.UI#findAll() that will check against the MenuBar's 
labelFunction() or itemToLabel() methods when evaluating MenuBarItem 
objects. This is really something that should be added to the Melomel 
code. If you can get a fix in place feel free to send a pull request on 
GitHub.

I went ahead and added a GitHub Issue for this:

https://github.com/benbjohnson/melomel/issues/31


Ben

________________________________
From: "Lasslett, Jeff" <jeff.lasslett@thermofisher.com>
To: melomel@librelist.com
Sent: Wednesday, August 10, 2011 2:03 AM
Subject: RE: [melomel] Menu bar items

Hi Marc,

Merci for your reply.  I think I will have to try some property other than
'label'.

I should also mention that I tried to use the melomel built in step 'When 
I select "<blah>" on the "<foo>" list'
but with no success.  I tried this because menu bar items are Menu 
objects, and menu objects are List objects.


Jeff
________________________________________
From: melomel@librelist.com<mailto:melomel@librelist.com> 
[melomel@librelist.com<mailto:melomel@librelist.com>] On Behalf Of 
Audefroy Marc 
[marc.audefroy@openskymap.net<mailto:marc.audefroy@openskymap.net>]
Sent: Wednesday, 10 August 2011 5:39 PM
To: melomel@librelist.com<mailto:melomel@librelist.com>
Subject: Re: [melomel] Menu bar items

Greetings,

I'm Marc Audefroy(I'm french, sorry for my mistake);

I can maybe help you because I have started using melomel/cucumber the last week.

A MenuBarItem label is a mx.core:IUITextField and this might be due to 
it's a protected properties.
Try with a other property.

I hope you have a little help. But try to contact Benb Johnson. I think 
that he may help you.

Marc


On 10 août 2011, at 07:59, Lasslett, Jeff wrote:

> Greetings,
>
> I have just started using melomel/cucumber and I am trying to write a 
few 'features' that test some recently developmed functionality.
> Where I am having difficulty is in getting my step definitions to 
operate my applications menu bar.
>
> I have the following step definitions:-
>
> When /^I click menu bar item "([^"]*)"$/ do |menu_item|
>  item = Melomel.find( 'mx.controls.menuClasses.MenuBarItem', :label => 
menu_item )
>  item.click
> end
>
>
> When /^I click menu item "([^"]+)"$/ do |menu_item|
>  item = Melomel.find( 'mx.controls.menuClasses.MenuItemRenderer', :label
=> menu_item )
>  item.click
> end
>
>
> In the first step, melomel.find() doesn't find the MenuBarItem.  This 
might be due to a MenuBarItem label not being a string.  I'm not sure.
>
> I would appreciate any advice on using melomel/cucumber to ineract with 
my flex app' s menu bar.
>
> Thanks,
>
> Jeff
>
> Worldwide Confidentiality Note: Dissemination, distribution or copying 
of this email or the information herein by anyone other than the intended 
recipient, or an employee or agent of a system responsible for delivering 
the message to the intended recipient, is prohibited. If you are not the 
intended recipient, please inform the sender and delete all copies.
> The company does not accept credit card information via fax or email. To
process a payment please contact our customer service department in either
Australia (1300 735 292) or New Zealand (0800 933 966).


Re: [melomel] Menu bar items

From:
Lasslett, Jeff
Date:
2011-08-10 @ 08:03
Hi Marc,

Merci for your reply.  I think I will have to try some property other than
'label'.

I should also mention that I tried to use the melomel built in step 'When 
I select "<blah>" on the "<foo>" list'
but with no success.  I tried this because menu bar items are Menu 
objects, and menu objects are List objects.


Jeff
________________________________________
From: melomel@librelist.com [melomel@librelist.com] On Behalf Of Audefroy 
Marc [marc.audefroy@openskymap.net]
Sent: Wednesday, 10 August 2011 5:39 PM
To: melomel@librelist.com
Subject: Re: [melomel] Menu bar items

Greetings,

I'm Marc Audefroy(I'm french, sorry for my mistake);

I can maybe help you because I have started using melomel/cucumber the last week.

A MenuBarItem label is a mx.core:IUITextField and this might be due to 
it's a protected properties.
Try with a other property.

I hope you have a little help. But try to contact Benb Johnson. I think 
that he may help you.

Marc


On 10 août 2011, at 07:59, Lasslett, Jeff wrote:

> Greetings,
>
> I have just started using melomel/cucumber and I am trying to write a 
few 'features' that test some recently developmed functionality.
> Where I am having difficulty is in getting my step definitions to 
operate my applications menu bar.
>
> I have the following step definitions:-
>
> When /^I click menu bar item "([^"]*)"$/ do |menu_item|
>  item = Melomel.find( 'mx.controls.menuClasses.MenuBarItem', :label => 
menu_item )
>  item.click
> end
>
>
> When /^I click menu item "([^"]+)"$/ do |menu_item|
>  item = Melomel.find( 'mx.controls.menuClasses.MenuItemRenderer', :label
=> menu_item )
>  item.click
> end
>
>
> In the first step, melomel.find() doesn't find the MenuBarItem.   This 
might be due to a MenuBarItem label not being a string.  I'm not sure.
>
> I would appreciate any advice on using melomel/cucumber to ineract with 
my flex app' s menu bar.
>
> Thanks,
>
> Jeff
>
> Worldwide Confidentiality Note: Dissemination, distribution or copying 
of this email or the information herein by anyone other than the intended 
recipient, or an employee or agent of a system responsible for delivering 
the message to the intended recipient, is prohibited. If you are not the 
intended recipient, please inform the sender and delete all copies.
> The company does not accept credit card information via fax or email. To
process a payment please contact our customer service department in either
Australia (1300 735 292) or New Zealand (0800 933 966).

Re: [melomel] Menu bar items

From:
Ben Johnson
Date:
2011-08-10 @ 19:47
Jeff-

Marc is right that the 'label' property is a protected UITextField object 
and you can't do a string comparison on it. There are two options to find 
your menu items:

1. Create and use a subclass of MenuBarItem that has a field called 
labelText that is a getter function that retrieves label.text. Then in 
your Melomel.find() call just use :labelText instead of :label. This is 
intrusive in your app since you'd have to add a new class just for your 
testing. However, it's fairly easy.

2. The cleaner approach is to create a method similar to 
melomel.core.UI#findAll() that will check against the MenuBar's 
labelFunction() or itemToLabel() methods when evaluating MenuBarItem 
objects. This is really something that should be added to the Melomel 
code. If you can get a fix in place feel free to send a pull request on 
GitHub.

I went ahead and added a GitHub Issue for this:

https://github.com/benbjohnson/melomel/issues/31


Ben


________________________________
From: "Lasslett, Jeff" <jeff.lasslett@thermofisher.com>
To: melomel@librelist.com
Sent: Wednesday, August 10, 2011 2:03 AM
Subject: RE: [melomel] Menu bar items

Hi Marc,

Merci for your reply.  I think I will have to try some property other than
'label'.

I should also mention that I tried to use the melomel built in step 'When 
I select "<blah>" on the "<foo>" list'
but with no success.  I tried this because menu bar items are Menu 
objects, and menu objects are List objects.


Jeff
________________________________________
From: melomel@librelist.com [melomel@librelist.com] On Behalf Of Audefroy 
Marc [marc.audefroy@openskymap.net]
Sent: Wednesday, 10 August 2011 5:39 PM
To: melomel@librelist.com
Subject: Re: [melomel] Menu bar items

Greetings,

I'm Marc Audefroy(I'm french, sorry for my mistake);

I can maybe help you because I have started using melomel/cucumber the last week.

A MenuBarItem label is a mx.core:IUITextField and this might be due to 
it's a protected properties.
Try with a other property.

I hope you have a little help. But try to contact Benb Johnson. I think 
that he may help you.

Marc


On 10 août 2011, at 07:59, Lasslett, Jeff wrote:

> Greetings,
>
> I have just started using melomel/cucumber and I am trying to write a 
few 'features' that test some recently developmed functionality.
> Where I am having difficulty is in getting my step definitions to 
operate my applications menu bar.
>
> I have the following step definitions:-
>
> When /^I click menu bar item "([^"]*)"$/ do |menu_item|
>  item = Melomel.find( 'mx.controls.menuClasses.MenuBarItem', :label => 
menu_item )
>  item.click
> end
>
>
> When /^I click menu item "([^"]+)"$/ do |menu_item|
>  item = Melomel.find( 'mx.controls.menuClasses.MenuItemRenderer', :label
=> menu_item )
>  item.click
> end
>
>
> In the first step, melomel.find() doesn't find the MenuBarItem.   This 
might be due to a MenuBarItem label not being a string.  I'm not sure.
>
> I would appreciate any advice on using melomel/cucumber to ineract with 
my flex app' s menu bar.
>
> Thanks,
>
> Jeff
>
> Worldwide Confidentiality Note: Dissemination, distribution or copying 
of this email or the information herein by anyone other than the intended 
recipient, or an employee or agent of a system responsible for delivering 
the message to the intended recipient, is prohibited. If you are not the 
intended recipient, please inform the sender and delete all copies.
> The company does not accept credit card information via fax or email. To
process a payment please contact our customer service department in either
Australia (1300 735 292) or New Zealand (0800 933 966).