Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » SWTBot » small issue after upgrade to 2.2.0
small issue after upgrade to 2.2.0 [message #1235087] Thu, 23 January 2014 09:41 Go to next message
Lorenzo Bettini is currently offline Lorenzo Bettini
Messages: 1321
Registered: July 2009
Senior Member
Hi

I'm experiencing a small issue after upgrading to SwtBot 2.2.0 in one of
my projects, I have it both headlessly and from the IDE.

I have some small tests which import some projects in the workbench and
check that there are not building errors; In the beforeClass method I
was preparing the workbench by switching to the "Plug-in Development"
perspective, closing the "Error Log" view and showing the "Problems"
view. Well, closing the "Error Log" view always fails, showing the
"Problems" view fails sometimes... Now, this is not a big issue for me,
since for these tests it is not needed to switch to that perspective
(and I can check for building errors anyway), thus I removed these
initialization instructions... but the fact that they fail looks
suspicious...

as a reference, these are the modifications I had to do to make these
tests work again (the second file is the interesting one):

https://github.com/LorenzoBettini/xsemantics/commit/0953e45f9287c05d4a974b1927bc005260a3e08c

cheers
Lorenzo

--
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
HOME: http://www.lorenzobettini.it
Xtext Book:
http://www.packtpub.com/implementing-domain-specific-languages-with-xtext-and-xtend/book
Re: small issue after upgrade to 2.2.0 [message #1235220 is a reply to message #1235087] Thu, 23 January 2014 15:55 Go to previous messageGo to next message
Lorenzo Bettini is currently offline Lorenzo Bettini
Messages: 1321
Registered: July 2009
Senior Member
On 23/01/2014 15:41, Lorenzo Bettini wrote:
> Hi
>
> I'm experiencing a small issue after upgrading to SwtBot 2.2.0 in one of
> my projects, I have it both headlessly and from the IDE.
>
> I have some small tests which import some projects in the workbench and
> check that there are not building errors; In the beforeClass method I
> was preparing the workbench by switching to the "Plug-in Development"
> perspective, closing the "Error Log" view and showing the "Problems"
> view. Well, closing the "Error Log" view always fails, showing the
> "Problems" view fails sometimes... Now, this is not a big issue for me,
> since for these tests it is not needed to switch to that perspective
> (and I can check for building errors anyway), thus I removed these
> initialization instructions... but the fact that they fail looks
> suspicious...
>
> as a reference, these are the modifications I had to do to make these
> tests work again (the second file is the interesting one):
>
> https://github.com/LorenzoBettini/xsemantics/commit/0953e45f9287c05d4a974b1927bc005260a3e08c

Hi

I did some further investigation and in other projects this

SWTBotView view = bot.viewByTitle("Problems");

always fails with version 2.2.0.

I debugged a little and it looks like now this method is implemented as
follows

/**
* Shortcut for view(withTitle(title))
*
* @param title the "human readable" title
* @return the view with the specified title
* @see WidgetMatcherFactory#withTitle(Matcher)
*/
public SWTBotView viewByTitle(String title) {
Matcher<IViewReference> withTitle = withTitle(title);
return view(withTitle);
}

while in 2.1.0 it was implemented as follows

/**
* Shortcut for view(withPartName(title))
*
* @param title the "human readable" title
* @return the view with the specified title
* @see WidgetMatcherFactory#withPartName(Matcher)
*/
public SWTBotView viewByTitle(String title) {
Matcher<IViewReference> withPartName = withPartName(title);
return view(withPartName);
}

for some reason the "Problems" view has "Problems" as part name, but
"Problems (0 items)" as title, thus the new implementation does not find it.

To fix this, it is enough to change the test code to

SWTBotView view = bot.viewByPartName("Problems");

This viewByPartName method has been introduced in the new version 2.2.0.
With this respect, I think that the method should have a @since 2.2.0,
what do you think? Should I file a bug report?

cheers
Lorenzo

--
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
HOME: http://www.lorenzobettini.it
Xtext Book:
http://www.packtpub.com/implementing-domain-specific-languages-with-xtext-and-xtend/book
Re: small issue after upgrade to 2.2.0 [message #1235406 is a reply to message #1235220] Fri, 24 January 2014 04:15 Go to previous messageGo to next message
Mickael Istria is currently offline Mickael Istria
Messages: 740
Registered: July 2009
Location: Grenoble, France
Senior Member
Yes please file a bug, we'll continue discussion on Bugzilla.
--
Mickael Istria
My job: http://www.jboss.org/tools
My blog: http://mickaelistria.wordpress.com
My Tweets: http://twitter.com/mickaelistria
Re: small issue after upgrade to 2.2.0 [message #1237291 is a reply to message #1235406] Wed, 29 January 2014 05:10 Go to previous message
Lorenzo Bettini is currently offline Lorenzo Bettini
Messages: 1321
Registered: July 2009
Senior Member
On 24/01/2014 10:15, Mickael Istria wrote:
> Yes please file a bug, we'll continue discussion on Bugzilla.

https://bugs.eclipse.org/bugs/show_bug.cgi?id=426869

--
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
HOME: http://www.lorenzobettini.it
Xtext Book:
http://www.packtpub.com/implementing-domain-specific-languages-with-xtext-and-xtend/book
Previous Topic:SWTBot hanging in Jenkins
Next Topic:Re: Call Thread SWT from Swing
Goto Forum:
  


Current Time: Wed Aug 20 12:42:46 EDT 2014

Powered by FUDForum. Page generated in 0.02074 seconds