mirror of
https://github.com/pyscript/pyscript.git
synced 2025-12-23 12:12:59 -05:00
Bring tests to next (#1657)
* bring Makefile to root folder * add back the print to console when pyscript is ready * fix build path on tests, link to core.js and overall timeout since it now loads faster * fix and mark some tests accordingly * change default timeout to 20s * review tests and skip what is a known regression * more tests review until pycondif and skip what is a known regression * fix pyodide version used on tests * remove display from config test since it's not testing anything more than console already tests and display as its own tests * disable config tests that rely on the banner * skip REPL tests since it's not included in pyscript NEXT * skip PyTerminal tests since it's not included in pyscript NEXT * skip more tests relying on Element * Fix wrong script type from py-script to py * review more tests related to attributes and add test for worker * skip spashscreen tests * wrap up reviews on remaining tests * update core * update display tests to use import * fix more tests and skip some that have known issues * skip other 2 tests that fail because the test framework injects values that cause the config to fail * fix getPySrc test due to changed interface * another round of fixes and commenting on specific tests --------- Co-authored-by: Fabio Pliger <fpliger@anaconda.com>
This commit is contained in:
@@ -1,9 +1,12 @@
|
||||
from .support import PyScriptTest, skip_worker
|
||||
import pytest
|
||||
|
||||
from .support import PyScriptTest
|
||||
|
||||
|
||||
class TestElement(PyScriptTest):
|
||||
"""Test the Element api"""
|
||||
|
||||
@pytest.mark.skip("FIXME: Element missing from PyScript")
|
||||
def test_element_id(self):
|
||||
"""Test the element id"""
|
||||
self.pyscript_run(
|
||||
@@ -21,7 +24,7 @@ class TestElement(PyScriptTest):
|
||||
py_terminal = self.page.wait_for_selector("py-terminal")
|
||||
assert "foo" in py_terminal.inner_text()
|
||||
|
||||
@skip_worker("FIXME: js.document")
|
||||
@pytest.mark.skip("FIXME: Element missing from PyScript")
|
||||
def test_element_value(self):
|
||||
"""Test the element value"""
|
||||
self.pyscript_run(
|
||||
@@ -39,7 +42,7 @@ class TestElement(PyScriptTest):
|
||||
py_terminal = self.page.wait_for_selector("py-terminal")
|
||||
assert "bar" in py_terminal.inner_text()
|
||||
|
||||
@skip_worker("FIXME: js.document")
|
||||
@pytest.mark.skip("FIXME: Element missing from PyScript")
|
||||
def test_element_innerHtml(self):
|
||||
"""Test the element innerHtml"""
|
||||
self.pyscript_run(
|
||||
@@ -57,7 +60,7 @@ class TestElement(PyScriptTest):
|
||||
py_terminal = self.page.wait_for_selector("py-terminal")
|
||||
assert "bar" in py_terminal.inner_text()
|
||||
|
||||
@skip_worker("FIXME: js.document")
|
||||
@pytest.mark.skip("FIXME: Element missing from PyScript")
|
||||
def test_element_write_no_append(self):
|
||||
"""Test the element write"""
|
||||
self.pyscript_run(
|
||||
@@ -74,7 +77,7 @@ class TestElement(PyScriptTest):
|
||||
div = self.page.wait_for_selector("#foo")
|
||||
assert "World!" in div.inner_text()
|
||||
|
||||
@skip_worker("FIXME: js.document")
|
||||
@pytest.mark.skip("FIXME: Element missing from PyScript")
|
||||
def test_element_write_append(self):
|
||||
"""Test the element write"""
|
||||
self.pyscript_run(
|
||||
@@ -94,7 +97,7 @@ class TestElement(PyScriptTest):
|
||||
# confirm that the second write was appended
|
||||
assert "Hello!<div>World!</div>" in parent_div.inner_html()
|
||||
|
||||
@skip_worker("FIXME: js.document")
|
||||
@pytest.mark.skip("FIXME: Element missing from PyScript")
|
||||
def test_element_clear_div(self):
|
||||
"""Test the element clear"""
|
||||
self.pyscript_run(
|
||||
@@ -110,7 +113,7 @@ class TestElement(PyScriptTest):
|
||||
div = self.page.locator("#foo")
|
||||
assert div.inner_text() == ""
|
||||
|
||||
@skip_worker("FIXME: js.document")
|
||||
@pytest.mark.skip("FIXME: Element missing from PyScript")
|
||||
def test_element_clear_input(self):
|
||||
"""Test the element clear"""
|
||||
self.pyscript_run(
|
||||
@@ -126,7 +129,7 @@ class TestElement(PyScriptTest):
|
||||
input = self.page.wait_for_selector("#foo")
|
||||
assert input.input_value() == ""
|
||||
|
||||
@skip_worker("FIXME: js.document")
|
||||
@pytest.mark.skip("FIXME: Element missing from PyScript")
|
||||
def test_element_select(self):
|
||||
"""Test the element select"""
|
||||
self.pyscript_run(
|
||||
@@ -143,7 +146,7 @@ class TestElement(PyScriptTest):
|
||||
)
|
||||
assert self.console.log.lines[-1] == "bar"
|
||||
|
||||
@skip_worker("FIXME: js.document")
|
||||
@pytest.mark.skip("FIXME: Element missing from PyScript")
|
||||
def test_element_select_content(self):
|
||||
"""Test the element select"""
|
||||
self.pyscript_run(
|
||||
@@ -160,7 +163,7 @@ class TestElement(PyScriptTest):
|
||||
)
|
||||
assert self.console.log.lines[-1] == "Bar"
|
||||
|
||||
@skip_worker("FIXME: js.document")
|
||||
@pytest.mark.skip("FIXME: Element missing from PyScript")
|
||||
def test_element_clone_no_id(self):
|
||||
"""Test the element clone"""
|
||||
self.pyscript_run(
|
||||
@@ -178,7 +181,7 @@ class TestElement(PyScriptTest):
|
||||
assert divs.first.inner_text() == "Hello!"
|
||||
assert divs.last.inner_text() == "Hello!"
|
||||
|
||||
@skip_worker("FIXME: js.document")
|
||||
@pytest.mark.skip("FIXME: Element missing from PyScript")
|
||||
def test_element_clone_with_id(self):
|
||||
"""Test the element clone"""
|
||||
self.pyscript_run(
|
||||
@@ -198,7 +201,7 @@ class TestElement(PyScriptTest):
|
||||
clone = self.page.locator("#bar")
|
||||
assert clone.inner_text() == "Hello!"
|
||||
|
||||
@skip_worker("FIXME: js.document")
|
||||
@pytest.mark.skip("FIXME: Element missing from PyScript")
|
||||
def test_element_clone_to_other_element(self):
|
||||
"""Test the element clone"""
|
||||
self.pyscript_run(
|
||||
@@ -233,7 +236,7 @@ class TestElement(PyScriptTest):
|
||||
# Make sure that the clones are rendered in the right order
|
||||
assert container_div.inner_text() == "Bond\nJames\nBond"
|
||||
|
||||
@skip_worker("FIXME: js.document")
|
||||
@pytest.mark.skip("FIXME: Element missing from PyScript")
|
||||
def test_element_remove_single_class(self):
|
||||
"""Test the element remove_class"""
|
||||
self.pyscript_run(
|
||||
@@ -249,7 +252,7 @@ class TestElement(PyScriptTest):
|
||||
div = self.page.locator("#foo")
|
||||
assert div.get_attribute("class") == "baz"
|
||||
|
||||
@skip_worker("FIXME: js.document")
|
||||
@pytest.mark.skip("FIXME: Element missing from PyScript")
|
||||
def test_element_remove_multiple_classes(self):
|
||||
"""Test the element remove_class"""
|
||||
self.pyscript_run(
|
||||
@@ -265,7 +268,7 @@ class TestElement(PyScriptTest):
|
||||
div = self.page.locator("#foo")
|
||||
assert div.get_attribute("class") == ""
|
||||
|
||||
@skip_worker("FIXME: js.document")
|
||||
@pytest.mark.skip("FIXME: Element interface is gone. Replace with PyDom")
|
||||
def test_element_add_single_class(self):
|
||||
"""Test the element add_class"""
|
||||
self.pyscript_run(
|
||||
@@ -282,7 +285,7 @@ class TestElement(PyScriptTest):
|
||||
div = self.page.locator("#foo")
|
||||
assert div.get_attribute("class") == "red"
|
||||
|
||||
@skip_worker("FIXME: js.document")
|
||||
@pytest.mark.skip("FIXME: Element interface is gone. Replace with PyDom")
|
||||
def test_element_add_multiple_class(self):
|
||||
"""Test the element add_class"""
|
||||
self.pyscript_run(
|
||||
|
||||
Reference in New Issue
Block a user