Files
pyscript/pyscriptjs/tests/integration/test_warnings_and_banners.py
Fabio Pliger 12428c0617 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>
2023-09-01 10:01:09 -07:00

33 lines
911 B
Python

import pytest
from .support import PyScriptTest
pytest.skip(reason="FIXME: Restore the banner", allow_module_level=True)
class TestWarningsAndBanners(PyScriptTest):
# Test the behavior of generated warning banners
def test_create_singular_warning(self):
# Use a script tag with an invalid output attribute to generate a warning, but only one
self.pyscript_run(
"""
<py-script output="foo">
print("one.")
print("two.")
</py-script>
<py-script output="foo">
print("three.")
</py-script>
"""
)
loc = self.page.locator(".alert-banner")
# Only one banner should appear
assert loc.count() == 1
assert (
loc.text_content()
== 'output = "foo" does not match the id of any element on the page.'
)