Playwright: how to minimize electron app, change focus to another and re-open the electron app? - automation

I am new to the Playwright, trying to minimize the electron app, then change focus to some other app and click on minimized app to open.
Is this even possible using Playwright? trying to get this run on Mac/Windows.
Thanks!
Any help is highly appreciated.

Related

How to run a JS funktion before Metro replaces my React Native JS code via "Reload"

I am writing a React Native app with hardware access. This means that I setup the hardware at application startup. Then I could click "Reload" in the developer menu. But before the code is reloaded I need to tear down my hardware setup since otherwise the setup during restart fails.
Is there any way I can create some kind of callback function/hook that allows me to get informed immediately before app reload? Than I could to the tear down in this function. Please note the code has to run in the handy app (not as a kind of plugin for metro bundler).

Get access to Electron API from Java and Webdriver

I'm writing automation tests for Electron application using Java->Selenide (Selenium)->chromedriver 83.
I can successfully get access to visual elements of the app using xpath locators. But currently I need to check that window of my app is minimized after pressing "Minimize" UI button.
I can't find any easy ways to check that window is minimized from chromedriver.
May I use Electron API to get property win.isVisible or something like that? Or maybe any other ways to check that window of the Electron app is minimized?
Thanks

Vue Native - Debugging

Recently I switched from Ionic framework to vue-native (vue.js wrapper around react-native), everything seems to be cool, development is fast and easy, but I have some real issues with debugging those apps. With Ionic Framework (Cordova) I was able to open an app in web browser and could easily manage Vuex state (for example) from Chrome Console. It doesn't seems so easy and trivial in react native world. Is it possible to have similar debugging experience in vue-native? When my app starts to grow and gets complicated it's really hard to handle it other way around. Any help appreciated.
Basically all my problems gone away when I ported my apps to Expo (which allows for JS remote debugging) and grabbed React Native Debugger - https://github.com/jhen0409/react-native-debugger.
Important part is having simulator installed on your developer machine (like iphone simulator) because debugger doesn't play nicely with real machines.
Inside debugger hit cmd+t to open a new window and set port to 19001 (because of Expo using this port). Now start expo with npm start command and in Expo panel hit 'Run in simulator' button.
In simulator make a shake gesture (ctrl+cmd+z) and allow remote debugging in developer menu.
Done. Pleasant experience similar to one known from Cordova. You have a js console, you can inspect elements and change styles live. Expo comes with live reload to make things smoother.
More info here: https://docs.expo.io/versions/latest/workflow/debugging/
Unfortunately, you cannot debug script parts in the VUE files in Chrome Dev Tools (you can put the breakpoints, but they are not working well), but if you put the methods to a separate JS file, it works like a charm. I know, it's a workaround, but not a big pain, and working well.
See my TODO app for example: https://github.com/TheBojda/VueNativeTodo

How to temporarily disable rage shake opening the dev menu in react-native?

I'm developing an app in react-native for Android. I recently added a barcode scanning component. Whenever the scanner reads a barcode, the camera does a subtle click noise. It seems that this clicking is enough to trigger the "shake" required to open the developer menu.
Is there any way I can disable this shortcut programmatically? I would like to disable the shortcut when the barcode scanner is running and then enable it again later.
This is currently not possible. A PR allowing this was recently (may/2017) merged, but only adds support for this on ios: https://github.com/facebook/react-native/pull/13563
You can't. You could try disabling the camera shutter sound though.
Try to run release version of an app. Run react-native run-android --variant=release for more details to generate signed apk follow guide here
You can put the phone on silent mode, hope this helps!

Prevent Chrome debugger from stealing focus in React Native

I use Chrome Debugging and Live Reload to debug React Native applications.
Whenever you save a file, the Chrome screen reloads and in doing this, gets focus. This is annoying. Is there anyway to disable this focusing behaviour?
The Chrome debug page is opened by the launchChromeDevTools.applescript script in the react-native package.
You can disable it grabbing the focus by opening this file in your project:
./node_modules/react-native/packager/launchChromeDevTools.applescript
and commenting out the activate line by inserting -- in front.
(This annoyed me enough to hunt down how to do it; it might be worth filing an issue on react-native to make it an option).