Projects tagged ‘firefox’ and ‘test’


Jump to tag:

Projects tagged ‘firefox’ and ‘test’

Filtered by Project Tags firefox test

Refine results Project Tags javascript (1) automated (1) watir (1) jssh (1) http (1) ftp (1) soap (1) firewatir (1) html (1) language (1) browser (1) unittest (1)

[3 total ]

0 Users

A start at writing some code to allow driving Firefox from groovy This is the WATIR example ported to groovy. It runs fine with the current check out. /** ported from the wair bonus examples zip ... [More] file */ import firewatig.* import groovy.util.GroovyTestCase class ArticleExample extends GroovyTestCase { void testSearch () { def ff = new Firefox() ff.go("http://www.google.com/ncr") ff.textField("name", "q").set("pickaxe") ff.button("value","Google Search").click() assert(ff.text().contains("Programming Ruby: The Pragmatic Programmer's Guide")); } } [Less]
Created about 1 year ago.

0 Users

TestPlan is an automated testing tool for testing interactive web systems. It offers these features: Testing web pages via a Firefox or Internet Explorer, or a display-less backend Reporting for ... [More] status feedback on an entire test suite Metrics for page responses and availability Email and FTP for full web application testing Unified syntax for Email, Text, HTML, CSV, and XML data Advanced tracing for locating overnight errors High-level specialized testing language suitable for non-developers JavaScript and dynamic page testing Documentation at: http://testplan.brainbrain.net/ [Less]
Created about 1 year ago.

0 Users

DescriptionLet you test your Firefox/Thunderbird extension from inside the application and with command line with Rhino. How does it workVery simple, you could run it under Rhino JavaScript Shell or ... [More] under Mozilla application from inside your extension code. Show me examplefile testExample.js function make() { return { log:"Log", files: [1, 2, "3"] }; } test.example = function() { assert.that(make(), is.eqJson({ log:"Log", files:[1, 2, 3]})); };produce following log testExample.js: example: Assert #1: < expected: { 'files' : [ 1, 2, 3 ], 'log' : 'Log' } :>, < got: { 'files' : [ 1, 2, '3' ], 'log' : 'Log' } :>, < difference between (-)expected and (+)got : { 'files' : [ 1, - 3 + '3' ], 'log' : 'Log' } :> testExample.js: Warning: Reason: Polluted global namespace with 'make'What functions it provideslog(text) ignore(name) //ignore global variable with name "name" importFile(filename) //to import another JS file various assert methodsInstallationFirst you have to create a folder just under your extension root (where content folder is) named test-framework and copy code there. Alternatively you could use svn:externals to do that. Then somewhere in the extension code you create a folder for test cases. Files with test cases should start with "test". Now create some test or copy that example from above and you are almost ready to go. To start tests from command line you should run java -cp test-framework/js.jar org.mozilla.javascript.tools.shell.Main -version 170 -debug test-framework/main.js --test-directory content/tests/--test-directory command line option obviously should point to directory with tests Start it from application is a little bit harder. Just copy the code from below and change the id of extension and path to tests var MY_ID = "{282C3C7A-15A8-4037-A30D-BBEB23FFC76B}"; var em = Components.classes["@mozilla.org/extensions/manager;1"].getService(Components.interfaces.nsIExtensionManager); var file = em.getInstallLocation(MY_ID).getItemFile(MY_ID, "test-framework/main.js"); var fstream = Components.classes["@mozilla.org/network/file-input-stream;1"].createInstance(Components.interfaces.nsIFileInputStream); var sstream = Components.classes["@mozilla.org/scriptableinputstream;1"].createInstance(Components.interfaces.nsIScriptableInputStream); fstream.init(file, -1, 0, 0); sstream.init(fstream); var data = ""; var str = sstream.read(4096); while (str.length > 0) {data += str; str = sstream.read(4096);} sstream.close(); fstream.close(); eval(data); run_tests(MY_ID, "content/tests/", document);Make sure that code doesn't go into your packaged extension of is turned off by some preference. It won't work and might be security issue. LimitationIt will work only where JavaScript 1.7 supported, that is Gecko 1.8.1 or above. It will work only if your extension is installed to development, that is, not packaged. That's when you want it to run anyway. It doesn't work / I know a better waySend me a patch. Make a note if you'd like to become co-owner. [Less]
Created 11 months ago.