I have an html file called config.html that lives in the same directory as my index.html.
The idea is to load my config on startup of my app and then pop the config screen if the config's not set. I then want to set the config and jump back so that the app continues to run normally.
Here is my method:
function _showConfig(callback) {
jQuery.mobile.changePage("config.html", { transition: "pop" } );
}
When I run this, it executes this line, then appears to be loading the config screen up briefly before the whole thing vanishes.
Related
I updated this question. What I'm trying to do:
Click add video, modal box appears.
Select MP4 and add MP4 to the modal box.
Click the "Add" button, dismiss modal box and continue test.
Issue: after Cypress adds the MP4, cypress tries to do a .click() on the "add" button. But for an unknown reason to me, the "add" button does not dismiss the modal box, blocking part of the page, Cypress can't verify the next step, causing my test to fail.
newStoryPage.getAddVideoToStory().click({force: true}) //this clicks the add video button.
cy.wait(2000)
//here I add the video to the modal box:
cy.fixture('sample-mp4.mp4','binary').then(mp4 => {
const files = [
{ fileName: 'sample-mp4.mp4', fileContent: mp4, mimeType: 'video/mp4', encoding: 'utf8' }]
cy.wait(2000)
newStoryPage.getDragAndDropFiles().attachFile(files, {subjectType: 'drag-n-drop', events: ['dragenter', 'drop'] })
})
//here I click the add button, which won't do anything
newStoryPage.getAddButton().click()
This simply isn't possible. You can't test a real file picker with Cypress. The file picker is part of the operating system user interface, which can't be tested with Cypress / isn't accessible to the browser. You just have to "trust" that the OS is doing the right thing, and test that your app is doing the right thing when presented with a File.
I've a problem, i need to open url inside app, and I used a WebView, but doesn't work correctly.
imported this:
import QtWebView 1.0
my code:
Rectangle{
width: Screen.width
height: Screen.height
color: "Orange"
anchors.fill: parent
z:9999999
WebView {
id: webviewer
anchors.fill: parent
url: "http://www.google.com"
onLoadProgressChanged: {
console.log(webviewer.loadProgress)
}
}
}
and in the .pro file i've put:
QT += webview
And my main.cpp
QtWebView::initialize();
my console.log is printing correctly the load status, but on the screen I don't see nothing.
Why?
Works on iOS, the solution is:
Open project in Xcode from build folder, and set App Transport Security Settings, you must add Allow Arbitrary Loads and sets it on YES.
Now the WebView works.
initialize() creates opengl surface, in this case You must first open parent window(surface to display) , other solution is to comment initialize() - page will show. If you'll decide to show it on GL surface, try to se ALWAYSSTACKONTOP attribute to see, if other windows dont cover webview, opengl is rendered first,so any other background can make it not visible. You may also open webview class parented to other, visible window, but if you will show it fullscreen, it will be flicker a while
I have an app with a main.storyboard with a scene correctly set as the initial view controller. When I start the app and run it, this scene comes up as expected.
My problem occurs when I attempt to add custom fonts to the project. When I edit my info.plist to include the fonts in the Fonts provided by application section and then attempt to run the app, it remains stuck on the launch screen and the initial scene from the storyboard is never loaded. If I then remove the Fonts provided ... section from my info.plist file and run it again, the initial screen loads up as expected.
What am I doing wrong here? Does it matter where in the plist the entry is (like at the top or at the bottom)?
So, I discovered that my code was hanging/freezing completely when attempting to call CGFontCreateWithDataProvider (which is a necessary part of registering custom fonts). This was being called before anything else was loaded, so the freezing on this call was preventing the main screen from ever appearing.
The "fix" (gleaned from nearly-unrelated posts) was to add this line prior to the call(s) to CGFontCreateWithDataProvider:
UIFont.familyNames() // you don't need to iterate this array or do anything with it
No more hanging, app starts up as before and custom fonts all work properly.
I'm getting into UI unit testing, and for a couple days now the UI unit testing refuses to start properly. I setup a simple test to click a button, and when I run it, it hangs starting the app before even starting the test.
Note, it always hangs exactly one minute and then proceeds with the test correctly.
If I delete the app from the Simulator device, or clear the entire Simulator's Content and Settings, then the test runs successfully and instantly on the first run. It hangs each time after that until I delete again. This is not great either, as I end up getting new Location approval prompts each time which might interfere with the app.
What's going on here?
t = 0.00s Start Test
t = 0.00s Set Up
t = 0.00s Launch com.domain.appName
2015-10-06 11:59:24.493 XCTRunner[66707:4085844] Continuing to run tests in the background with task ID 1
t = 0.92s Waiting for accessibility to load
t = 60.92s Wait for app to idle
... rest of test runs immediately
I am also facing this issue but occasionally. Re-attempt or reboot simulator fixes the issue, but temporarily.
The answer at https://forums.developer.apple.com/thread/15780 worked for me:
Pointing the launch screen at a storyboard that is also used for
code, and has connected outlets to a UIViewController subclass. These
outlets can't be resolved by springboard while it generates a launch
image, and it seems to fail over and over, before timing out after 60
seconds.
One solution is to clear out the launch screen setting.
Another solution is to create and add a launch screen to your project by following the instructions at https://developer.apple.com/library/ios/documentation/IDEs/Conceptual/AppDistributionGuide/ConfiguringYourApp/ConfiguringYourApp.html#//apple_ref/doc/uid/TP40012582-CH28-SW4 reproduced below:
Choose File > New > File.
Under iOS, select User Interface.
Click Launch Screen and click Next.
Enter a filename in the Save As text field, and click Create
Configure your launch screen file using basic UIKit views, such as UIImageView and UILabel objects, and uses Auto Layout constraints.
To set the launch screen file
If necessary, open the “App Icons and Launch Images” section of the General pane.
From the Launch Screen File pop-up menu, choose a launch screen file.
I use a webview and I show an external page; I would like that the back button appears only if there is a web history. I saw that exist a canGoBack() function, but I don't know how use this function.
NB my user see the webview (back button must be hidden) if the user click on the link and the web page is changed, the back button should be appear... if the user go back to the webview home , the back button disappear.
This code is triggered only when i load the webview for the first time, if navigate the webview the function is ignored:
if(webview.canGoBack()){
//webview.goBack();
Titanium.API.log('1');
}
else{
//win.close();
Titanium.API.log('0');
}
I hope I was clear. Thanks
Put this in the load event:
webview.addEventListener('load', function() {
if(webview.canGoBack()){
//webview.goBack();
Titanium.API.log('1');
}
else{
//win.close();
Titanium.API.log('0');
}
});
The load event is called every time the page changes.