html5 apps automated testing - javascript

Are where any good frameworks for automated testing HTML5 apps?
I'm now writing an app which should work offline in iOS Safari and it would be awesome if there were some automated testing tools. I have no idea how to test cache.manifest properly, for example.
I'm using Backbone.js, by the way. That would be even better if the tool relies on it or interacts with it in a good way

Answering by listing a link is not always the best way to go, but hey someone did the work before me: http://tinnedfruit.com/2011/03/03/testing-backbone-apps-with-jasmine-sinon.html
Jasmine.js to test
Sinon.js to mock

Related

How to test chrome extension in 2022

I'm developing a chrome extension and I would like to know how to test it. I'm interested ideally in both unit and integration, but mostly integration tests. I've tried googling, but most of the solutions I found are either not good enough for the purpose or are using libraries which lost support. Also I'm new to javascript world, so if I would really appreciate a more detailed info. Thanks!

how to use selenium for desktop application?

I am working on a retail software where i have to do automation testing of desktop application using selenium. How it can be done using selenium? And we have portal too in which some details are being updated. So the testing will be done for a desktop application and web application. i am fresher i this field and started learning new things. Please help me with this. Thanks in advance. i have completed automation of portal but there are details which are being updated to portal from software.
Selenium only works in a browser environment.
You could try out Sikuli to solve your problem
I don't think Selenium can do it. This software is tailored for web applications and it only runs in browsers. I've recently heard a lot about AutoIt, which is more appropriate for desktop applications.
Fortunately, there seem to exist ways to make Selenium and AutoIt work together. http://www.toolsqa.com/selenium-webdriver/autoit-selenium-webdriver/
Good luck with your issue

End-2-End Testing outside angularjs

I'm looking for a way to test an app or a website, which is not based on angularjs, on real browsers and real devices. I found CasperJS, but CasperJS only runs with headless browsers.
Are there test-runner/testing-framework combinations out there which support:
grunt
all major browser (Chrome, Firefox, Safari, IE)
headless browsers (PhantomJS)
(optional) simulate touch gestures
I would choose protractor. I know its main target is angular, but it works fine without angular as well. It has nice shortcut features. We use it to test non-angular sites and it looks stable enough. Otherwise it is based on webdriverjs, and it can work with phantomjs as well.
There is a good starter setup: https://github.com/angular/angular-seed
And this page can help to tune it for your requirements:
http://ng-learn.org/2014/02/Protractor_Testing_With_Angular_And_Non_Angular_Sites/
And the main urls:
https://github.com/angular/protractor
https://code.google.com/p/selenium/wiki/WebDriverJs
I didn't test the phantomjs part, but google says it should be fine.
About main browsers Protractor can connect to Saucelabs as well.
http://www.saucelabs.com/
And they have 301 different Device/OS/Browser Platforms at now. https://saucelabs.com/platforms
Selenium is certainly the most widely used test automation tool that meets your requirements. I personally used Sahi most of the times which does the same but afaik has no grunt integration.

Palm Pre and Visual Studio. Possible?

The development experience for the Palm Pre sucks, to say the least. At best you are working on JavaScript in Eclipse with the Aptana plugin. The intellisense you get is really, really dismal. You have to be looking at the documentation every 5 seconds.
I was thinking, Visual Studio really excels at JavaScript and intellisense. Has anyone succeeded at writing Palm Pre code in VS2008 with intellisense, which would require hooking in Palm's Mojo Library?
Is there a known way to hook in 3rd party non-source libraries to JavaScript in Vs2008?
I've been looking for alternatives to Eclipse, too, but so far it does not appear that anyone has done it. For myself it felt like too much work, so I just switched to working with several terminal windows open and a browser window to the documentation.
I'm a long time eclipse user but was disappointed in the eclipse environment for Pre - especially after using the Android SDK which hooks nicely into eclipse (then again the dev environment is Java there).
Have you tried Komodo? I switched over to it and the autocompletion is nice and the webos addon does a decent job. I don't have the professional version so I can't comment on the debugging capability which I'd love to have.
If you can tell VS08 you want to load the Mojo.js stuff, then it should work. I think you should be able to configure any custom tools you need for building etc. as well.
Personally I'd recommend you check out JetBrains' IntelliJ IDEA. They have really good JavaScript support and I've used it with some Pre-stuff as well.

Selenium or Watir for Javascript Testing in Rails

We're using RSpec and Cucumber in our Rails apps with good results. Webrat is great for non-AJAX interactions, but we're getting ready to get back into writing tests for our Javascript.
Webrat has Selenium support built in, and we've used Selenium before, but I'm curious if anyone has had good results using Watir with Cucumber and what the pros and cons are of Watir versus Selenium.
As the founder of OpenQA and Selenium RC, I'm obviously biased towards Selenium as a good option. We recently just put out a 1.0 beta 2 release and are very close to a 1.0 final.
However, you couldn't go wrong with Watir/FireWatir either. Adam's comment that WebDriver will merge to form Selenium 2.0 is correct, but he's incorrect in implying that Watir doesn't use native hooks. If Watir were simply a Selenium clone and also used JavaScript injection, I'd say it wasn't worth looking at.
But because it has native hooks, it can do some things that Selenium currently can't. While it has fewer browsers supported, it goes a bit deeper in the main browser it does support (IE) and lets you control things outside of the page/canvas.
In summary: either is fine, Selenium is great, and if you hang on a little longer with Selenium you'll soon get the best of both worlds with WebDriver/Selenium 2.0.
I am having good results using Cucumber with Celerity through JRuby.
Celerity is a headless browser which wraps around HtmlUnit with a Watir-compatible API and supports JavaScript and AJAX testing.
Being headless makes Celerity faster and easy to integrate within a Continuous Integration build cycle.
Since Celerity is API-compatible with Watir, you can switch between Watir and Celerity fairly easily. There are some caveats, but it's been worth the effort.
I'd say Watir was much slicker, but less useful. It's mostly an IE automation system, with fairly flaky Firefox support. (I'll admit to not having checked out FireWatir in a while, it may have improved.)
There is experimental support for Selenium-RC on Watir. That would definitely be the best of both worlds.
You may want to try WebDriver. It will become part of Selenium in the future. Works with JRuby.
It is different than Selenium, Sahi or Watir in the way that it controls the browser natively, not using JavaScript, and is not affected by many issues other solutions have.
I have tried Watir but not with cucumber. It was for java app. Problems we faced were with was trying to determine page is loaded. We had to scrape the forums a bit before finding the solutions. Otherwise it was fine.
Watir 2.0 will also use WebDriver.
If you would like to use Watir on Rails 3.
You can use 'watir-webdriver-rails' gem (I'm the creator).
Best solution which I found its Env-Js http://github.com/smparkes/env-js
Its like webrat but with JS support
Don't overlook something like QUnit or Jasmine to unit test your javascript. If nothing else it'll cut down on the number of full-stack tests you have to write in cucumber/selenium/capybara/whatever

Categories

Resources