const assert = require("assert"); const config = `
Small header
Usual header
`; const data = { text: "The quick brown fox jumps over the lazy dog", }; Feature("Visual tags"); Scenario("Check Collapse, Header and Style", async ({ I, LabelStudio }) => { // @todo usual click should work because of role=button // @todo or at least locate('[role=button]'), but both of them are failing const clickCollapse = (text) => I.click(locate(".ant-collapse-header").withText(text)); LabelStudio.setFeatureFlags({ fflag_fix_front_dev_3391_interactive_view_all: true, }); await I.amOnPage("/"); LabelStudio.init({ config, data }); I.see("FAQ"); I.say("Every panel is hidden at the beginning and no duplicates"); I.dontSee("Main questions"); I.dontSee("fox"); I.dontSee("How to add info"); I.say("accordion=false should open every panel independently"); clickCollapse("FAQ"); I.see("Main questions"); I.dontSee("fox"); clickCollapse("Labeling UI"); I.see("Main questions"); I.see("fox"); I.say("acordion=true (default) should show one panel maximum"); I.dontSee("You can use View"); I.dontSee("You can use Image"); clickCollapse("How to add info"); I.see("You can use View"); I.dontSee("You can use Image"); clickCollapse("How to add images"); I.dontSee("You can use View"); I.see("You can use Image"); clickCollapse("How to add images"); I.dontSee("You can use View"); I.dontSee("You can use Image"); I.say("Check correct sizes of headers"); I.seeElement(locate("h4").withText("Small header")); I.seeElement(locate("h2").withText("Usual header")); I.seeElement(locate(".tall").withChild("h4")); I.say("Styles should be applied by classname"); const height = await I.grabElementBoundingRect(".tall", "height"); assert(height >= 200, true); });