Skip to content

Commit 17fd818

Browse files
committed
[Behat] Retry entering Richtext value
1 parent c783449 commit 17fd818

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

src/lib/Behat/Component/Fields/RichText.php

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,16 @@ private function focusFieldInput(): void
5050

5151
public function setValue(array $parameters): void
5252
{
53-
$this->executeCommand('selectAll');
54-
$this->executeCommand('delete');
55-
$this->getFieldInput()->setValue($parameters['value']);
53+
$text = $parameters['value'];
54+
$maxIterations = 3;
55+
$counter = 0;
56+
while ($this->getValue()[0] !== $text && $counter < $maxIterations) {
57+
$this->executeCommand('selectAll');
58+
$this->executeCommand('delete');
59+
$this->getFieldInput()->setValue($parameters['value']);
60+
usleep(100 * 1000); // 100 ms
61+
++$counter;
62+
}
5663
}
5764

5865
public function getValue(): array

0 commit comments

Comments
 (0)