Commit 9b5c665d authored by Ayush Tiwari's avatar Ayush Tiwari

[erp5_web_renderjs_ui_test]: Update test for Historical Diff View

parent 07c3f8fa
......@@ -64,6 +64,21 @@
<td>A new foo</td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//textarea[@name='field_my_lines_list']</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>//textarea[@name='field_my_lines_list']</td>
<td>
Foo
Bar
</td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/save" />
<!-- Go to History tab -->
......@@ -118,24 +133,29 @@
<tr>
<td>waitForElementPresent</td>
<td>//div[@data-gadget-scope='field_listbox']//table/tbody</td>
<td>//div[@data-gadget-scope='x0_listbox']//table/tbody</td>
<td></td>
</tr>
<!-- Check if the columns exists or not. Can be done by just checking the head -->
<tr>
<td>verifyText</td>
<td>//div[@data-gadget-scope='field_listbox']//table/thead/tr[1]/th[1]</td>
<td>//div[@data-gadget-scope='x0_listbox']//table/thead/tr[1]/th[1]</td>
<td>Property Name</td>
</tr>
<tr>
<td>verifyText</td>
<td>//div[@data-gadget-scope='field_listbox']//table/thead/tr[1]/th[2]</td>
<td>//div[@data-gadget-scope='x0_listbox']//table/thead/tr[1]/th[2]</td>
<td>Diff Viewer</td>
</tr>
<tr>
<td>verifyText</td>
<td>//div[@data-gadget-scope='x0_listbox']//table/thead/tr[1]/th[3]</td>
<td>Current Value</td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@data-gadget-scope='field_listbox']//table/tbody/tr[2]/td[2]//iframe</td>
<td>//div[@data-gadget-scope='x0_listbox']//table/tbody/tr[1]/td[2]//iframe</td>
<td></td>
</tr>
<tr>
......@@ -143,17 +163,66 @@
<td>1000</td>
<td></td>
</tr>
<!-- Check for the value of diff in Iframe -->
<!-- Check for the value of diff in IFrame -->
<tr>
<td>storeEval</td>
<td>document.querySelector('#selenium_myiframe').contentWindow.document.evaluate("//div[@data-gadget-scope='field_listbox']//table/tbody/tr[2]/td[2]//iframe", document.querySelector('#selenium_myiframe').contentWindow.document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue.contentWindow.document.body.textContent</td>
<td>document.querySelector('#selenium_myiframe').contentWindow.document.evaluate("//div[@data-gadget-scope='x0_listbox']//table/tbody/tr[1]/td[2]//iframe", document.querySelector('#selenium_myiframe').contentWindow.document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue.contentWindow.document.body.textContent</td>
<td>diff_content</td>
</tr>
<tr>
<td>verifyEval</td>
<!-- Verify the value after removing the spaces and line breaks -->
<td>storedVars['diff_content'].replace(/(\r\n\t|\n|\r\t)/gm,"").replace(/\s+/g, '')</td>
<td>1-1+Anewfoo</td>
<td>1-1+('Foo','Bar')</td>
</tr>
<tr>
<td>verifyText</td>
<td>//div[@data-gadget-scope='x0_listbox']//table/tbody/tr[1]/td[3]</td>
<td>Foo,Bar</td>
</tr>
<!-- Now let's test the listbox and its values for the 2nd lisbox where we expect
the diff to be shown according to values, i.e, old, new and current values -->
<tr>
<td>verifyText</td>
<td>//div[@data-gadget-scope='x1_listbox']//table/thead/tr[1]/th[1]</td>
<td>Property Name</td>
</tr>
<tr>
<td>verifyText</td>
<td>//div[@data-gadget-scope='x1_listbox']//table/thead/tr[1]/th[2]</td>
<td>Old Value</td>
</tr>
<tr>
<td>verifyText</td>
<td>//div[@data-gadget-scope='x1_listbox']//table/thead/tr[1]/th[3]</td>
<td>New Value</td>
</tr>
<tr>
<td>verifyText</td>
<td>//div[@data-gadget-scope='x1_listbox']//table/thead/tr[1]/th[4]</td>
<td>Current Value</td>
</tr>
<tr>
<td>verifyText</td>
<td>//div[@data-gadget-scope='x1_listbox']//table/tbody/tr[1]/td[1]</td>
<td>short_title</td>
</tr>
<tr>
<td>verifyText</td>
<td>//div[@data-gadget-scope='x1_listbox']//table/tbody/tr[1]/td[2]</td>
<td></td>
</tr>
<tr>
<td>verifyText</td>
<td>//div[@data-gadget-scope='x1_listbox']//table/tbody/tr[1]/td[3]</td>
<td>A new foo</td>
</tr>
<tr>
<td>verifyText</td>
<td>//div[@data-gadget-scope='x1_listbox']//table/tbody/tr[1]/td[4]</td>
<td>A new foo</td>
</tr>
</tbody></table>
......
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