[mapguide-commits] r8771 - in trunk/MgDev/UnitTest/Acceptance/tests: . fusion
svn_mapguide at osgeo.org
svn_mapguide at osgeo.org
Sun Oct 11 16:02:05 PDT 2015
Author: jng
Date: 2015-10-11 16:02:05 -0700 (Sun, 11 Oct 2015)
New Revision: 8771
Added:
trunk/MgDev/UnitTest/Acceptance/tests/fusion/
trunk/MgDev/UnitTest/Acceptance/tests/fusion/appdef.js
trunk/MgDev/UnitTest/Acceptance/tests/fusion/slate_navigation.js
Modified:
trunk/MgDev/UnitTest/Acceptance/tests/settings.js
Log:
#2573: Add some basic tests for the fusion slate template
Added: trunk/MgDev/UnitTest/Acceptance/tests/fusion/appdef.js
===================================================================
--- trunk/MgDev/UnitTest/Acceptance/tests/fusion/appdef.js (rev 0)
+++ trunk/MgDev/UnitTest/Acceptance/tests/fusion/appdef.js 2015-10-11 23:02:05 UTC (rev 8771)
@@ -0,0 +1,26 @@
+var cmdCodes = {
+ ZOOM_IN: 1,
+ ZOOM_OUT: 2,
+ ZOOM_RECT: 3
+};
+
+module.exports = {
+ TB: cmdCodes,
+ getToolbarCommand: function(toolbarRootSelector, cmd) {
+ var className = null;
+ switch (cmd) {
+ case cmdCodes.ZOOM_IN:
+ className = "zoom-in-fixed";
+ break;
+ case cmdCodes.ZOOM_OUT:
+ className = "zoom-out-fixed";
+ break;
+ case cmdCodes.ZOOM_RECT:
+ className = "zoom-in";
+ break;
+ default:
+ throw new Error("Unknown command code: " + cmd);
+ }
+ return toolbarRootSelector + " div.jxBarScroller div.jxBarWrapper ul.jxToolbar li.jxToolItem span.jxButtonContainer a.jxButton span.jxButtonContent img." + className;
+ }
+};
\ No newline at end of file
Added: trunk/MgDev/UnitTest/Acceptance/tests/fusion/slate_navigation.js
===================================================================
--- trunk/MgDev/UnitTest/Acceptance/tests/fusion/slate_navigation.js (rev 0)
+++ trunk/MgDev/UnitTest/Acceptance/tests/fusion/slate_navigation.js 2015-10-11 23:02:05 UTC (rev 8771)
@@ -0,0 +1,61 @@
+var settings = require("../settings");
+var helper = require("../helper");
+var appDef = require("./appdef");
+
+module.exports = {
+ tags: ["fusion", "slate", "navigation"],
+ beforeEach: function(browser) {
+ helper.setDefaultBrowserSize(browser);
+ },
+ 'SLATE_NAV001 - Zoom In': function(client) {
+ var funcName = arguments.callee.name;
+ client.url(settings.getFusionUrl("slate"))
+ .waitForElementVisible("div.olMapViewport", 8000, true)
+ .waitForElementVisible("img.olTileImage", 8000, true)
+ .waitForElementVisible("#Navigator", 2000, true)
+ .waitForElementVisible("#TaskPane_IFRAME", 2000, true)
+ .frame("TaskPane_IFRAME")
+ .waitForElementVisible("h1", 3000, true)
+ .assert.containsText("h1", "Task Pane Help")
+ .frame(null)
+ .moveToElement(appDef.getToolbarCommand("#ToolbarSecondary", appDef.TB.ZOOM_IN), 10, 10)
+ .mouseButtonClick(0)
+ .pause(3000) //Let rendering breathe
+ .saveScreenshot(helper.screenshotName(client, "Fusion - " + funcName + " - 001 - Zoom In clicked"))
+ .end();
+ },
+ 'SLATE_NAV002 - Zoom Out': function(client) {
+ var funcName = arguments.callee.name;
+ client.url(settings.getFusionUrl("slate"))
+ .waitForElementVisible("div.olMapViewport", 8000, true)
+ .waitForElementVisible("img.olTileImage", 8000, true)
+ .waitForElementVisible("#Navigator", 2000, true)
+ .waitForElementVisible("#TaskPane_IFRAME", 2000, true)
+ .frame("TaskPane_IFRAME")
+ .waitForElementVisible("h1", 3000, true)
+ .assert.containsText("h1", "Task Pane Help")
+ .frame(null)
+ .moveToElement(appDef.getToolbarCommand("#ToolbarSecondary", appDef.TB.ZOOM_OUT), 10, 10)
+ .mouseButtonClick(0)
+ .pause(3000) //Let rendering breathe
+ .saveScreenshot(helper.screenshotName(client, "Fusion - " + funcName + " - 001 - Zoom Out clicked"))
+ .end();
+ },
+ 'SLATE_NAV003 - Zoom Rect': function(client) {
+ var funcName = arguments.callee.name;
+ client.url(settings.getFusionUrl("slate"))
+ .waitForElementVisible("div.olMapViewport", 8000, true)
+ .waitForElementVisible("img.olTileImage", 8000, true)
+ .waitForElementVisible("#Navigator", 2000, true)
+ .waitForElementVisible("#TaskPane_IFRAME", 2000, true)
+ .frame("TaskPane_IFRAME")
+ .waitForElementVisible("h1", 3000, true)
+ .assert.containsText("h1", "Task Pane Help")
+ .frame(null)
+ .moveToElement(appDef.getToolbarCommand("#ToolbarSecondary", appDef.TB.ZOOM_RECT), 10, 10)
+ .mouseButtonClick(0)
+ .pause(3000) //Let rendering breathe
+ .saveScreenshot(helper.screenshotName(client, "Fusion - " + funcName + " - 001 - Zoom Rect clicked"))
+ .end();
+ }
+};
\ No newline at end of file
Modified: trunk/MgDev/UnitTest/Acceptance/tests/settings.js
===================================================================
--- trunk/MgDev/UnitTest/Acceptance/tests/settings.js 2015-10-08 06:35:59 UTC (rev 8770)
+++ trunk/MgDev/UnitTest/Acceptance/tests/settings.js 2015-10-11 23:02:05 UTC (rev 8771)
@@ -6,8 +6,16 @@
getAjaxViewerUrl: function(webLayout) {
return "http://" + this.host + ":" + this.port + "/" + this.vdir + "/mapviewerajax/?USERNAME=Anonymous&WEBLAYOUT=" + (webLayout || this.defaultWebLayout);
},
+ getDefaultFlexLayout: function(template) {
+ switch (template) {
+ case "slate":
+ return "Library://Samples/Sheboygan/FlexibleLayouts/Slate.ApplicationDefinition";
+ default:
+ return "";
+ }
+ },
getFusionUrl: function(template, layout) {
- return "http://" + this.host + ":" + this.port + "/" + this.vdir + "/fusion/templates/mapguide/" + template + "/index.html?ApplicationDefinition=" + layout;
+ return "http://" + this.host + ":" + this.port + "/" + this.vdir + "/fusion/templates/mapguide/" + template + "/index.html?ApplicationDefinition=" + (layout || this.getDefaultFlexLayout(template));
}
};
module.exports = settings;
\ No newline at end of file
More information about the mapguide-commits
mailing list