How to use the @qawolf/config.CONFIG.chromeOffsetX 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.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
// 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 {
      await self._browser.goto(workflow.url);
    } catch (error) {
      logger.error(`Runner: could not goto ${workflow.url}: ${error}`);

      // finish the video
github qawolf / qawolf / packages / browser / src / browser / launch.ts View on Github external
const buildPuppeteerOptions = (
  options: PuppeteerLaunchOptions,
  device: Device
) => {
  const launchOptions: PuppeteerLaunchOptions = {
    args: [
      "--disable-dev-shm-usage",
      "--no-default-browser-check",
      "--window-position=0,0",
      `--window-size=${device.viewport.width + CONFIG.chromeOffsetX},${device
        .viewport.height + CONFIG.chromeOffsetY}`
    ],
    defaultViewport: null,
    headless: CONFIG.headless,
    ...options
  };

  if (platform() === "linux") {
    launchOptions!.args!.push("--disable-gpu");
    launchOptions!.args!.push("--disable-setuid-sandbox");
    launchOptions!.args!.push("--no-sandbox");
  }

  if (CONFIG.chromeExecutablePath) {
    launchOptions.executablePath = CONFIG.chromeExecutablePath;
  }