Marimeireles fix/#1081 (#1155)

* Improves repl id output

* Fix tests for new REPL output ids

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Add new REPL tests

* Pre commit linting

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Remove mistake

* Fixing tests that i didn't notice were broken?

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
Mariana Meireles
2023-02-14 07:51:43 +01:00
committed by GitHub
parent 1f825edc28
commit b14a2bba5f
3 changed files with 58 additions and 8 deletions

View File

@@ -301,15 +301,17 @@ class TestExamples(PyScriptTest):
self.page.locator("py-repl").type("display('Hello, World!')")
self.page.locator("#runButton").click()
assert self.page.locator("#my-repl-1").text_content() == "Hello, World!"
assert (
self.page.locator("#my-repl-repl-output").text_content() == "Hello, World!"
)
# Confirm that using the second repl still works properly
self.page.locator("#my-repl-2").type("display(2*2)")
self.page.locator("#my-repl-1").type("display(2*2)")
self.page.keyboard.press("Shift+Enter")
# Make sure that the child of the second repl is attached properly
# before looking into the text_content
assert self.page.wait_for_selector("#my-repl-2-2", state="attached")
assert self.page.locator("#my-repl-2-2").text_content() == "4"
assert self.page.wait_for_selector("#my-repl-1-repl-output", state="attached")
assert self.page.locator("#my-repl-1-repl-output").text_content() == "4"
self.assert_no_banners()
self.check_tutor_generated_code(modules_to_check=["antigravity.py"])