Google Cloud 上的 Codeceptjs 函数 goto of undefined

编程入门 行业动态 更新时间:2024-10-03 19:13:22

Google Cloud 上的 Codeceptjs <a href=https://www.elefans.com/category/jswz/34/1771370.html style=函数 goto of undefined"/>

Google Cloud 上的 Codeceptjs 函数 goto of undefined

我正在尝试使用在 Google Cloud Function 中运行的 CodeceptJS(带有 Puppeteer)来自动化网络活动。 我的 index.js 是:

const Container = require('codeceptjs').container;
const Codecept = require('codeceptjs').codecept;
const event = require('codeceptjs').event;
const path = require('path');

module.exports.basicTest = async (req, res) => {  

  let message = '';

  // helpers config
  let config = { 
    tests: './*_test.js',
    output: './output',
    helpers: { 
      Puppeteer: { 
        url: '', // base url
        show: true,
        disableScreenshots: true, // don't store screenshots on failure
        windowSize: '1200x1000', // set window size dimensions
        waitForAction: 1000, // increase timeout for clicking
        waitForNavigation: [ 'domcontentloaded', 'networkidle0' ], // wait for document to load
        chrome: {
          args: ['--no-sandbox'] // IMPORTANT! Browser can't be run without this!
        }
      } 
    },
    include: {
      I: './steps_file.js'
    },
    bootstrap: null,
    mocha: {},
    name: 'basic_test',

    // Once a tests are finished - send back result via HTTP
    teardown: (done) => {
      res.send(`Finished\n${message}`);
    }
  };

  // pass more verbose output
  let opts = {
    debug: true,
    steps: true
  };

  // a simple reporter, let's collect all passed and failed tests
  event.dispatcher.on(event.test.passed, (test) => {
    message += `- Test "${test.title}" passed  
          

更多推荐

Google Cloud 上的 Codeceptjs 函数 goto of undefined

本文发布于:2024-05-30 21:42:01,感谢您对本站的认可!
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:函数   Cloud   Google   Codeceptjs   undefined

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!