Use <script type="py"> instead of <py-script> in most tests (#1723)

This is mostly a global search&replace, to replace <py-script> with <script type="py">.

The vast majority of tests just works, some needed some tweak.
This commit is contained in:
Antonio Cuni
2023-09-19 16:35:15 +00:00
committed by GitHub
parent f6decfd93d
commit 77b40aa348
20 changed files with 375 additions and 332 deletions

View File

@@ -9,7 +9,7 @@ class TestPyScriptRuntimeAttributes(PyScriptTest):
self.pyscript_run(
r"""
<div id="py-button-container"></div>
<py-script>
<script type="py">
import js
py_button = Element("py-button-container")
@@ -17,7 +17,7 @@ class TestPyScriptRuntimeAttributes(PyScriptTest):
def print_hello():
js.console.log("hello pyscript")
</py-script>
</script>
"""
)
self.page.locator("button").click()
@@ -28,7 +28,7 @@ class TestPyScriptRuntimeAttributes(PyScriptTest):
self.pyscript_run(
r"""
<button id="py-button"></button>
<py-script>
<script type="py">
import js
py_button = Element("py-button")
@@ -36,7 +36,7 @@ class TestPyScriptRuntimeAttributes(PyScriptTest):
def print_hello():
js.console.log("hello pyscript")
</py-script>
</script>
"""
)
self.page.locator("button").click()
@@ -47,7 +47,7 @@ class TestPyScriptRuntimeAttributes(PyScriptTest):
self.pyscript_run(
r"""
<button id="py-button">live content</button>
<py-script>
<script type="py">
import js
py_button = Element("py-button")
@@ -56,7 +56,7 @@ class TestPyScriptRuntimeAttributes(PyScriptTest):
def print_hello():
js.console.log("hello pyscript")
py_button.element.removeAttribute("py-click")
</py-script>
</script>
"""
)
self.page.locator("button").click()