Saucelab - webdriverio : sessionID for sauce dashboard - saucelabs

I am trying out wdio and saucelabs. I see way to https://wiki.saucelabs.com/display/DOCS/Setting+Up+Reporting+between+Sauce+Labs+and+Jenkins configure report by outputting the sessionID
I am not able to figure out how I can do using webdriverio javascript method.
can you point to some example if this is possible with javascript ?

WebdriverIO comes with a Sauce service that automatically integrates this for you: http://webdriver.io/guide/services/sauce.html
If you're interested in more details, I wrote a blog post about a similar method I used for integrating Jenkins and Browserstack.

Related

How do I write tests for Meteor which involves templating?

I recently created a Meteor package and want to write some tests. What my test package basically do is that users can insert into the template {{> abc}} and they'll get an HTML element printed on the page.
With TinyTest, all you can do is test the package's API using something like test.equal(actual, expected, message, not). However, I need it to test whether the element was successfully printed on the page. Furthermore, I will pass the template some parameters and test them too.
It seems like I'd have to create a dummy app, run bash to initiate the app, and test whether the elements can be found on page. So should I only use TinyTest to test the API, and write my own tests (somehow!) for templating? If not, how should I go about it?
I read something about Blaze.toHTML, but I cannot find anything in the documentation on it? Nor it's source page.
I think TinyTest is great for starting with Unit testing, but what you need sounds more like an Integration test.
I would recommend you look into the following links for more info on testing with Meteor, especially with Velocity - Meteor's official testing framework:
Announcing Velocity: the official testing framework for Meteor applications
Velocity
The Meteor Testing Manual
You can create a demo application, and run integration tests using Mocha or Jasmine.

Google Drive API - Example code is not working

I want to use Google API to transfer SharePoint Documents to Google Drive using dot net. For that to happen I want to use this link Google Quick Start.
I have followed every little piece of information. It states in beginning "Complete the steps described in the rest of this page, and in about five minutes you'll have a simple Drive app that uploads a file to Google Drive" but it is not true.
I am trying to run this sample example since yesterday but failed.
// Register the authenticator and create the service
var provider = new NativeApplicationClient(GoogleAuthenticationServer.Description, CLIENT_ID, CLIENT_SECRET);
var auth = new OAuth2Authenticator<NativeApplicationClient>(provider, GetAuthorization);
So it seems that this code example is outdated and Google APIs have been upgraded.
Here comes the warning
[Obsolete("GoogleAuthenticationServer is not supported any more and it's going to be removed in 1.7.0-beta. Consider using the new Google.Apis.Auth NuGet package which supports .NET 4, .NET for Windows Store apps, Windows Phone 7.5 and 8 and Portable Class Libraries as well")]
Another code
var service = new DriveService(new BaseClientService.Initializer()
{
Authenticator = auth
});
And the error
Cannot implicitly convert type 'Google.Apis.Authentication.OAuth2.DotNetOpenAuth.NativeApplicationClient' to 'Google.Apis.Http.IConfigurableHttpClientInitializer'. An explicit conversion exists (are you missing a cast?)
Then I was looking for [latest release samples] there I found the source files.
I was not able able to run the sample also.
Here I was successfully authenticated but then had error for redirect Uri
My Client_Secrets.JSON looks like, as you can see I have set default redirect Uri to http://localhost/.
{"web":{"auth_uri":"https://accounts.google.com/o/oauth2/auth","client_secret":"secret","token_uri":"https://accounts.google.com/o/oauth2/token","client_email":email","redirect_uris":["http://localhost/"],"client_x509_cert_url":"aa#developer.gserviceaccount.com","client_id":"id","auth_provider_x509_cert_url":"https://www.googleapis.com/oauth2/v1/certs","javascript_origins":["http://localhost:53404/"]}}
Now I can run this application but as mentioned getting error
Error: redirect_uri_mismatch
The redirect URI in the request: [[http://localhost:2430/authorize/]] did not match a registered redirect URI
I really don’t know from where this port number comes and from where this authorize comes. As you can see in my JSON, I have not set anything similar.
I am using VS 2010 SP1 Ultimate and Windows 7 home Basic.
I have tried to give complete information and my end goal is upload document in Google drive.
The tutorial you are following uses an older version of google.apis thats why you are seeing the not supported. Here are a couple of tutorials on how it works with the new version of the api.
http://daimto.com/google-oauth2-csharp/
http://daimto.com/google-drive-api-c/
Take a look in https://code.google.com/p/google-api-dotnet-client/source/browse/Tasks.ASP.NET.SimpleOAuth2/Default.aspx.cs?repo=samples. It's a Task API ASP.NET sample. As you can see you need to add several lines of code, but it works.
I downloaded the samples Eyal mentions and got that compiling before integrating with my own app. .Net needs to be 4 although it states it supports higher.
You have to set the redirect URI in the google developer console, not in your JSON. In your case, you would want to set it to http://localhost:2430/authorize/.

Load google map api aynchronously using steal.js

I am trying to executing the following code using steal.js (from javascriptmvc extention):
steal("http://maps.google.com/maps/api/js?sensor=true");
This is working for all other scripts. But, in case of google map api url, its saying "'sensor' parameter isn't set" type error message. How to get rid of this please?
If you can show some other way to load this script asynchronously, that will be ok as well. Like, I tried with google js api loader, but that support for loading google map api up to version 2, no support for 3. Thanks in advance.
You don't typically steal external scripts. steal wont be able to build them into your production file.
Regardless, the current Google Maps API is not intended to be loaded asynchronously. If you examine the source, you'll see it uses document.write, which wont work properly after the page has loaded without the help of a 3rd party library.
Per the comment below, I was wrong. You can load Google Maps asynchronously using the callback parameter:
window.myCallback = function() {
new google.maps.Map(...);
};
$.getScript('//maps.google.com/maps/api/js?sensor=false&callback=myCallback');

Open popup window on calling action

I just started working on alfresco v 3.4. I have created document library action from the tutorials provided on alfresco site. Anybody tell me how to open a popup box on hitting action with some data inside it. Please guys, I am in big trouble !!!
Thanks in advance.
For Alfresco Share you have to use client side javascript. You can use Alfresco's built in functions (Alfresco.module.SimpleDialog) or just include your javascript library of choice and implement it using that.
If you'll use Alfresco's implementation (YUI) thenLook at this file:
YOUR_INTALLATION/tomcat/webapps/share/components/documentlibrary/action.js
And search for:
Alfresco.module.SimpleDialog
And don't forget to include/import your own client side files in your webscript. For this look at:
http://wiki.alfresco.com/wiki/3.0_Component_Standards

protecting the URL where flash/flex app can be executed

Is there an easy copyprotection, so that I can define in code the URL where flash/flex app can be executed
Here is a detailed tutorial on how to achieve that:
http://active.tutsplus.com/tutorials/actionscript/quick-tip-lock-your-swf-to-a-specific-domain-name/

Resources