Commit 30374e31 authored by Gabriel Monnerat's avatar Gabriel Monnerat

add new assert to support range of values expected. The position is calculated...

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.
parent 3fe08558
...@@ -177,19 +177,19 @@ ...@@ -177,19 +177,19 @@
<td>552</td>\n <td>552</td>\n
</tr>\n </tr>\n
<tr>\n <tr>\n
<td>verifyElementPositionTop</td>\n <td>verifyElementPositionRangeTop</td>\n
<td>id=group_1_activity_1_block_1</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
<tr>\n <tr>\n
<td>verifyElementPositionTop</td>\n <td>verifyElementPositionRangeTop</td>\n
<td>id=group_2_activity_1_block_1</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
<tr>\n <tr>\n
<td>verifyElementPositionTop</td>\n <td>verifyElementPositionRangeTop</td>\n
<td>id=group_3_activity_1_block_1</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
<tr>\n <tr>\n
<td>verifyElementWidth</td>\n <td>verifyElementWidth</td>\n
......
698 699
\ No newline at end of file \ No newline at end of file
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>_EtagSupport__etag</string> </key> <key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts20417149.43</string> </value> <value> <string>ts37194719.51</string> </value>
</item> </item>
<item> <item>
<key> <string>__name__</string> </key> <key> <string>__name__</string> </key>
...@@ -71,7 +71,6 @@ Selenium.prototype.assertPortalStatusMessage = function(text) {\n ...@@ -71,7 +71,6 @@ Selenium.prototype.assertPortalStatusMessage = function(text) {\n
Assert.matches(text, actualValue);\n Assert.matches(text, actualValue);\n
};\n };\n
\n \n
\n
Selenium.prototype.doType = function(locator, newText) {\n Selenium.prototype.doType = function(locator, newText) {\n
if (typeof(netscape) != "undefined") {\n if (typeof(netscape) != "undefined") {\n
// on firefox, we enable privilege to upload file in javascript.\n // on firefox, we enable privilege to upload file in javascript.\n
...@@ -94,7 +93,17 @@ Selenium.prototype.doPhantomRender = function(filename) {\n ...@@ -94,7 +93,17 @@ Selenium.prototype.doPhantomRender = function(filename) {\n
page.render(filename);\n page.render(filename);\n
}\n }\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> ]]></string> </value>
</item> </item>
...@@ -104,7 +113,7 @@ Selenium.prototype.doPhantomRender = function(filename) {\n ...@@ -104,7 +113,7 @@ Selenium.prototype.doPhantomRender = function(filename) {\n
</item> </item>
<item> <item>
<key> <string>size</string> </key> <key> <string>size</string> </key>
<value> <int>2422</int> </value> <value> <int>2949</int> </value>
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
......
55 56
\ No newline at end of file \ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment