Skip to content
Snippets Groups Projects
Commit 0d13587f authored by Manuel Leduc's avatar Manuel Leduc
Browse files

[Misc] Fix TableLayoutElement.internalEdit flicker

Fix an issue where the cell above the target one is opened in edit mode by accident.
parent d1e53d9e
No related branches found
No related tags found
No related merge requests found
......@@ -751,13 +751,16 @@ private void internalEdit(String columnLabel, int rowNumber, String fieldName, S
int columnIndex = getColumnIndex(columnLabel);
WebElement element = getCellsByColumnIndex(columnIndex).get(rowNumber - 1);
// Hover on the property and click on the edit button on the displayed popover.
// We move slightly at the right of the center of the targeted element to prevent to popover of the surrounding
// cells to hide the targeted location of the mouse.
new Actions(getDriver().getWrappedDriver()).moveToElement(element, 50, 0).perform();
// Hover on the property and click on the edit button on the displayed popover. We move slightly at the right of
// the center of the targeted element, then slightly to the left, towards the center of the element. This
// simulates the mouse trajectory of a real user hovering the cell above the one he/she wants to edit.
new Actions(getDriver().getWrappedDriver())
.moveToElement(element, 50, 0)
.moveToElement(element, 0, 0)
.perform();
By editActionSelector = By.cssSelector(".displayer-action-list span[title='Edit']");
// Waits to have at least one popover visible and click on the edit action of the last one. While it does not
// seems to be possible in normal conditions, using selenium and moveToElement, several popover can be visible
// seem to be possible in normal conditions, using selenium and moveToElement, several popover can be visible
// at the same time (especially on Chrome). We select the latest edit action, which is the one of the targeted
// property because the popover actions are appended at the end of the document.
getDriver().waitUntilCondition(input -> !getDriver().findElementsWithoutWaiting(editActionSelector).isEmpty());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment