I am using NightwatchJS to test a web application. In the prelimary steps of my test, I am trying to utilize a method that should maximize the browser window, but it does not seem to work. The method is .windowMaximize() and can be found in the API documentation. In my test, when the browser launches, it is only about half the size of the screen. Below is an example of my code for the test. Can anyone see anything I am doing wrong? The test launches and runs, but the windowMaximize() method just doesn't work Sidenote: This is coffeescript, not javascript. It gets compiled by grunt before it's run.
module.exports = {
"Smart Control Tests": (browser) ->
browser
.windowMaximize()
.launchAs "auto_test"
.assert.title "My App"
...
.end
}
If using Chrome, try starting with the browser maximized by setting that option in the the chromeOptions section
"chromeOptions" : {
"args" : ["start-maximized"]
},
Related
I have a MacOS application written in Swift, which launches an SDL application under the hood. The software has a "login with AppleID" feature. However, when the user is prompted to login, the popup has a nasty titlebar attached to it, with "Window" in the title. See attached screenshot. Is there any way I can remove this?
I suspect this has to do with the SDL app not being set up properly. In case I am wrong though, on the second screenshot you can see the structure of the Swift UI components of the wrapper app. Here I correctly named the application, tried setting the ViewController title, tried changing calling NSApplication.shared.mainWindow?.title = "" in the AppDelegate, nothing seems to have any effect.
Is there a way to do a hard browser refresh when running an app with nwjs, on Mac? nwjs's right click 'simulate browser restart' seems to start the app at its entrypoint again. Is there a way to simulate the behavior of simply clicking the shift reload button in Chrome?
There is an nwjs api for this:
// Load native UI library
var ngui = require('nw.gui');
// Get the current window
var nwin = ngui.Window.get();
// this will do a hard refresh
nwin.reloadIgnoringCache();
// here's a regular refresh
nwin.reload();
nwjs doc:
http://docs.nwjs.io/en/latest/References/Window/#winreloadignoringcache
just use javascript reload
location.reload();
Looking at the flutter code it seems like I should be able to run the google places modal dialog since it does a full screen thing and doesn't try and overlay on top of flutter.
However I am having an issue where the modal shows up and then disappears again immediately. I am not entirely sure how to solve this...
I am activating it with:
call.method == "openPlacesDialogModal" -> {
val code = GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(activity)
if (GoogleApiAvailability.getInstance().showErrorDialogFragment(activity, code, REQUEST_GOOGLE_PLAY_SERVICES)) {
return
}
//val intent = Intent(activity, PlacesActivity::class.java)
//activity.startActivity(intent)
var intentBuilder = PlacePicker.IntentBuilder()
activity.startActivityForResult(intentBuilder.build(activity), PLACE_PICKER_REQUEST)
placeResult = result
return
}
In the logs I get:
I/FlutterActivityDelegate(18184): onResume setting current activity to this
I/flutter (18184): Opening picker
I/FlutterActivityDelegate(18184): onResume setting current activity to this
I think it is the onResume getting back to the ActivityDelegate that is the issue.
I put this on top of a completely different activity too, which kind of works. It shows the dialog for longer. I made sure I have all the right permissions, I have the fine location, internet permissions. Do I need to setup anything else?
Thanks,
David.
Error here was that I was not setting up the google api correctly and it was erroring immediately. Had to put in some checks to look for this error so I could respond correctly to the app that an error occurred.
I was viewing my app on a mobile testing site and when I click on the buttons on my app they don't do what they are meant to do which is to navigate a page in the app. This is the code I used for the button:
Thanks
The show method have some parameters to work. These parameters are:
show(motionEase, transitionEffect, transitionEffectType, fade, reset, duration);
Obs: duration parameter is optional.
If you don't know what to put in these parameters, just type SMF.UI.ParameterHere. You can do this with motionEase, transitionEffect and transictionEffectType. Eg:
show(SMF.UI.MotionEase.plain, SMF.UI.TransitionEffect.downToUp, SMF.UI.TransitionEffectType.cover, false, false, 350);
By the way, you can use Smartface's API to search before asking here, you'll have faster results. :)
API: http://docs.smartface.io/
I'm using jQTouch to develop a version of a website optimized for safari on the iphone. The jQTouch demo helpfully shows how to show an "install this" message for users not using full screen mode and hide it for those who are. When in fullscreen mode, the body should have the class "fullscreen." So you can hide the "install this" message for people who have already added your app to their home page by adding this css rule to your stylesheet:
body.fullscreen #home .info {
display: none;
}
What I'd like to do is require users to use the app in fullscreen mode only. When viewed from the regular browser, they should only see a message asking them to install the app. That message should of course be hidden otherwise.
This ought to be really, really easy, so I must just be missing something obvious.
I thought one way to do this would be to simply test for the class "fullscreen" on the body: if it's not there, use goTo to get to another div, or hide the other divs, or something like that.
Strangely, however, this doesn't work. As a test, I've still got the original "info" message, as in the jQTouch demo, and it doesn't show up when I launch in fullscreen mode. So the body must have the fullscreen class. And yet I can't find any other trace of it: when I put this alert to test things after the document has loaded, I get nothing when launching in fullscreen mode:
alert($("body").attr("class"));
I also thought I might test for fullscreen mode by checking for the value of the fullScreen boolean. But this doesn't seem to work either. What am I missing? What is the best way to do this?
Well, I couldn't figure out why the standard way wasn't working, but someone on the jQTouch Google Group suggested this, which works:
if (window.navigator.standalone) {
alert ('Thanks for launching this app your home screen')
} else {
alert('Add this app to your home screen for the best experience')
}