- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试使用 device.launchApp({ permissions: { notifications: 'YES' } })
启用权限,但它似乎没有被调用。
这是我的测试:
describe('Mobile test', () => {
beforeAll(async () => {
await detox.init(config, { launchApp: false });
await device.launchApp({ permissions: { notifications: 'YES' } });
});
describe('Smoke', () => {
it('my test', async () => {
mock.cardData.assignee = mock.signupData.profile.fullName;
await Operator.signup(mock.signupData);
});
});
});
这是使用 verbose loglevel
的测试输出:
detox[8345] INFO: [DetoxServer.js] server listening on localhost:65156...
detox[8345] DEBUG: [AsyncWebSocket.js/WEBSOCKET_OPEN] opened web socket to: ws://localhost:65156
detox[8345] DEBUG: [DetoxServer.js/LOGIN] role=tester, sessionId=087d9cea-5251-fbda-160a-f89d4927dee3
detox[8345] DEBUG: [DetoxServer.js/LOGIN_SUCCESS] role=tester, sessionId=087d9cea-5251-fbda-160a-f89d4927dee3
detox[8345] DEBUG: [exec.js/EXEC_CMD, #0] /usr/bin/xcrun simctl list -j
detox[8345] DEBUG: [exec.js/EXEC_CMD, #1] applesimutils --list --byType "iPhone X" --byOS "12.2"
detox[8345] DEBUG: [exec.js/EXEC_TRY, #1] Searching for device matching iPhone X...
detox[8345] DEBUG: [exec.js/EXEC_CMD, #2] applesimutils --list --byId "B2E486B7-8CD7-4B94-9969-3C6901591BD8"
detox[8345] DEBUG: [exec.js/EXEC_CMD, #3] /usr/bin/xcrun simctl uninstall B2E486B7-8CD7-4B94-9969-3C6901591BD8 com.amadeu.mobileapp
detox[8345] DEBUG: [exec.js/EXEC_TRY, #3] Uninstalling com.amadeu.mobileapp...
detox[8345] DEBUG: [exec.js/EXEC_SUCCESS, #3] com.amadeu.mobileapp uninstalled
detox[8345] DEBUG: [exec.js/EXEC_CMD, #4] /usr/bin/xcrun simctl install B2E486B7-8CD7-4B94-9969-3C6901591BD8 "/Users/amadeu.filho/Developer/amadeu-mobile/ios/build/Build/Products/Debug-iphonesimulator/amadeumobile.app"
detox[8345] DEBUG: [exec.js/EXEC_TRY, #4] Installing /Users/amadeu.filho/Developer/amadeu-mobile/ios/build/Build/Products/Debug-iphonesimulator/amadeumobile.app...
detox[8345] DEBUG: [exec.js/EXEC_SUCCESS, #4] /Users/amadeu.filho/Developer/amadeu-mobile/ios/build/Build/Products/Debug-iphonesimulator/amadeumobile.app installed
detox[8345] DEBUG: [exec.js/EXEC_CMD, #5] /usr/bin/xcrun simctl terminate B2E486B7-8CD7-4B94-9969-3C6901591BD8 com.amadeu.mobileapp
detox[8345] DEBUG: [exec.js/EXEC_TRY, #5] Terminating com.amadeu.mobileapp...
detox[8345] DEBUG: [exec.js/EXEC_SUCCESS, #5] com.amadeu.mobileapp terminated
detox[8345] DEBUG: [exec.js/EXEC_CMD, #6] SIMCTL_CHILD_DYLD_INSERT_LIBRARIES="/Users/amadeu.filho/Library/Detox/ios/1ea4f89e9092026849f937e47281627c5f5251d6/Detox.framework/Detox" /usr/bin/xcrun simctl launch B2E486B7-8CD7-4B94-9969-3C6901591BD8 com.amadeu.mobileapp --args -detoxServer "ws://localhost:65156" -detoxSessionId "087d9cea-5251-fbda-160a-f89d4927dee3"
detox[8345] DEBUG: [exec.js/EXEC_TRY, #6] Launching com.amadeu.mobileapp...
detox[8345] DEBUG: [exec.js/EXEC_CMD, #7] /usr/bin/xcrun simctl get_app_container B2E486B7-8CD7-4B94-9969-3C6901591BD8 com.amadeu.mobileapp
detox[8345] INFO: [AppleSimUtils.js] com.amadeu.mobileapp launched. To watch simulator logs, run:
/usr/bin/xcrun simctl spawn B2E486B7-8CD7-4B94-9969-3C6901591BD8 log stream --level debug --style compact --predicate 'processImagePath beginsWith "/Users/amadeu.filho/Library/Developer/CoreSimulator/Devices/B2E486B7-8CD7-4B94-9969-3C6901591BD8/data/Containers/Bundle/Application/6F69DC89-7478-4502-8998-8B93E8D061C6/amadeumobile.app"'
detox[8345] DEBUG: [DetoxServer.js/CANNOT_FORWARD] role=testee not connected, cannot fw action (sessionId=087d9cea-5251-fbda-160a-f89d4927dee3)
detox[8345] DEBUG: [DetoxServer.js/LOGIN] role=testee, sessionId=087d9cea-5251-fbda-160a-f89d4927dee3
detox[8345] DEBUG: [DetoxServer.js/LOGIN_SUCCESS] role=testee, sessionId=087d9cea-5251-fbda-160a-f89d4927dee3
我也尝试在应用程序打开时手动调用 applesimutils,但是,我不知道排毒是否使用不同的包来运行测试套件。
➜ applesimutils --byId "B2E486B7-8CD7-4B94-9969-3C6901591BD8" --bundle com.amadeu.mobileapp --setPermissions notifications=YES
我正在使用 iPhone X 模拟器。
"buildversion" : "16E226",
"availability" : "(available)",
"isAvailable" : true,
"identifier" : "com.apple.CoreSimulator.SimRuntime.iOS-12-2",
"version" : "12.2",
"name" : "iOS 12.2"
最佳答案
看来我们应该在没有启动的情况下初始化排毒,然后使用 device.launchApp({ permissions: { notifications: 'YES' } })
因此,在 init.js
文件中,您可以使用:
const detox = require('detox');
const adapter = require('detox/runners/jest/adapter');
const specReporter = require('detox/runners/jest/specReporter');
const config = require('../package.json').detox;
jest.setTimeout(120000);
jasmine.getEnv().addReporter(adapter);
jasmine.getEnv().addReporter(specReporter);
beforeAll(async () => {
await detox.init(config, { launchApp: false });
await device.launchApp({ permissions: { notifications: 'YES' } });
});
beforeEach(async () => {
await adapter.beforeEach();
});
afterAll(async () => {
await adapter.afterAll();
await detox.cleanup();
});
关于ios - 在 Detox 测试不起作用时启用通知,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57057132/
今天有小伙伴给我留言问到,try{...}catch(){...}是什么意思?它用来干什么? 简单的说 他们是用来捕获异常的 下面我们通过一个例子来详细讲解下
我正在努力提高网站的可访问性,但我不知道如何在页脚中标记社交媒体链接列表。这些链接指向我在 facecook、twitter 等上的帐户。我不想用 role="navigation" 标记这些链接,因
说现在是 6 点,我有一个 Timer 并在 10 点安排了一个 TimerTask。之后,System DateTime 被其他服务(例如 ntp)调整为 9 点钟。我仍然希望我的 TimerTas
就目前而言,这个问题不适合我们的问答形式。我们希望答案得到事实、引用资料或专业知识的支持,但这个问题可能会引发辩论、争论、投票或扩展讨论。如果您觉得这个问题可以改进并可能重新打开,visit the
我就废话不多说了,大家还是直接看代码吧~ ? 1
Maven系列1 1.什么是Maven? Maven是一个项目管理工具,它包含了一个对象模型。一组标准集合,一个依赖管理系统。和用来运行定义在生命周期阶段中插件目标和逻辑。 核心功能 Mav
我是一名优秀的程序员,十分优秀!