diff --git a/scripts/record-scene.py b/scripts/record-scene.py index 367c1f63..0f0e6ca3 100644 --- a/scripts/record-scene.py +++ b/scripts/record-scene.py @@ -585,6 +585,11 @@ def overlay_script(badge: str, captions: bool = True) -> str: `sessionStorage` like the caption, so a click that leaves the page finds the cursor where it was on the next. A card (a `slide`) is the recorder's own picture and nothing is pressed on it: it has no cursor. + + It draws only in the top page. A page the product shows inside a page + (the Line page's 3D tab is one) is a document of its own, and the script + runs there too: without the guard the first take of class 0.1's second + filming had a second cursor and an empty caption bar inside the drawing. """ css = ( f"#fs-scene-cap{{position:fixed!important;left:0!important;right:{CAPTION_RIGHT_INSET}px!important;" @@ -624,6 +629,7 @@ def overlay_script(badge: str, captions: bool = True) -> str: ) return f""" (() => {{ + if (window.top !== window) return; const KEY = 'fsSceneCaption'; const remembered = () => {{ try {{ return sessionStorage.getItem(KEY) || ''; }} catch (e) {{ return ''; }} }}; const draw = () => {{ diff --git a/scripts/scenes/course/01-01-what-a-factory-does-all-day.toml b/scripts/scenes/course/01-01-what-a-factory-does-all-day.toml index 33ef5f21..e485318d 100644 --- a/scripts/scenes/course/01-01-what-a-factory-does-all-day.toml +++ b/scripts/scenes/course/01-01-what-a-factory-does-all-day.toml @@ -9,6 +9,13 @@ # is shown as the product draws it. The last beat is the rule the rest of the # course leans on: the MES knows nothing about a machine until the machine or a # person reports it. +# +# The second filming (Scott, 2026-11-15: "Just the screen doesn't explain +# anything") keeps every caption studio voiced, word for word, puts a box on +# what each line on the screen is about, and gets from page to page by the +# menus and links a person would click. Two pages are opened by address: the +# first, and the one the camera comes back to after the cards, because a card +# is the recorder's page and has no menu to click. name = "what-a-factory-does-all-day" title = "What a factory does all day" @@ -17,8 +24,10 @@ take_is = "lesson" part = "hook" base = "http://127.0.0.1:8040" badge = "pre-alpha · simulated plant · v{version}" -# Four to six minutes, as the outline says this class runs. -budget_seconds = 360 +# Four to six minutes, as the outline says this class runs, and up to half a +# minute more for getting from page to page by the menus (Scott, 2026-11-15: +# click through the menus even if the class runs longer). +budget_seconds = 390 gif_skip_seconds = 2.0 width = 1280 height = 720 @@ -31,6 +40,9 @@ notes = [ "The machines page labels a line WORK CENTER and a machine WORK UNIT, which are the ISA-95 words. The narration says line and machine and names the labels once.", "Each line runs its own work order on this plant: the stacker's order is for stacks, not forks. The narration follows the product along the steps and does not claim that one physical fork is traced from mould to pallet; tracing lots is class 2.3.", "The line pages show OEE figures with Watched at a few percent: the cutlery pack sets no coverage floor, so nothing is withheld. This class does not read those figures; OEE is class 3.3.", + "The class is clicked through as a person would. It opens on line FORK1's page and clicks its 3D tab; after the cards it comes back to that page by address, because a card is the recorder's page and has no menu, then clicks Engineering for the machines tree and FORK1_Mold in the tree. The machine page's own trail leads back to line FORK1, and the stacker, the wrapper and the pallet line are picked from the Line page's Line list; the pallet line's drawing is its 3D tab. The way back to the mould is Engineering and the tree again, then its OEE tab.", + "The 3D drawing is filmed as the Line page's 3D tab, not the full-screen 3D page the first filming opened on: the full-screen page draws its menus under the drawing, so nothing on it can be clicked to leave it. The lines said over the drawing have no box, because the drawing is a page inside the page and the box is drawn on the outer one; the drawing's own readout carries the order, the good and the scrap, and its cards each machine.", + "Two more lines have no box on purpose: the replay banner is the page's own header, and the narration names it; and the last line of the rule is about every gap, not one figure on the screen.", ] honesty = [ @@ -50,19 +62,37 @@ booked = 1 # ----------------------------------------------------------------- the hook +# The one page opened by address before the cards: line FORK1, then its 3D +# tab. The class leaves for the cards with the drawing showing: leaving the +# Line page after its drawing was opened and hidden again holds the camera on +# a frozen page for seconds. [[step]] do = "goto" -url = "/dashboard/line/3d?line=FORK1LINE" -settle = 3 +url = "/dashboard/line?line=FORK1LINE" +settle = 2 [[step]] do = "wait_for" -selector = "#stat-order" -text = "WO-FORK1-0001" +selector = "#l-name" +text = "Moulding line FORK1" [[step]] do = "say" line = "A moulding line that makes plastic forks." +at = "#l-name" +label = "The line" + +[[step]] +do = "click" +selector = "[data-tab=scene]" + +[[step]] +do = "wait_for" +js = "(document.querySelector('#scene')?.contentDocument?.querySelector('#stat-order')?.innerText || '').includes('WO-FORK1-0001')" +scroll_to = "#scene" +scroll_block = "start" +# The page's header stays at the top as it scrolls: 214 px clears it. +scroll_offset = 214 [[step]] do = "say" @@ -76,16 +106,6 @@ name = "hook" do = "say" line = "By the end of the shift, someone has to know what each machine did." -[[step]] -do = "goto" -url = "/dashboard/line?line=FORK1LINE" -settle = 2.5 - -[[step]] -do = "wait_for" -selector = "#l-code" -text = "FORK1LINE" - [[step]] do = "say" line = "How many good, how many scrap, against which order." @@ -161,11 +181,22 @@ line = "A company has sites. A site has areas. An area has lines, and a line has # ------------------------------------------------------------ on the screen +# Back from the cards to the page the hook left, by address (a card has no +# menu), and from there by the Engineering menu to the machines tree. [[step]] part = "screen" do = "goto" -url = "/dashboard/machines" -settle = 3 +url = "/dashboard/line?line=FORK1LINE" +settle = 2 + +[[step]] +do = "wait_for" +selector = "#l-code" +text = "FORK1LINE" + +[[step]] +do = "click" +selector = "header nav a:text-is(\"Engineering\")" [[step]] do = "wait_for" @@ -175,10 +206,12 @@ text = "CUTLERYCO" [[step]] do = "say" line = "Here is that tree for this plant. The enterprise, Cutlery Co. One site, Cutlery Works." +at = "#tree a:text-is(\"CUTLERYCO\")" [[step]] do = "say" line = "The moulding area, and in it, line FORK1. The screen says work center; it means the line." +at = "#tree .node:has(> a:text-is(\"FORK1LINE\")) .level" [[step]] do = "mark" @@ -187,10 +220,7 @@ name = "tree" [[step]] do = "say" line = "Under the line, its three machines, each a work unit: the degater, the marker, and the mould." - -[[step]] -do = "say" -line = "Further down, the same plant has a stacking area, a wrapping area and a palletizing area." +at = "#tree .node:has(> a:text-is(\"FORK1_Degate\")) .level" [[step]] do = "wait_for" @@ -201,14 +231,19 @@ scroll_text = "STACK-AREA" # The page's header stays at the top as it scrolls: 260 px clears it. scroll_offset = 260 +[[step]] +do = "say" +line = "Further down, the same plant has a stacking area, a wrapping area and a palletizing area." +at = "#tree a:text-is(\"STACK-AREA\")" + [[step]] do = "say" line = "A fork's road runs through all four." +# The mould, by its name in the tree. [[step]] -do = "goto" -url = "/dashboard/machine/FORK1_Mold?hours=8" -settle = 3 +do = "click" +selector = "#tree a:text-is(\"FORK1_Mold\")" [[step]] do = "wait_for" @@ -218,6 +253,8 @@ text = "WO-FORK1-0001" [[step]] do = "say" line = "The mould. It is running, on order WO-FORK1-0001, at its step: Mold, operation 10." +at = "#m-op" +label = "Its step" [[step]] do = "say" @@ -238,64 +275,101 @@ scroll_offset = 400 [[step]] do = "say" line = "And below, what the machine itself reports: its temperature, its cycle time, its good and scrap counts." +at = "#tags-table tr[data-tag=\"GoodCount\"] td.num" +label = "Good count" [[step]] do = "say" line = "The age column says how long ago each number arrived." +at = "#tags-table thead th:last-child" +label = "Age" +# Back to line FORK1 by the machine page's own trail, and on to the stacker +# by the Line page's Line list. [[step]] -do = "goto" -url = "/dashboard/line?line=STACK07LINE" -settle = 3 +do = "click" +selector = "#crumbs a:text-is(\"Moulding line FORK1\")" [[step]] do = "wait_for" selector = "#l-code" -text = "STACK07LINE" +text = "FORK1LINE" + +[[step]] +do = "choose" +selector = "#line" +value = "STACK07LINE" + +[[step]] +do = "wait_for" +selector = "#tiles" +text = "STACK07_Stacker" [[step]] do = "say" line = "Next on the road, the stacker. It puts a fork, a spoon and a knife into one stack." +at = "#tiles .machine:has(a:text-is(\"STACK07_Stacker\")) .machine-head" [[step]] do = "say" line = "A different line, a different order, and its count is in stacks, not forks." +at = "#tiles .machine:has(a:text-is(\"STACK07_Stacker\")) .machine-meta span:first-child" [[step]] do = "mark" name = "stacker" [[step]] -do = "goto" -url = "/dashboard/line?line=WRAP03LINE" -settle = 3 +do = "choose" +selector = "#line" +value = "WRAP03LINE" [[step]] do = "wait_for" -selector = "#l-code" -text = "WRAP03LINE" +selector = "#tiles" +text = "WRAP03_Wrapper" [[step]] do = "say" line = "Then the wrapper: each stack sealed onto a paper plate. That is the product a customer buys." +at = "#tiles .machine:has(a:text-is(\"WRAP03_Wrapper\")) .machine-head" [[step]] do = "say" line = "The banner across the top says this plant is replaying at ten times speed, so a shift fits into a class." +# The pallet line from the same list, and its drawing on the 3D tab. [[step]] -do = "goto" -url = "/dashboard/line/3d?line=PAL1LINE" -settle = 4 +do = "choose" +selector = "#line" +value = "PAL1LINE" [[step]] do = "wait_for" -selector = "#stat-order" -text = "WO-PAL1-0001" +selector = "#l-code" +text = "PAL1LINE" + +[[step]] +do = "click" +selector = "[data-tab=scene]" + +[[step]] +do = "wait_for" +js = "(document.querySelector('#scene')?.contentDocument?.querySelector('#stat-order')?.innerText || '').includes('WO-PAL1-0001')" [[step]] do = "say" line = "And last, the palletizer and the stretch wrapper. Wrapped sets go onto a pallet, and the pallet goes out the door." +at = "#l-name" +label = "The pallet line" + +[[step]] +do = "wait_for" +js = "(document.querySelector('#scene')?.contentDocument?.querySelector('#stat-order')?.innerText || '').includes('WO-PAL1-0001')" +scroll_to = "#scene" +scroll_block = "start" +# The page's header stays at the top as it scrolls: 214 px clears it. +scroll_offset = 214 [[step]] do = "say" @@ -311,11 +385,26 @@ line = "Every count on the way is one the floor booked, and none was worked out # -------------------------------------------------------------- it refuses +# Back to the mould the way the class first reached it: Engineering, then +# its name in the tree. [[step]] part = "refuses" -do = "goto" -url = "/dashboard/machine/FORK1_Mold?hours=8" -settle = 3 +do = "click" +selector = "header nav a:text-is(\"Engineering\")" + +[[step]] +do = "wait_for" +selector = "#tree" +text = "FORK1_Mold" + +[[step]] +do = "click" +selector = "#tree a:text-is(\"FORK1_Mold\")" + +[[step]] +do = "wait_for" +selector = "#m-order" +text = "WO-FORK1-0001" [[step]] do = "click" @@ -325,17 +414,26 @@ selector = "[data-tab=oee]" do = "wait_for" selector = "#oee-ledger" text = "before first sample" -scroll_to = "#oee-window" -scroll_block = "start" -scroll_offset = 30 [[step]] do = "say" line = "Now the one rule this whole course leans on. The mould again, over the last eight hours." +at = "#machine-span select" + +[[step]] +do = "wait_for" +selector = "#oee-ledger" +text = "before first sample" +scroll_to = "#oee-window" +scroll_block = "start" +scroll_offset = 30 [[step]] do = "say" line = "This plant is a few minutes old. Almost all of those hours are before first sample." +at = "#oee-ledger li:has-text(\"before first sample\") .cause" +label = "Nobody reported" +style = "spotlight" [[step]] do = "mark" @@ -344,10 +442,14 @@ name = "before-first-sample" [[step]] do = "say" line = "The MES does not guess what the mould did then. It was not told, so it says it does not know." +at = "#oee-ledger li:has-text(\"before first sample\") .num" +label = "Not guessed" [[step]] do = "say" line = "Nothing is known until a machine or a person reports it: the machine over its tags, a person at the station." +at = "#oee-window" +label = "Watched" [[step]] do = "say" diff --git a/tests/fixtures/course/class-0-1-voiced-script.txt b/tests/fixtures/course/class-0-1-voiced-script.txt new file mode 100644 index 00000000..b1d2e593 --- /dev/null +++ b/tests/fixtures/course/class-0-1-voiced-script.txt @@ -0,0 +1,34 @@ +A moulding line that makes plastic forks. +Every few seconds, a fork comes out of the mould. +By the end of the shift, someone has to know what each machine did. +How many good, how many scrap, against which order. +That is the whole job of a factory floor, and this class is about it, before any software. +Every plant, whatever it makes, runs on five words. +Material: the resin that goes in, and the fork that comes out. +Machine: the mould, the degater, the marker. Each one is a place where work is done. +Step: one operation on one machine. Moulding is a step. Cutting the fork off its runner is the next. +Order: the instruction to make this many of that, this way. +Shift: the people on the floor, and the hours they were there. +And every machine has exactly one place in a tree. +A company has sites. A site has areas. An area has lines, and a line has machines. +Here is that tree for this plant. The enterprise, Cutlery Co. One site, Cutlery Works. +The moulding area, and in it, line FORK1. The screen says work center; it means the line. +Under the line, its three machines, each a work unit: the degater, the marker, and the mould. +Further down, the same plant has a stacking area, a wrapping area and a palletizing area. +A fork's road runs through all four. +The mould. It is running, on order WO-FORK1-0001, at its step: Mold, operation 10. +Material, machine, step and order, all four on one screen. +And below, what the machine itself reports: its temperature, its cycle time, its good and scrap counts. +The age column says how long ago each number arrived. +Next on the road, the stacker. It puts a fork, a spoon and a knife into one stack. +A different line, a different order, and its count is in stacks, not forks. +Then the wrapper: each stack sealed onto a paper plate. That is the product a customer buys. +The banner across the top says this plant is replaying at ten times speed, so a shift fits into a class. +And last, the palletizer and the stretch wrapper. Wrapped sets go onto a pallet, and the pallet goes out the door. +Four lines, four orders, one road from resin to pallet. +Every count on the way is one the floor booked, and none was worked out from the others. +Now the one rule this whole course leans on. The mould again, over the last eight hours. +This plant is a few minutes old. Almost all of those hours are before first sample. +The MES does not guess what the mould did then. It was not told, so it says it does not know. +Nothing is known until a machine or a person reports it: the machine over its tags, a person at the station. +A gap stays a gap. It is not counted as running, and it is not counted as stopped. diff --git a/tests/test_class_0_1_follows_a_fork_from_the_mould_to_the_pallet_on_a_scratch_plant.py b/tests/test_class_0_1_follows_a_fork_from_the_mould_to_the_pallet_on_a_scratch_plant.py index b932e474..6f5888a2 100644 --- a/tests/test_class_0_1_follows_a_fork_from_the_mould_to_the_pallet_on_a_scratch_plant.py +++ b/tests/test_class_0_1_follows_a_fork_from_the_mould_to_the_pallet_on_a_scratch_plant.py @@ -18,6 +18,24 @@ REPO = Path(__file__).resolve().parents[1] RUNNER = REPO / "scripts" / "record-scene.py" SCENE = REPO / "scripts" / "scenes" / "course" / "01-01-what-a-factory-does-all-day.toml" +# The caption lines of the take studio voiced, as that take's script file +# wrote them: the second filming says exactly these, in this order. +VOICED = REPO / "tests" / "fixtures" / "course" / "class-0-1-voiced-script.txt" +# The lines over the screen that are about nothing one box can hold: the +# drawing is a page inside the page, the banner is the page's own header, and +# the rest are about the whole road or every gap. +POINTS_AT_NOTHING_ON_SCREEN = { + "Every few seconds, a fork comes out of the mould.", + "By the end of the shift, someone has to know what each machine did.", + "How many good, how many scrap, against which order.", + "A fork's road runs through all four.", + "Material, machine, step and order, all four on one screen.", + "The banner across the top says this plant is replaying at ten times speed, so a shift fits into a class.", + "Four lines, four orders, one road from resin to pallet.", + "Every count on the way is one the floor booked, and none was worked out from the others.", + "A gap stays a gap. It is not counted as running, and it is not counted as stopped.", +} +ON_SCREEN = ("hook", "screen", "refuses") # The lab fleet, the public demo and the stock demo ports: a class is never # filmed on a plant somebody else is looking at. @@ -43,7 +61,8 @@ def test_the_scene_is_a_full_take_of_class_0_1_that_runs_four_to_six_minutes(run assert (scene["width"], scene["height"]) == (1280, 720) planned = runner.planned_seconds(scene) # Page loads and waits add to the plan; the finished take is measured. - assert 240 <= planned <= scene["budget_seconds"] <= 360, planned + # Half a minute over the first filming's six, for the clicked path, and no more. + assert 240 <= planned <= scene["budget_seconds"] <= 390, planned print(f"planned {planned} s against a {scene['budget_seconds']} s budget") @@ -64,14 +83,59 @@ def test_the_scene_walks_the_five_parts_in_order(runner, scene): assert order == list(runner.PARTS) -def test_the_hook_opens_on_the_3d_line_view_then_the_line_view_and_is_short_enough_for_the_teaser(runner, scene): +def test_the_hook_opens_on_the_line_clicks_its_3d_tab_and_is_short_enough_for_the_teaser(runner, scene): hook = [step for step in scene["step"] if step["part"] == "hook"] visited = [step["url"] for step in hook if step["do"] == "goto"] + clicked = [step["selector"] for step in hook if step["do"] == "click"] - assert visited == ["/dashboard/line/3d?line=FORK1LINE", "/dashboard/line?line=FORK1LINE"] + assert visited == ["/dashboard/line?line=FORK1LINE"] + assert hook[0]["do"] == "goto" + # The cards follow with the drawing showing: a Line page left after its + # drawing was hidden again holds the camera on a frozen page. + assert clicked == ["[data-tab=scene]"] assert runner.planned_seconds(dict(scene, step=hook)) - scene["gif_skip_seconds"] <= 30 +def test_every_caption_is_the_line_studio_voiced_word_for_word_in_the_same_order(runner, scene): + voiced = VOICED.read_text(encoding="utf-8").splitlines() + + assert len(voiced) == 34 + assert runner.script_lines(scene) == voiced + + +def test_every_line_said_over_the_screen_points_at_what_it_is_about_and_no_line_over_a_card_does(scene): + on_screen = [s for s in scene["step"] if s["do"] == "say" and s["part"] in ON_SCREEN] + on_cards = [s for s in scene["step"] if s["do"] == "say" and s["part"] not in ON_SCREEN] + unpointed = [s["line"] for s in on_screen if not s.get("at")] + + assert set(unpointed) == POINTS_AT_NOTHING_ON_SCREEN, ( + f"{len(unpointed)} of {len(on_screen)} lines over the screen point at nothing") + assert [s["line"] for s in on_cards if s.get("at")] == [] + # A label is a few words, and the dimmed spotlight is kept for the one refusal. + assert all(len(s["label"].split()) <= 3 for s in on_screen if s.get("label")) + spotlit = [s for s in on_screen if s.get("style") == "spotlight"] + assert len(spotlit) == 1 and spotlit[0]["part"] == "refuses" + + +def test_the_only_pages_opened_by_address_are_the_first_and_the_one_after_the_cards(scene): + steps = scene["step"] + pages = [number for number, step in enumerate(steps) if step["do"] == "goto"] + clicked = [step["selector"] for step in steps if step["do"] == "click"] + + # A card is the recorder's page and has no menu: the camera comes back from + # the cards by address, and every other page is reached by a click. + assert pages[0] == 0 + assert len(pages) == 2 + after_cards = pages[1] + assert steps[after_cards]["part"] == "screen" + assert steps[after_cards - 1]["part"] == "idea", "the goto comes straight after the cards" + assert steps[after_cards]["url"] == "/dashboard/line?line=FORK1LINE" + assert clicked.count('header nav a:text-is("Engineering")') == 2 + assert clicked.count('#tree a:text-is("FORK1_Mold")') == 2 + assert '#crumbs a:text-is("Moulding line FORK1")' in clicked + assert clicked[-1] == "[data-tab=oee]" + + def test_the_idea_cards_name_the_five_words_and_the_five_levels_of_the_tree(scene): cards = {step["name"]: step for step in scene["step"] if step["do"] == "slide" and step["part"] == "idea"} @@ -82,15 +146,14 @@ def test_the_idea_cards_name_the_five_words_and_the_five_levels_of_the_tree(scen def test_the_fork_is_followed_through_the_four_lines_in_the_order_it_travels(scene): - screen = [step["url"] for step in scene["step"] if step["part"] == "screen" and step["do"] == "goto"] - lines = [] - for url in screen: - for line in ("FORK1", "STACK07", "WRAP03", "PAL1"): - if line in url and line not in lines: - lines.append(line) + screen = [step for step in scene["step"] if step["part"] == "screen"] + tree = next(n for n, s in enumerate(screen) if s["do"] == "wait_for" and s.get("text") == "CUTLERYCO") + mould = next(n for n, s in enumerate(screen) if s["do"] == "click" and "FORK1_Mold" in s["selector"]) + chosen = [s["value"] for s in screen if s["do"] == "choose" and s["selector"] == "#line"] - assert screen[0] == "/dashboard/machines", "the tree comes before the road" - assert lines == ["FORK1", "STACK07", "WRAP03", "PAL1"] + assert tree < mould, "the tree comes before the road" + assert ["FORK1LINE", *chosen] == ["FORK1LINE", "STACK07LINE", "WRAP03LINE", "PAL1LINE"] + assert any(s["do"] == "click" and s["selector"] == "[data-tab=scene]" for s in screen) def test_what_it_refuses_is_the_time_nobody_reported(scene): @@ -128,8 +191,10 @@ def test_the_grey_boxes_and_the_replay_banner_are_owned_up_to(scene): def test_no_screen_of_people_is_filmed(scene): urls = [step["url"] for step in scene["step"] if step["do"] == "goto"] + clicked = " ".join(step["selector"] for step in scene["step"] if step["do"] == "click") assert not [url for url in urls if "people" in url or "/admin" in url] + assert "People" not in clicked and "Setup" not in clicked def test_the_recorder_plays_every_step_of_it(runner, scene): @@ -137,10 +202,11 @@ def test_the_recorder_plays_every_step_of_it(runner, scene): class Stage: def __getattr__(self, verb): - return lambda *args: handed.append(verb) + return lambda *args, **pointer: handed.append(verb) runner.play(scene, Stage()) - assert handed.count("goto") == sum(1 for step in scene["step"] if step["do"] == "goto") + for verb in ("goto", "click", "choose"): + assert handed.count(verb) == sum(1 for step in scene["step"] if step["do"] == verb), verb assert handed.count("scroll_to") == sum(1 for step in scene["step"] if step.get("scroll_to")) assert handed.count("slide") == 3 and "terminal" not in handed diff --git a/tests/test_the_recorder_draws_a_cursor_and_a_box_a_viewer_can_follow.py b/tests/test_the_recorder_draws_a_cursor_and_a_box_a_viewer_can_follow.py index 14ce21f5..e841fa15 100644 --- a/tests/test_the_recorder_draws_a_cursor_and_a_box_a_viewer_can_follow.py +++ b/tests/test_the_recorder_draws_a_cursor_and_a_box_a_viewer_can_follow.py @@ -177,6 +177,24 @@ def test_the_cursor_is_on_the_page_from_the_first_goto_and_on_the_control_after_ f"the cursor's tip {tip} is not on the button {box}") +def test_a_page_shown_inside_a_page_gets_no_second_cursor_caption_or_badge(stage): + # The Line page's 3D tab is a page of its own inside the Line page, and the + # overlay script runs in every document; it draws only in the top one. + stage, base = stage + stage.goto(f"{base}/dashboard", 0.3) + stage.page.evaluate("""() => new Promise((done) => { + const frame = document.createElement('iframe'); + frame.id = 'inner'; frame.src = '/dashboard'; frame.onload = () => done(); + document.body.appendChild(frame); + })""") + inner = stage.page.frame_locator("#inner") + + drawn_inside = [part for part in ("fs-scene-badge", "fs-scene-cap", "fs-scene-cursor") + if inner.locator(f"#{part}").count()] + assert drawn_inside == [], f"drawn inside the inner page as well: {drawn_inside}" + assert stage.page.locator("#fs-scene-badge").count() == 1 + + def test_the_cursor_is_never_drawn_over_the_caption_bar_or_the_badge(stage): stage, base = stage stage.goto(f"{base}/dashboard", 0.1)