【发布时间】:2018-08-23 04:46:59
【问题描述】:
所以我写了一个登录用户的测试:
describe('Login', () => {
beforeEach(async () => {
await device.reloadReactNative()
})
it('Should grant access to a user with valid credentials', async () => {
test code
})
})
现在我正在编写一个新规范来注销用户,因此我希望登录规范在注销规范中运行,而不是再次编写相同的测试代码。我想它看起来像:
describe('Log Out', () => {
beforeEach(async () => {
await device.reloadReactNative()
it ('Should grant access to a user with valid credentials')
})
it('A User Logs Out', async () => {
test code
})
如何让 Detox 在继续执行新步骤之前运行第一次登录测试?
不幸的是,beforeEach it('应该授予具有有效凭据的用户访问权限')不起作用,所以我在语法中遗漏了一些东西。
【问题讨论】:
标签: react-native automated-tests detox greybox