possible way to run actual application - flutter

I am making a testing scenarios using Ogurets framework which is cucumber + gherking combination.
The tests are for Flutter application written in Dart language.
I recently figured out that test driver does not execute actual app. For example in my case:
I have and app where is a Login feature. After navigating to Logout and clicking on it, app does not return the login screen(it does back-end work though), but when I execute actual app through main.dart file and not using Ogurets configuration everything works as expected.
So I was wondering,
Is there any possible way to execute actual app during testing scenario? Lets say It can execute release version of the app.
Not sure if it makes sense.
Thx for possible tips

So when Ogurets runs, it will execute a command to "flutter run" your application, and using the standard mechanism for Flutter Driver, it will create a tcp link between your running application and the Ogurets code. But to do this, you have to have the extra Flutter Driver code enabled in your application, so it is not possible to run your "actual app", otherwise this TCP link will not form.
Over this TCP link standard Flutter Driver commands are executed and you can also execute extra commands. So your actual app is being executed as if you are running it using "flutter run" - and you can even run it on a real device this way, but it can never be your released application as it will not have this extra TCP link code.
If you are having trouble understanding why your application is operating like this, the documentation for Ogurets Flutter does indicate how you can run and debug the two sides of the application, so you can be running your Flutter App in debug mode and then run your tests, have it connect and automate the app and then debug why it isn't coming back to your login page. This is what I would recommend you do.

Related

Flutter build web in release mode

Is is possible to build flutter web in release mode? The only commmand I found to run on web was either :
flutter run -d chrome
but it's in debug
or I use :
flutter run -d web-server --web-port 5000 --web-hostname localhost
to run a local webserver to avoid having to use a new chrome everytime I debug anything.
My problem is the following and pretty simple : I have code that crashes in release mode when webApp is built and deployed on github pages, but the stack is impossible to understand, also this very code doesn't crash when I test it in debug mode ( again the error stack looks like this ):
main.dart.js:4315 Uncaught TypeError: n.gawc is not a function
at main.dart.js:22638:13
at aAA.a (main.dart.js:5512:62)
at aAA.$2 (main.dart.js:39196:14)
at Object.E (main.dart.js:5498:10)
at Object.QE (main.dart.js:22648:10)
the javascript is obfuscated so I don't know at which point it's hapenning, and if I want to test anything I need to build for web and upload on github pages, then wait 1 hour for it to be live to be able to see my prints in the console which are placed completely blind.
Is it possible to build for web in release mode locally?
Thank you for your time.
Your question asks about building for web in release mode. So the following does that for you.
flutter build web --release
To actually run a local release version. You just need.
flutter run --release
See this for more info https://docs.flutter.dev/testing/build-modes

Flutter websocket working in local web but not in release mode

I'm doing some tests with web_socket_channel Flutter plugin and I've noticed a very strange behavior. I've implemented flutter-dev's example, just changing the socket kind to HtmlWebSocketChannel in order to make it work in web builds. If I compile my app with flutter build web --release and later I expose it with a local webserver, it works perfectly fine. Same happens if I execute it in debug mode.
add network permission in mainfest.xml

Changes made to app are not being retained once run session ends

Let's say I'm connected to an actual device, making multiple changes to my app and hot-reload/restart is doing its thing and life's all good. Once I'm satisfied with changes I hit the stop button.
Now, if I pick up the phone and launch the app - it will be an older version of the app that doesn't contain the changes just implemented.
In order to get most recent changes I have to uninstall app from the phone and then go back into the IDE (VSC) and run the app once more to get the latest changes.
Is there a configuration setting that allows you to avoid having to do this?
It is my understanding that while you are developing, and hot-reloading/restarting, you are working on the Dart Virtual Machine. So if you don't make a full build and install the APK on your device then once you close the development build you are working on the VM closes and the code that was running on it is lost.
To answer your question, there is no configuration that you can set to have what is running on the VM to be on the APK without a full build.

How to implement headless app with BlackBerry 10.2 OS

I want to get an idea of how to implement a long running headless application with BlackBerry 10.2 OS. I don't need any complex function to happen in the background. I need only to print a Console out-put.
I have used the QTimer class and at this moment it prints a console out put when the application in foreground and in thumbnail mode.
connect(timer, SIGNAL(timeout()), this, SLOT(update()));
But when I exit from the application, the whole application destroyed. The above code and the update() function is in a separate C++ class that is not interacting with a UI.
I have given following permissions in the bar-descriptor.xml file too.
<permission>run_when_backgrounded</permission>
<permission system="true">_sys_run_headless</permission>
<permission system="true">_sys_headless_nostop</permission>
How to make this app run in background even when the application destroyed?
Thanks
See this: http://developer.blackberry.com/native/documentation/cascades/device_platform/headless_apps/
The long and short of it is that what you're trying to do (have an application run indefinitely) requires analysis and approval by BlackBerry.
If on the other hand, it is acceptable to have your application triggered in response to a system event (e.g. E-mail received) then this is possible.
There is a Push Enabled Headless App Example, in Github Cascades Samples but I couldn't make it works.
On the other hand, there is a pretty Tic-Tac-Toe Headless App Example and it works fine for me:
Source:
https://github.com/blackberry/Cascades-Samples/tree/master/xandos
https://github.com/blackberry/Cascades-Samples/tree/master/xandosdroid
I just had to add reference the project 'Xandosdroid' to the project 'Xandos'. Before it giving me this error when packaging and deploying 'Xandos' project to the device:
Packaging failed: 1 Error: Invalid asset path
"../xandosdroid/arm/o.le-v7-g/xandosdroid"

Debugging Servlets in Eclipse

I have created a web application using the Google Web Toolkit that is able to receive some data by a mobile client via Http Post. The transmission of the data works well and also the server / client communication using GWT RPC is no problem at all.
However, I need to debug the webserver when receiving data from the mobile device. As I am using Hibernate and MySQL within the web application I do not use the Google App Engine. So if I deploy the web application in local host mode it is only accessible on the localhost:8888.
Now, if I send data from the mobile phone, I have to send it to the locally assign IP address as the localhost of the mobile phone emulator is not the localhost of the computer, where the web application is running. To ensure that everything works, I tried to do some posts outside the emulator (on the machine the emulator is running on). This works, but how can I post from the emulator to my web application?
How can I get access to debug my system? I've already tried to deploy the final application to a tomcat server and use remote debugging, but that fails too.
Best regards,
Florian
Well if I understand your question correctly, the real problem isn't debugging the app on the servlet, the real problem that you're looking at is debugging from a mobile phone. When the mobile phone hits your local network (I'm guessing you're pointing at 192.168..?) you are accessing the compiled GWT code that does not communicate with the debugger.
Put another way, when you debug locally using a browser, you are actually not running compiled GWT code, but instrumented code that is executed with the GWT Debugging Plugin, that happens to work exactly like compiled GWT code. (mostly). So while your local version has "?gwt.codesvr=127.0.0.1:9997" or the like, your mobile phone version cannot do the same, and cannot thus communicate with the debugger.
The best that I've been able to do is to use logging extensively. If you're using an iOS device and change the settings are your safari, it can output logs for you from mobile safari. Also, if you're using the Android debugger with a WebView app, you can attach a listener for log messages and then ferry them on to the ADB and view those in Eclipse. Definitely not as good as a debugger, but that's the best I've come up with so far, and if anyone has a better solution I would love to know it :)
Hope that helps!