from selenium.webdriver.common.keys import Keys from nicegui import ui from nicegui.testing import Screen def test_editor(screen: Screen): editor = ui.editor(placeholder='Type something here') ui.markdown().bind_content_from(editor, 'value', backward=lambda v: f'HTML code:\n```\n{v}\n```') screen.open('/') screen.find_element(editor).click() screen.type('Hello\nworld!') screen.wait(0.5) screen.should_contain('Hello