Testing apps made of electron application framework - javascript

I am new to JS and electron in general, always been a back end dev using languages such as java and C#, I briefly worked on an older Perl project as well.
I have been tasked to create tests for one of our newer apps made in electron, I know that it is a JS program using a chromium core, and there is a testing framework for it called spectron. When I checkout the documentation, it seems to tell me that I can only use JavaScript bindings that it provided to test electron with selenium. My question is, is there a way I can use selenium webdriver with C# to test an electron app instead of using JavaScript? Do I have a choice here?

Related

Does Protractor JS works for native mobile apps

I kind of think that answer of this question would be No by going through Protractor issue 1798 and Protractor vs Webdriver-IO comparisions.
I want to write automated tests cases for a hybrid mobile app in JavaScript which will run on Appium.
Currently I have both Protractor and Appium configured in same project to run those End-to-End test cases, and they work.
Problems are that,
I have to write separate test cases for each of them.
Cases should also work on mobile devices(Android and iOS) and protractor doesn't support native apps tests.
Situation is, I am more comfortable with Protractor's settings in my current project than Webdriver-IO which Appium uses (just a personal preference).
Question-
Is there a way of using only Protractor while writing test cases which would work using Appium and work perfectly on Devices/Emulators?
I am also open for any suggestion(s).
If answer remains No, I will change my codes to only use WebdriverIO in order to keep my test cases reusable and only once.
The answer is still NO protractor currently does not have support for mobile native apps but you can use it for automating browsers in your mobile.
Better use WebdriverIO but it also has its own limitations, please do check its changelog and github issues before deciding it as your webdriver framework.

How to convert Angular JavaScript code into a native Windows application?

I want to convert an Angular JavaScript app into a native Windows application but I don't know how to do it. I heard that electron could be used for this but I don't know how to use electron.
Despite electron there is another solution called nativefier. It is actually quite simple and you don't have to learn a new framework like electron.
As the comments pointed out already, this is not possible.
Why?
JavaScript can't run directly on the machine, neither do HTML and CSS. You need a browser that can understand those languages and turn them into commands your computer can understand.
So your only way to run an Angular App without using chrome or Firefox or whatever browser, is Electron. It's basically a chrome browser plus your custom Angular app packed into an exe. So under the hood, it really just runs your code in a browser environment, but you have more control over it and no address bar etc.

Load jQuery in node.js CLI [duplicate]

This question already has answers here:
Can I use jQuery with Node.js?
(21 answers)
Closed 6 years ago.
I'm an R developer by day and I'm trying to learn to do stuff with Javascript at night. I'm very used to the REPL type environment where I can run code in the IDE where I'm working. The code I'm writing is for a web application, but I'm still in the learning stage with Javascript so I want to do exploration, practice, etc. and I'd like to do it in a REPL environment so I can try something, fail, try something else, etc.
I have installed node.js and configured Sublime Text to "build" my Javascript files via node in the CLI. However, I'd like to try using some things from jQuery. Is there a way for me to load jQuery into the node.js execution environment so my standalone script can use the necessary features?
To be clear, I'm not talking about use node.js on a server, as a webserver, any of that. I'm just using node.js as an execution environment on my PC to execute vanilla and, hopefully, slightly french bean vanilla code.
I've read that you can't source in other Javascript files but obviously a web browser loads in code from multiple sources and co-mingles them so it seems like I should be able to do something similar when executing on my local machine.
If you just want to try jQuery in a REPL environment, you can do that from the dev tool from your browser (major browsers has it called 'console' under F12 usually), no need for nodejs here, JS engines are implemented in browsers.
But if you want to use the same core functionality and syntax of jQuery, you might want to try cheerio package https://cheerio.js.org it's a:
Fast, flexible, and lean implementation of core jQuery designed specifically for the server.

Interaction between Dart/Objective-C and Dart/Java

I read a really interesting article about how create cross-plateform app : http://www.skyscanner.net/blogs/developing-mobile-cross-platform-library-part-3-javascript
But I would prefer use Dart instead of Javascript, and I was wondering if it's possible to interact between Dart/Objc and Dart/Java (Android), in the exact same way that is showed in the article (run a Javascript VM to execute the javascript code).
Thanks
You can code it in Dart and use dart2js to output JS code then put that JS code in PhoneGap or Cocoonjs to get it on Android/IOS.
The article seems to show how its done with JavaScript. I am sure its possible to code a Dart mobile cross-platform library but it hasnt been done yet.
iOS does not allow 3rd party VMs to be included with your app. The only VM you have access to is the JavaScript VM that is bundled standard with iOS. Even Google Chrome on iOS is crippled in this way (they cannot include v8 on iOS).

Scripting layer for Android - LibGDX

I've been writing a full game engine on top of LibGDX for sometime now and had written almost every single game object in Javascript (I created a composite based game object system). For the JS interpretation, I used the Rhino engine which on my ubuntu system, works phenomenally well, however when I tried to run it on Android, I was not able to get it to compile at all and from what I HAD read, it's because Google didn't use a standard Java implementation that supported Rhino, but now I'm seeing the support with the SL4A project, however I was looking for a simple Rhino jar file that was compatible with Android but after looking through the downloads, all I found were APK files that did not appear to have the library and from what I have read, the APK is suppose to be a template project, but how can I use it with my existing code without a jar package? Maybe I'm totally missing the point?
It seems SL4A Rhino repository has all the necessary add-ons (among them rhino1_7R2-dex.jar) to get Rhino running on Android.

Categories