How to manage protractor to wait for a angular page load where the angular SPA is integrated into another angular app as iFrame - angularjs-directive

While executing e2e tests in protractor when we are using ignore.synchronization=true/ browser.waitforAngularEnabled(true) to handle waits is too slow when compared to browser.sleep(10000) to proceed to next step. How to address these kind of wait issues to make the script execution faster?

Related

Running cypress on GitHub actions will run test twice

I am running a test using Cypress 9.5.7 and GitHub actions and every time I run an action GH will run the test twice one on Chrome and the other on Electron. Second test always fails on Electron. Electron browser seems to be a default browser for Cypress. The intersting thing is that when I run on Cypress Dashboard the test runs only once on Chrome. But twice on GitHub actions.
I talked to a few developers and we couldn't find a solution.
Anybody has ever expeerince this issue and how did you resolve it??
I tried just removing / bypass electron
return {
browsers: config.browsers.filter(
(b) => b.name === 'chrome'
),
}

Electron Dialog closing refreshes my current page

I have an electron app.
It uses Bootstrap v4, Electron v2 amongst some other node modules.
I have a button which opens an electron dialog, the user selects a folder, and at this point, my application BrowserWindow appears to refresh.
I don't want this refresh to occur. I have created a test case which shows this behaviour. No doubt I have made a simple error, please can take a look at this repo to show the test case which reproduces my problem.
https://bitbucket.org/renegadeandy/electron-dialog-problem/src/master/
The problem was I am writing a log.txt file to the directory which is being watched by the electron-reload module.
When I write a new record to the log, the file changes, and causes my application to reload! Makes sense - but the combination of my logging & active reload isn't working nicely together.
I have solved it by simply removing electron-reload.

Unloading lazy loaded modules in Angular 5

I want to unload all used modules when a user logs out of the webside to reset the application. When a new logs into the backendserver with the same running application all lazy loaded modules are still there.
I did some research and seems to me like it isn't possible by now.
Does somebody know a solution or a githublink to the ticket?
I guess unloading my modules was the wrong direction.
Once the chunks are loaded they shouldn't be constructed again.
I register the services in another service. Now when I Logout I call a function which iterates through all the services and calls a function for every service which empties all data by the previous User.
----------EDIT---------
Seeing that this question still get views here is a solution I used for some Apps:
Kudos to user benh80
Resetting the complete App and reloading it:
Resetting Angular 2 App
the whole point of using lazy loading is to load the relevant modules for a component. Once you log out the application it actually loads the modules which need for that component. Hence there is nothing to unload

How can XCUITest be used from within an OSX application to remote control iDevices?

Visionary scenario and current goal
My visionary scenario is to remotely control an non-jailbroken iDevice as lag-free as possible.
My current goal is to execute a tap on an iDevice from within an OSX application. For example: A button in a cocoa application which when clicked taps the middle of the screen on a lightning-connected iDevice.
I am not bound to OSX and am open to other avenues.
Approach
XCUITest in the XCTest framework allows to run automatic UI Tests. It is the native way of executing remote taps on iDevices.
The following line would execute a tap in the middle of the screen:
XCUIApplication().coordinateWithNormalizedOffset(CGVectorMake(0.5, 0.5)).tap()
Cheat Sheet for XCUITest: http://masilotti.com/ui-testing-cheat-sheet/
Unofficial Reference: http://masilotti.com/xctest-documentation/
Question
How can I use the XCUITest framework from within an OSX application to remotely tap a connected iDevice? I don't actually want to UI Test an existing application.
My problems start with #import XCTest which is not allowed without a test target and continue with .tap() (iOS) not being available in my cocoa application. How do integrate all this?
Other avenues
What other way should I possibly use instead? It must be possible to execute taps on a connected iDevice remotely, because Appium and Calabash use the now deprecated UIAutomation framework to do so. Both must switch to XCUITest from iOS10 onwards.
Edit 1 - Current status
It seems like my approach is much too complicated and basically means implementing Appium-light. My current approach is to use the Appium Server which handles UIAutomation (and in the future XCUITest). I then implement my own Client to send HTTP requests to the Appium REST-API.

How to delay MainPage, so it starts after data is loaded?

I have an application that stores data in isolated storage. I have a function to read the data (called in Apps.xaml.cs):
await ReadData();
However, before the data read, OnNavigatedTo is called in MainPage. At that point the buffer holding the data is still null.
How can I prevent MainPage.OnNavigateTo() from being as long as ReadData is not complete?
I tried syncing Apps & MainPage by setting a semaphore in Apps, and WaitOne() in the MainPage constructor. This hang the app on the WaitOne.
Any idea how this timing problem can be solved?
You can't delay the loading of the main page - as if the loading cycle is not executed within a timely fashion the app will be closed by the OS.
The best way around this is to create an interim splash page, which will handle the downloading of data whilst showing UI to the user. Once the data has downloaded you can then redirect to your main application page.