From 30374e31f2b504da697dd49f1c1dd6ad8816a381 Mon Sep 17 00:00:00 2001 From: Gabriel Monnerat <gabriel@tiolive.com> Date: Wed, 16 May 2012 16:34:44 -0300 Subject: [PATCH] add new assert to support range of values expected. The position is calculated on planning box and is returning small difference on value in each testnode result. With this, the test was changed to support this range. --- .../testPlanningBoxBlockPosition.xml | 12 ++++++------ bt5/erp5_ui_test/bt/revision | 2 +- .../erp5_ui_test_core/user-extensions.js.xml | 17 +++++++++++++---- bt5/erp5_ui_test_core/bt/revision | 2 +- 4 files changed, 21 insertions(+), 12 deletions(-) diff --git a/bt5/erp5_ui_test/PathTemplateItem/portal_tests/planning_box_field_zuite/testPlanningBoxBlockPosition.xml b/bt5/erp5_ui_test/PathTemplateItem/portal_tests/planning_box_field_zuite/testPlanningBoxBlockPosition.xml index 0fcc3630a3..f15595fa84 100644 --- a/bt5/erp5_ui_test/PathTemplateItem/portal_tests/planning_box_field_zuite/testPlanningBoxBlockPosition.xml +++ b/bt5/erp5_ui_test/PathTemplateItem/portal_tests/planning_box_field_zuite/testPlanningBoxBlockPosition.xml @@ -177,19 +177,19 @@ <td>552</td>\n </tr>\n <tr>\n - <td>verifyElementPositionTop</td>\n + <td>verifyElementPositionRangeTop</td>\n <td>id=group_1_activity_1_block_1</td>\n - <td>251</td>\n + <td>248..251</td>\n </tr>\n <tr>\n - <td>verifyElementPositionTop</td>\n + <td>verifyElementPositionRangeTop</td>\n <td>id=group_2_activity_1_block_1</td>\n - <td>331</td>\n + <td>328..331</td>\n </tr>\n <tr>\n - <td>verifyElementPositionTop</td>\n + <td>verifyElementPositionRangeTop</td>\n <td>id=group_3_activity_1_block_1</td>\n - <td>411</td>\n + <td>408..411</td>\n </tr>\n <tr>\n <td>verifyElementWidth</td>\n diff --git a/bt5/erp5_ui_test/bt/revision b/bt5/erp5_ui_test/bt/revision index 0e46c90894..b775c5e152 100644 --- a/bt5/erp5_ui_test/bt/revision +++ b/bt5/erp5_ui_test/bt/revision @@ -1 +1 @@ -698 \ No newline at end of file +699 \ No newline at end of file diff --git a/bt5/erp5_ui_test_core/SkinTemplateItem/portal_skins/erp5_ui_test_core/user-extensions.js.xml b/bt5/erp5_ui_test_core/SkinTemplateItem/portal_skins/erp5_ui_test_core/user-extensions.js.xml index d1a219e073..f7ce82a720 100644 --- a/bt5/erp5_ui_test_core/SkinTemplateItem/portal_skins/erp5_ui_test_core/user-extensions.js.xml +++ b/bt5/erp5_ui_test_core/SkinTemplateItem/portal_skins/erp5_ui_test_core/user-extensions.js.xml @@ -8,7 +8,7 @@ <dictionary> <item> <key> <string>_EtagSupport__etag</string> </key> - <value> <string>ts20417149.43</string> </value> + <value> <string>ts37194719.51</string> </value> </item> <item> <key> <string>__name__</string> </key> @@ -71,7 +71,6 @@ Selenium.prototype.assertPortalStatusMessage = function(text) {\n Assert.matches(text, actualValue);\n };\n \n -\n Selenium.prototype.doType = function(locator, newText) {\n if (typeof(netscape) != "undefined") {\n // on firefox, we enable privilege to upload file in javascript.\n @@ -94,7 +93,17 @@ Selenium.prototype.doPhantomRender = function(filename) {\n page.render(filename);\n }\n };\n - +\n +Selenium.prototype.assertElementPositionRangeTop = function(locator, range){\n + var positionTop = parseFloat(this.getElementPositionTop(locator));\n + /* example of range 450..455 */\n + var rangeList = range.split("..");\n + var minimumPositionTop = parseFloat(rangeList[0]);\n + var maximumPositionTop = parseFloat(rangeList[1]);\n + if (positionTop < minimumPositionTop || positionTop > maximumPositionTop ){\n + Assert.fail(positionTop + " is not between " + minimumPositionTop + " and " + maximumPositionTop);\n + };\n +}; ]]></string> </value> </item> @@ -104,7 +113,7 @@ Selenium.prototype.doPhantomRender = function(filename) {\n </item> <item> <key> <string>size</string> </key> - <value> <int>2422</int> </value> + <value> <int>2949</int> </value> </item> <item> <key> <string>title</string> </key> diff --git a/bt5/erp5_ui_test_core/bt/revision b/bt5/erp5_ui_test_core/bt/revision index 7c6ba0fe18..2ebc6516c7 100644 --- a/bt5/erp5_ui_test_core/bt/revision +++ b/bt5/erp5_ui_test_core/bt/revision @@ -1 +1 @@ -55 \ No newline at end of file +56 \ No newline at end of file -- 2.30.9