Skip to content

Commit

Permalink
Add query string parameter functional test.
Browse files Browse the repository at this point in the history
  • Loading branch information
reid committed Aug 27, 2012
1 parent b704f5e commit d378681
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
22 changes: 22 additions & 0 deletions test/fixture/query-string.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<!doctype html>
<title>Yeti Query String Test</title>
<script src="../../dep/yui-test.js"></script>
<script>
YUI().use("test", function (Y) {
var QueryStringTestCase = new Y.Test.Case({
name: "Yeti Query String Test Case",
testMoof: function () {
var dogcow = (window.location.search.match(/[?&]dogcow=([^&]+)/) || [])[1] || "?";
Y.Assert.areEqual("moof", dogcow);
}
});

var QueryStringSuite = new Y.Test.Suite("Yeti Query String Test Suite");

QueryStringSuite.add(QueryStringTestCase);

Y.Test.Runner.add(QueryStringSuite);

Y.Test.Runner.run();
});
</script>
11 changes: 11 additions & 0 deletions test/functional.js
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,10 @@ function visitorContext(createBatchConfiguration) {
assert.include(result, "name");
assert.include(result, "timestamp");
},
"the client-side test passed": function (topic) {
assert.strictEqual(topic.agentResults[0].passed, 1);
assert.strictEqual(topic.agentResults[0].failed, 0);
},
"the agentBeat event fired for each beat received": function (topic) {
// Beats are subjective, they are a ping and not really trackable
// since they may be throttled they may not match up to the actual
Expand Down Expand Up @@ -553,6 +557,13 @@ vows.describe("Yeti Functional")
.addBatch(hub.functionalContext({
"visits Yeti": visitorContext(withTests("basic.html", "local-js.html", "404-script.html"))
}))
.addBatch(hub.functionalContext({
"visits Yeti with a query string parameter": visitorContext({
basedir: basedir,
tests: fixtures(["query-string.html"]),
query: "dogcow=moof"
})
}))
.addBatch(hub.functionalContext({
"visits Yeti then aborts during the batch": clientFailureContext(withTests("long-async.html"))
}))
Expand Down

0 comments on commit d378681

Please sign in to comment.