drashland / sinco

Browser Automation and Testing Tool for Deno, written in full TypeScript
https://drash.land/sinco
MIT License
57 stars 3 forks source link

Support focussing new tab #100

Closed ebebbington closed 2 years ago

ebebbington commented 2 years ago

Use case: user clicks a button or link and it opens a new tab, they need to get info from that tab, then come back to the main page

How: Need to change the click logic:

await send('Input.dispatchMouseEvent', {
      type: 'mouseReleased',
      "middle",
      x,
      y,
      modifiers: 0,
      clickCount: 1,
    });

Then get them to grab the new page:

const page2 = browser.pages()[1]
page2.something()
page1.doUsualStuff()
ebebbington commented 2 years ago

will be closed by #103