var test=function(o,u,f,g,p,k){"use strict";function l(t){return t&&typeof t=="object"&&"default"in t?t:{default:t}}var c=l(f),b=l(p);class r{constructor(e){this.name=e}}class d extends r{say(){console.log("say")}}class x extends d{say(){console.log("meow")}}const h=`This handy tool helps you create dummy text for all your layout needs.We are gradually adding new functionality and we welcome your suggestions and feedback.Please feel free to send us any additional dummy texts.
`.split(" "),y=()=>c.default.shuffle(h).join(" "),M=()=>c.default.sample(h)||"hello-world",v="https://jsonplaceholder.typicode.com/users",T=async()=>(await fetch(v)).json();let R=0;const j={getRandomPic:(t=160*6,e=90*6)=>`https://picsum.photos/id/${u.rand(10,100)}/${t}/${e}.jpg`,getRandomText:y,getRandomWord:M,getId:()=>`uniq-id-${R++}`,getRandomUser:T,getRandomColor:()=>`#${Math.floor(Math.random()*16777215).toString(16)}`},w=async t=>{await t.goto("chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/home.html#initialize/welcome"),await t.locator("text=Get Started").click(),await t.waitForURL("chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/home.html#initialize/select-action"),await t.locator("text=Import wallet").click(),await t.waitForURL("chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/home.html#initialize/metametrics-opt-in"),await t.locator('[data-testid="page-container-footer-next"]').click(),await t.waitForURL("chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/home.html#initialize/create-password/import-with-seed-phrase"),await t.locator("select").selectOption("24");const a="hockey   dilemma   magic   rigid   blade   crawl   soldier   screen   mind   siege   disorder   hint   ramp   solid   flat   caution   swamp   anger   attend   trim   tell   obscure   rice   math".split(/\s+/);for(const[n,s]of Object.entries(a)){const i=t.locator(`[data-testid="import-srp__srp-word-${n}"]`);await i.click(),await i.fill(s)}await t.locator("text=I have read and agree to the Terms of Use").click(),await t.locator("#password").click(),await t.locator("#password").fill("Over123456"),await t.locator("#confirm-password").click(),await t.locator("#confirm-password").fill("Over123456"),await t.locator('button:has-text("Import")').click(),await t.waitForURL("chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/home.html#initialize/end-of-flow"),await t.locator("text=All Done").click(),await t.locator(".popover-header__title button").click()},U=g.test.extend({context:async({},t)=>{const e=b.default.join(__dirname,"./extension"),a=await k.chromium.launchPersistentContext("",{devtools:!1,headless:!1,timeout:0,args:[`--disable-extensions-except=${e}`,`--load-extension=${e}`]});await t(a),await a.close()},metaMaskPage:async({context:t,extensionId:e},a)=>{const n=`chrome-extension://${e}/popup.html`,s=t.pages(),i=s.length>0?s[0]:await t.newPage();await w(i),await i.goto(n);for(const m of t.pages())m.url().includes("home.html#initialize/welcome")&&await m.close();await a(i)},extensionId:async({context:t},e)=>{let[a]=t.backgroundPages();a||(a=await t.waitForEvent("backgroundpage"));const n=a.url().split("/")[2];await e(n)}}),S={approve(){console.log()},reject(){console.log("x")}},$=async(t,e,a)=>{let n=!1;for(;!n;)await t.waitForTimeout(1e3),await t.reload(),n=await t.locator(e,a).isVisible();return t.locator(e,a)},C={confirmBtn:["button",{hasText:"Confirm"}],approveBtn:["button",{hasText:"Approve"}],switchNetworkBtn:["button",{hasText:"Switch network"}],rejectBtn:["button",{hasText:"Reject"}],nextBtn:["button",{hasText:"Next"}],connectBtn:["button",{hasText:"Connect"}]},E=t=>{console.log(`
---pages begin----`),t.pages().forEach(e=>console.log("pageurl",e.url())),t.backgroundPages().forEach(e=>console.log("background page url",e.url())),console.log(`---pages end----
`)};return o.Animal=r,o.Cat=x,o.Mammal=d,o.SELECTORS=C,o.metamask=S,o.mock=j,o.printPageUrls=E,o.signinWallet=w,o.testWithMetaMask=U,o.waitForMetaMask=$,Object.defineProperties(o,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}}),o}({},utils,_,test,path,playwright);
