How to use the @qawolf/config.CONFIG.videoPath function in @qawolf/config

To help you get started, we’ve selected a few @qawolf/config examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github qawolf / qawolf / packages / browser / src / browser / launch.ts View on Github external
browser.close = qawolf.close.bind(qawolf);
  browser.find = qawolf.find.bind(qawolf);
  browser.findProperty = qawolf.findProperty.bind(qawolf);
  browser.goto = qawolf.goto.bind(qawolf);
  browser.hasText = qawolf.hasText.bind(qawolf);
  browser.page = qawolf.page.bind(qawolf);
  browser.scroll = qawolf.scroll.bind(qawolf);
  browser.select = qawolf.select.bind(qawolf);
  browser.type = qawolf.type.bind(qawolf);
  browser.qawolf = qawolf;

  await managePages(browser);

  if (options.url) await qawolf.goto(options.url);

  const videoPath = options.videoPath || CONFIG.videoPath;
  if (videoPath) {
    // start capture after goto
    qawolf._screenCapture = await ScreenCapture.start({
      offset: {
        x: CONFIG.chromeOffsetX,
        y: CONFIG.chromeOffsetY
      },
      savePath: `${CONFIG.videoPath}/${basename(require.main!.filename)}`,
      size: {
        height: device.viewport.height,
        width: device.viewport.width
      }
    });
  }

  return browser;
github qawolf / qawolf / packages / runner / src / Runner.ts View on Github external
*/
    logger.verbose(`Runner: create for ${workflow.name}`);

    const self = new Runner();

    // replace the url w/ env variable if it exists
    workflow.url = getUrl(workflow);

    const options: BrowserCreateOptions = { size: workflow.size };
    if (CONFIG.domPath) options.domPath = `${CONFIG.domPath}/${workflow.name}`;

    self._browser = await Browser.create(options);
    self._envValues = getEnvValues(workflow);
    self._workflow = workflow;

    if (CONFIG.videoPath) {
      const device = self._browser.device;

      self._screenCapture = await ScreenCapture.start({
        offset: {
          x: CONFIG.chromeOffsetX,
          y: CONFIG.chromeOffsetY
        },
        savePath: `${CONFIG.videoPath}/${workflow.name}`,
        size: {
          height: device.viewport.height,
          width: device.viewport.width
        }
      });
    }

    try {
github qawolf / qawolf / packages / browser / src / browser / launch.ts View on Github external
browser.type = qawolf.type.bind(qawolf);
  browser.qawolf = qawolf;

  await managePages(browser);

  if (options.url) await qawolf.goto(options.url);

  const videoPath = options.videoPath || CONFIG.videoPath;
  if (videoPath) {
    // start capture after goto
    qawolf._screenCapture = await ScreenCapture.start({
      offset: {
        x: CONFIG.chromeOffsetX,
        y: CONFIG.chromeOffsetY
      },
      savePath: `${CONFIG.videoPath}/${basename(require.main!.filename)}`,
      size: {
        height: device.viewport.height,
        width: device.viewport.width
      }
    });
  }

  return browser;
};