gpt4 book ai didi

qa - CodeceptJS和Nightmare-在帮助程序类中的套件之前设置cookie

转载 作者:行者123 更新时间:2023-12-03 13:23:55 25 4
gpt4 key购买 nike

我决定使用框架CodeceptJS和库Nightmare。

我的问题是在运行所有测试套件之前设置cookie
我阅读了文档和理解,因此要解决我的问题,我需要使用帮助程序类。也许我错了,但仍然如此。
如果让我知道,也许您需要使用其他方法。

它是我的 helper

'use strict';

class SetCookie extends Helper {

constructor(config){
super(config)
}

_beforeSuite() {
this.client = this.helpers['Nightmare'].browser;

this.getCookies().then((cookies) => {
console.log(cookies);
})
}

getCookies(){
return this.client.cookies.get()
}
}

module.exports = SetCookie;

问题
完成测试套件后返回Cookie

最佳答案

https://codecept.io/helpers/Nightmare/#setcookie
那是现有的 Nightmare 助手。你试过了吗?

关于qa - CodeceptJS和Nightmare-在帮助程序类中的套件之前设置cookie,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49338755/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com