The tirgger() is supposed to return this, but seems not to do
so always. The subsequent tests confirm that the click event
has happened anyway.
If the click event does not happen for some reason, the next
tests will fail, so I believe the testing is as good.
runs(function () {
debug("Click on submit button");
runs(function () {
debug("Click on submit button");
- var click = $("input.mkwsButton").trigger("click");
- expect(click.length).toBe(1);
+ $("input.mkwsButton").trigger("click");
function my_click(id, time) {
setTimeout(function () {
debug("trigger click on id: " + id);
function my_click(id, time) {
setTimeout(function () {
debug("trigger click on id: " + id);
- var click = $(id).trigger("click");
-
- debug("next/prev: " + id + " click is success: " + click.length);
- expect(click.length).toBe(1);
+ $(id).trigger("click");
}, time * jasmine_config.second);
}
}, time * jasmine_config.second);
}
- var click = $("div.mkwsFacetAuthors div.term:nth-child(" + author_number + ") a").trigger("click");
- debug("limit author click is success: " + click.length);
- expect(click.length).toBe(1);
+ $("div.mkwsFacetAuthors div.term:nth-child(" + author_number + ") a").trigger("click");
waitsFor(function () {
return get_hit_counter() < hits_all_targets ? true : false;
waitsFor(function () {
return get_hit_counter() < hits_all_targets ? true : false;
- var click = $("div.mkwsFacetSources div.term:nth-child(" + source_number + ") a").trigger("click");
- debug("limit source click " + (source_number - 1) + " is success: " + click.length);
- expect(click.length).toBe(1);
-
+ $("div.mkwsFacetSources div.term:nth-child(" + source_number + ") a").trigger("click");
+
waitsFor(function () {
if ($("div.mkwsNavi").length && $("div.mkwsNavi").text().match(/(Source|datenquelle|kilder): /i)) {
return true;
waitsFor(function () {
if ($("div.mkwsNavi").length && $("div.mkwsNavi").text().match(/(Source|datenquelle|kilder): /i)) {
return true;
describe("Show record", function () {
var record_number = 1; // the Nth record in hit list
it("show record author", function () {
describe("Show record", function () {
var record_number = 1; // the Nth record in hit list
it("show record author", function () {
- var click = $("div.mkwsRecords div.record:nth-child(" + record_number + ") a").trigger("click");
+ $("div.mkwsRecords div.record:nth-child(" + record_number + ") a").trigger("click");
+/* debug("### click=" + typeof(click) + " " + click );
+ debug("### len=" + click.length );
debug("show record click is success: " + click.length);
expect(click.length).toBe(1);
debug("show record click is success: " + click.length);
expect(click.length).toBe(1);
// wait until the record pops up
waitsFor(function () {
var show = $("div.mkwsRecords div.record:nth-child(" + record_number + ") div");
// wait until the record pops up
waitsFor(function () {
var show = $("div.mkwsRecords div.record:nth-child(" + record_number + ") div");
});
it("switch to target view", function () {
});
it("switch to target view", function () {
- var click = $("div.mkwsSwitch").children('a').eq(1).trigger("click");
- debug("target view click is success: " + click.length);
- expect(click.length).toBe(1);
+ $("div.mkwsSwitch").children('a').eq(1).trigger("click");
// now the target table must be visible
expect($("div.mkwsBytarget").is(":visible")).toBe(true);
// now the target table must be visible
expect($("div.mkwsBytarget").is(":visible")).toBe(true);
});
it("switch back to record view", function () {
});
it("switch back to record view", function () {
- var click = $("div.mkwsSwitch").children('a').eq(0).trigger("click");
- debug("record view click is success: " + click.length);
- expect(click.length).toBe(1);
+ $("div.mkwsSwitch").children('a').eq(0).trigger("click");
// now the target table must be visible
expect($("div.mkwsBytarget").is(":visible")).toBe(false);
// now the target table must be visible
expect($("div.mkwsBytarget").is(":visible")).toBe(false);