Commit 1485f289 authored by Jérome Perrin's avatar Jérome Perrin

web_renderjs_ui_test: fix flaky testFormViewHistoricalRevisionLink

This test was using a blind `pause` instead of an explicit waitFor*, so
it was failing when machine was not fast enough.

Also refactor the test a bit to simplify the assertion by first
selecting the iframe we are going to inspect.
parent 4c25f638
Pipeline #6308 failed with stage
in 0 seconds
...@@ -208,23 +208,36 @@ Bar ...@@ -208,23 +208,36 @@ Bar
<td></td> <td></td>
</tr> </tr>
<tr> <tr>
<td>pause</td> <td>selectFrame</td>
<td>1000</td> <td>//div[@data-gadget-scope='field_listbox']//table/tbody/tr[2]/td[2]//iframe</td>
<td></td> <td></td>
</tr> </tr>
<!-- Check for the value of diff in IFrame --> <!-- Check for the value of diff in IFrame -->
<tr> <tr>
<td>storeEval</td> <td>waitForText</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>//div[contains(@class, " d2h-del ")]</td>
<td>diff_content</td> <td>-</td>
</tr> </tr>
<tr> <tr>
<td>verifyEval</td> <td>waitForText</td>
<!-- Verify the value after removing the spaces and line breaks --> <td>//div[contains(@class, " d2h-ins ")]/span[@class="d2h-code-line-prefix"]</td>
<td>storedVars['diff_content'].replace(/(\r\n\t|\n|\r\t)/gm,"").replace(/\s+/g, '')</td> <td>+</td>
<td>1-1+('FooBar',)</td> </tr>
<tr>
<td>verifyText</td>
<td>//div[contains(@class, " d2h-ins ")]/span[@class="d2h-code-line-ctn"]/ins[1]</td>
<td>('Foo',</td>
</tr>
<tr>
<td>verifyText</td>
<td>//div[contains(@class, " d2h-ins ")]/span[@class="d2h-code-line-ctn"]/ins[2]</td>
<td>'Bar')</td>
</tr>
<tr>
<td>selectFrame</td>
<td>relative=top</td>
<td></td>
</tr> </tr>
</tbody></table> </tbody></table>
</body> </body>
</html> </html>
\ 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