custom command with BrowserStack+WebdriverIO+Travis - travis-ci

I have a test case for checking forgot password, so I need to read a link from the email. In order to do it I made a custom command in wdio.conf.js
browser.addCommand('readLastUnseenLink', function async(){
...
}
It works fine when testing locally on the laptop, it also works well when testing with WebdriverIO Local testing in Browserstack. But, for some reasons, when I push code to Trvais, I got.
browser.readLastUnseenLink is not a function
Does anyone had that issue before or maybe there is some trivial solution?

Found my issue, I have one main file and other 3 are merged with main, so functions were added only to the main one and other cached and didn't updated.

Related

Unable to acquire Singleton lock in Azure WebJob after removing SingletonAttribute

I have got a WebJob containing functions having a TimeTriggerAttribute. They also have a SingletonAttribute on them, so they don't get executed in parallel.
Deployed in the App Service everything works as expected.
When running it locally it did work as expected for a while and then the output of the Job host reports:
Development settings applied
Found the following functions:
MyNamespace.WebJobs.Functions.MyFunctionAsync
Unable to acquire Singleton lock (bd99766f202e4ac4ba230557b7180bd2/MyNamespace.WebJobs.Functions.MyFuncitonAsync.Listener).
I removed the singleton attribute, but the message keeps showing. I also re-built the project and restarted the machine. Nothing helped.
I renamed the function and it was again scheduled as expected. Now I could also re-add the SingletonAttribute and everything worked as expected. When I rename it back to the original, the error comes back.
What can I do in order to be able to acquire the lock again from the Job host?
By reading this article I figured out that on top of the SingletonAttribute I did set, the TimeTriggerAttribute uses another one behind the scenes. Thank you Janley Zhang.
The ID of the host is, by default, constant across deployments. So when multiple developers that use the same storage account execute the code locally, they would try to acquire the same blob lease and only the first would be successful.
I ended up using a distinct host ID for each developer, like
if (jobHostConfiguration.IsDevelopment)
{
jobHostConfiguration.UseDevelopmentSettings();
jobHostConfiguration.HostId = Environment.UserName.ToLowerInvariant();
}

Parse Server Cloud Code Does Not Work

Hey guys I have a very confusing issue at hand, I want to state that I have looked through EVERY resource I could find including on here about getting custom cloud code functions to work.
I am hosting Parse Server on Heroku with my database on mLabs
I can successfully call the 'hello' cloud code function
I cannot successfully call any custom Function, even one that prints something to the console
Below is my current process that I have been using trying to get my cloud code functions to work
Open Main.js and Add Cloud code:
Parse.Cloud.define('testParagraph', function(req, res) {
console.log("received......... this is a console log for a test function that will print out a paragraph as a test");
res.success('Hi, this is the start of a new test function that will print out a paragraph');
});
Commit change to git
Push Change to git
Restart Heroku Server
Run App & Call cloud code from iOS app in Swift
Result:
Every Time I get error 141 Invalid Function, however I can call 'hello' successfully. Just not a custom function.
Edit 2: I have discovered that I am unable to update any cloud functions. Meaning that while I can successfully call the "hello" function if I make a change to said function, re-upload to git, restart Heroku the change is not implemented. This leads me to believe that there must be something wrong with either the link to my main.js or it is being uploaded somewhere else and isnt calling the correct main.js... Any insight would be helpful
I solved this issue, my git was behind HEAD and therefore any changes I made did not become active on my Heroku Server, I merged my branches and this solved my problem of not being able to run custom functions. Now I am able to run custom functions, but I still get error 141 when try to query my database, due to the new problem I am marking this as solved and asking a new question.

How to prevent load of meteor.local (when building ios app with phonegap)

This is an extension of a question I asked here, which went unanswered. I am attempting to use the Meteor app on my iPad that I'm hosting on my own remote server. The issue is that when I run the following command, the app builds successfully:
sudo meteor run ios-device --mobile-server=XXXX:XXXX
The problem begins when I click the build button in Xcode to deploy the app to my device. It seems to build everything OK and even load the data from my remote server. But after a few seconds, it reverts back to a local database/build. When I check the Xcode log, it says "Finished load of http://meteor.local/" so it seems to be overwriting the remote data with new, local data. I'm not sure if I have something enabled that's causing Xcode to load a local database or if there's something that I have to turn off to prevent it from loading.
UPDATE:
I've resolved the issue using the suggestion from Jey DWork to apply the missing environment variables in the Meteor server startup.
The ones I added were:
Meteor.absoluteUrl.defaultOptions.rootUrl
process.env.ROOT_URL
process.env.MOBILE_ROOT_URL
process.env.MOBILE_DDP_URL
Without setting these, the ROOT_URL seemed to be getting overwritten after the initial load. As these environment variables do not seem to be documented, I'm still going to search and see if there is a different solution to this issue (as it seems strange that the app would have to re-load itself multiple times before it's usable). For now though, this is a temporary solution.
Have a look at this post :
I've understood my problem, maybe your problem is the same, all explanations here : stackoverflow.com/questions/34658956/
Your app for smartphone must be built with --server=http://IP:PORT parameters
And
Your app for server must be started with --mobile-server http://IP:PORT parameters

Testing Web Apps Using DRT

I'm trying to use DRT for running acceptance tests.
Because it's an acceptance test I need to change the location to open the page under test. But of course, after I've done it my test script is gone.
I tried to use iFrames as a workaround, but Dart doesn't provide any means of getting the content of an iFrame. Which means that it's possible to load the page under test into an iframe, but it's impossible to get its html.
I've checked all the DRT tests in the Dart repo:
http://code.google.com/p/dart/source/browse/#svn%2Fbranches%2Fbleeding_edge%2Fdart%2Ftests%2Fhtml
but it seems that none of them changes the location.
Is it possible to use DRT for running acceptance tests? Is there a workaround I didn't think of?
We haven't come up with a good trick (redirection or iframes) to load the app as it is written and runs the test code on top of it. Instead, you could copy the entrypoint of an app and include the test code there, then run the modified app directly in DRT.
Here is an example from the web-ui codebase of a test that does this. This test runs the TodoMVC app and interacts with it:
https://github.com/dart-lang/web-ui/blob/master/test/data/input/todomvc_listorder_test.html
All we did is copy the original app's html, add the 'testing.js' script tag, and replace the dart script tag with the test code. It might be possible to create a script that automates what we do manually today, but we haven't done that.

ZfcUser registration complications

My problem is that ZfcUser module isnt working properly at OpenShift hosting. Locally on my PC everything is OK i can register and log in but uploaded its not possible. There is no even errors showing up. Everything it says is "Authentication failed. Please try again."
My configs seems to be ok i've tried so many different combinations but looks like scipts have access to database (when i change to something random it shows exceptions etc.).
What i've figured out is that when i submit the register form it passes but it is not adding the user to database it is empty. Other thing is that even the "login_after_reigster" option is "false" it still try to login after "passed" registration.
Everything is the same (expect database configuration) as local (where it works) but not working on remote host
Try exporting the local database and import it on the server! I had this problem too, and this seems to resolve it.
Or, if you can, run in the console
php /path/to/public/folder/index.php orm:schema-tool:create --force
Then it will work!

Resources