Comments (3)
Hi,
I tried it a bit further: I took the Runnerquirks.html page from
JsTestDriver.jar
and added my special bootstrap into the head section there. This worked well so
far.
I further added some HTML into the body of the Runnerquirks.html file, however
this
is not working (it seems that the body content is reset by the framework).
I then wrote a setUp() method in my test case where I defined the innerHTML of
the
body manually like this:
TestSample.setUp = function(sTestName) {
document.body.innerHTML = "<div id=\"uiArea\"></div>";
document.attachEvent("load", function() {
var oButton = new Button("b1", {Text:"Hello"}); // "Button" is a custom widget
setRoot("uiArea", oButton); // "setRoot" is a function
// from my bootstrap which is
// setting the widget into the
// div
});
};
My test function is able to access the "uiArea" div element, but not the "b1"
Button
widget as it is just created when the document has been loaded!
Questions:
* Are there other ways how to define a HTML document as part of the text
fixture?
Proposal: It should be possible to define an arbitrary HTML document containing
the unit tests, get it loaded by the framework, and inject the framework JS
files
into the document.
* How can widgets be tested which are rendered on the onLoad event of the
document?
The JSTD seems to run the unit tests already before this event is occuring.
Best regards,
Timo
Original comment by [email protected]
on 2 Oct 2009 at 12:08
from js-test-driver.
Hi Timo,
We do not have a setUp/tearDown on the suite level.
For your other questions:
to define HTML you can use our special syntactic sugar see:
http://code.google.com/p/js-test-driver/wiki/HtmlDoc
Testing on the onload can be an issue as we are always keeping the browser hot
and
not refreshing/reloading the page every time we run the tests. Maybe you could
try to
run your tests in a different way?
Original comment by [email protected]
on 2 Nov 2009 at 7:09
from js-test-driver.
Dropping this, as there hasn't been a response in 3 years.
Original comment by [email protected]
on 6 Jun 2012 at 11:22
- Changed state: Invalid
from js-test-driver.
Related Issues (20)
- Eclipse test result order
- [deleted issue]
- charset add a line to config file
- Enable reading files within jars HOT 2
- The eclipse plugin cannot be use. HOT 1
- JSTD runs very slowly when Chrome slave runs in a "background" tab HOT 1
- jstd tries to serve folder "components.js" as a file
- Multiple files with same name in different locations loaded in wrong order
- jstestdriver.conf as unicode won´t load
- Eclipse plugin is not using last 1.3.5 version
- Cannot mirror update site
- Intellij Cardea 132.839 can't run test, exception is thrown
- Is it possible to force to specific DOC-type/document mode?
- No browsers available, yet actions only when run from Jenkins.
- Using webjars, possible?
- loading file not from load config HOT 3
- executing test cases from command line producing error
- TestCase error after use /*DOC: */
- Enter one-line summary-Ammar Allia Partagé
- Can't load moment-with-langs.min.js HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from js-test-driver.