Add in CasperJS test to check if Dashboard Widgets are moveable

Requires .time-widget
This commit is contained in:
Matthew Harrison-Jones 2013-08-16 12:44:33 +01:00
parent 6170acb670
commit 39df7a74f7

View File

@ -28,3 +28,24 @@ casper.test.begin("Ghost dashboard is correct", 13, function suite(test) {
test.done();
});
});
casper.test.begin("Ghost dashboard interactions are correct", 2, function suite(test) {
casper.test.filename = "dashboard_interactions_test.png";
casper.start(url + "ghost", function testTitleAndUrl() {
test.assertExists(".widget-time", "Time widget is present");
}).viewport(1280, 1024);
casper.then(function testWidgetDragAbility() {
var origPos = this.getElementBounds('.widget-time');
this.mouse.down('.widget-time .widget-footer');
this.mouse.move(150, 650);
this.mouse.up(150, 650);
test.assertNotEquals(this.getElementBounds('.widget-time'), origPos, 'Time Widget has moved');
});
casper.run(function () {
test.done();
});
});