const browser = require('../browser');

module.exports = async ({ fullPage = true }) => {
  await browser.start();
  const p = await browser.ensurePage();

  const path = `screenshot-${Date.now()}.png`;

  await p.screenshot({ path, fullPage });

  return {
    success: true,
    action: "screenshot",
    file: path
  };
};
