admin 管理员组文章数量: 1184232
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
版权声明:本文标题:Google Cloud 上的 Codeceptjs 函数 goto of undefined 内容由网友自发贡献,该文观点仅代表作者本人,
转载请联系作者并注明出处:https://www.roclinux.cn/b/1717589440a709255.html,
本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论