Skip to content

Commit 5893513

Browse files
Merge pull request #205 from echelonts/test/e2e-designer-and-formula
test(e2e): cover recipe designer + molecular formula
2 parents cbd7bfb + b1537ea commit 5893513

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

tests/e2e/test_workbench_e2e.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,3 +100,26 @@ def test_flavor_map_renders(page, base_url, needs_models):
100100
_open(page, base_url)
101101
page.locator("#mapLegend .leg").first.wait_for(timeout=30000)
102102
assert page.locator("#mapLegend .leg").count() >= 5 # legend classes populated
103+
104+
105+
def test_molecular_formula_shown(page, base_url, needs_models):
106+
_open(page, base_url)
107+
page.fill("#q", "vanillin")
108+
page.click("#go")
109+
page.wait_for_selector("#formula", timeout=30000)
110+
page.wait_for_timeout(600)
111+
assert "Formula" in (page.locator("#formula").inner_text() or "") # the 4th identifier row
112+
113+
114+
def test_recipe_designer(page, base_url, needs_models):
115+
_open(page, base_url)
116+
# pick a note that is a new supplement head, then design a recipe for it
117+
chip = page.locator("#formTargetChips .chip", has_text="coconut").first
118+
chip.wait_for(timeout=15000)
119+
chip.click()
120+
page.locator("#formDesign").click()
121+
page.wait_for_selector("#formResults .recipe-strip .recipe-ing", timeout=40000)
122+
page.wait_for_timeout(600)
123+
assert page.locator("#formResults .recipe-ing").count() >= 1
124+
assert page.locator("#recipeLoad").count() == 1 # the "load into rows" bridge
125+
assert page._flavor_errors == [], f"page errors: {page._flavor_errors}"

0 commit comments

Comments
 (0)