From 14664996d0aa011af2e93bf8748a0197fcde6b35 Mon Sep 17 00:00:00 2001 From: luxuyang Date: Wed, 23 Oct 2024 14:26:19 +0800 Subject: [PATCH] * [misc] add function setValueInZeneditor. --- test/lib/webdriver/webdriver.class.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/test/lib/webdriver/webdriver.class.php b/test/lib/webdriver/webdriver.class.php index f34eb8feb7..ba322d0293 100644 --- a/test/lib/webdriver/webdriver.class.php +++ b/test/lib/webdriver/webdriver.class.php @@ -1189,4 +1189,18 @@ class dom { return $this->driver->executeScript('return $("[name=' . $pickerName . ']").zui("picker").options.items;'); } + + /** + * 在Zeneditor中输入内容 + * set value in Zeneditor. + * + * @param string $value + * @access public + * @return void + */ + public function setValueInZeneditor($value) + { + $value = json_encode($value); + return $this->driver->executeScript("arguments[0].setHTML($value);", array($this->element)); + } }