How to hide GWT com.google.gwt.dev.DevMode application window? - java

I have integration tests that start my GWT application using com.google.gwt.dev.DevMode class. The web server starts as expected but DevMode also pops out its graphic window. I would like to hide this windows as we may need to run these tests in the headless environment.
Is it possible to start com.google.gwt.dev.DevMode without its graphic window?

I think you could extend DevMode and call its setHeadless method. But you're not supposed to run integration tests in DevMode, you should run them in prod mode.
An alternative would be to provide a remote UI (this is what the Google Plugin for Eclipse uses to integrate DevMode into an Eclipse view), but it requires talking the remote UI protocol.

Related

Is it possible to run test code written by other languages in flutter?

I am trying to automate my webview app by using Appium, but code that I exported from Appium is written in java. Is it possible to test flutter app by test code written in other languages, not in dart?
UPDATE: You can use Appium in conjunction with Selenium. I think that should work. See: http://appium.io/docs/en/writing-running-appium/web/mobile-web/
If what the test framework does is to integrate with, or emulate, a browser, and manipulate the DOM in order to test, and
If your Dart application only manipulates the DOM to generate a web view -- e.g., it would work in a regular browser without using plugins,
Then yes, you can use such a tool (like Selenium) to test a Dart app.
The caveat here is, if you are using a WebView to embed your app in a mobile app framework, then these tools will have to have the ability to open an app on a mobile device to access the WebView.
If you can create an alternate scaffolding for your application, such that it can also run in a browser, not only as an embedded WebView in a mobile app, then the tools needed to test it are only simple web app testing frameworks.
This is generally a good approach if you can get faster feedback deploying to a web server and running your tests, than packaging the app and pushing it to a connected device.
It doesn't obviate the need to test in the WebView as there are often differences between browser capabilities as embedded in a WebView versus in a desktop browser, but any differences found would be purely based on the capabilities of the browser, as opposed to problems in your Dart logic.

UISpec4j for JNLP - Make window visible

I am trying to use UISpec4j and NetX to test JNLP. Got the solution from How to automate a swing java web start application which runs clicking a link into a web application, which is automated with Selenium WebDriver?
But I need to make the JNLP app visible. Is it possible to do that in UISpec4j?

run vaadin application on pc

I have developed a vaadin application for a friend of me. Now I want to "install" this application on his pc so that when he clicks on an icon (like when you open, let's say spotify) the application starts and he can start using it... What is the easiest way to do this?
The application would be an runnable jar (using JSmooth or whatever you want). You would need to use an embeddable web server like Jetty. Here is a tutorial on setting up Vaadin with Weld and embedded Jetty. Here is an example Vaadin application that shows you how to set up the launcher to automatically start your application.
Hope that helps!
You can use Jsmooth to create an installer for the application.

Testing GWT Apps in Development Mode in STS

When using Run As -> Web Application for a GWT app in STS, a Development Mode view is opened that contains a clickable link that in turn opens a browser and tests the GWT app...
What are the rules behind changing code while the code is running in the Development Mode. Does the Development Mode reflect these changes? Do you always have to terminate and restart Development Mode?
Any tips for how to speed up the loading of the link in Development Mode?
I would pose the same questions for Debug As -> Web Application.
Thanks!
The answer really depends on if you are running with "Debug As" or not. Actually, the whole topic is a little bit more complex (differentiating between server side/client side code, restarting vs refreshing vs reloading, ...), and instead of repeating myself, I will just provide you with a link to my answer here.
Note: The Google Plugin/GWT SDK behavior isn't specific to STS.
No, you don't have to restart. Just saving the files is sufficient. Another way to develop is to debug as a GWT app and then open the hosting html/jsp page in a browser and add the &gwt.codesvr=9997 at the end of the URL.

what could be the reason for my java UI unit test grabbing focus on GNOME desktop

I am running a UI unit test with multiple scenarios that requires the UI to get focus when it starts. This test runs for a while and I am facing an issue in GNOME desktop where the focus goes back to this application for each scenario it executes; this prevents me from using my machine when this test case running.
This works fine on windows and linux with KDE environments.
Any indicators on why this could be happening on GNOME desktop.
I have no idea about the focus, but you can run it on a different display, using Xvfb or something similar to stop it from using your current screen.
Alternatively, refactor your classes to not be so intimate with the GUI ( see the humble object ).

Categories