mirror of
https://github.com/pyscript/pyscript.git
synced 2025-12-20 02:37:41 -05:00
* Create custom elements when the runtime finishes loading * Remove xfails and fix repl integration test * Fix commented ignore * Address Antonio's comments * Fix bad rebase * Make ure to wait for repl to be in attached state before asserting content * Move createCustomeElement up so it runs before we close the loader, xfail flaky d3 test * Fix xfail
19 lines
587 B
Python
19 lines
587 B
Python
from .support import PyScriptTest
|
|
|
|
|
|
class TestPyButton(PyScriptTest):
|
|
def test_on_click(self):
|
|
self.pyscript_run(
|
|
"""
|
|
<py-button label="my button">
|
|
import js
|
|
def on_click(evt):
|
|
js.console.log('clicked!')
|
|
</py-button>
|
|
"""
|
|
)
|
|
assert self.console.log.lines == [self.PY_COMPLETE]
|
|
self.page.locator("text=my button").click()
|
|
self.page.locator("text=my button").click()
|
|
assert self.console.log.lines == [self.PY_COMPLETE, "clicked!", "clicked!"]
|