我无法回答原生 iOS confirm Detox - React native 中的 mocha 应用程序

I can not answer the native iOS confirm Detox - mocha application in React native

我刚开始使用 Detox 来测试我的 React 本机应用程序,但我在回答本机确认问题时遇到了一些麻烦。

我没有找到 _UI 的列表……查看 (例如:_UIAlertControllerActionView、_UINavigationBarBackIndicatorView)

it('should show world screen after tap', async () => {

    await loginPage.getFbBtn().tap();    
    // await element(by.type('_UINavigationBarBackIndicatorView')).tap(); 
    //await element(by.text('Continue')).tap();
    await element(by.text('Continue').and(by.type('_UIAlertControllerActionView'))).tap();
  });

element(by.type('_UINavigationBarBackIndicatorView')).tap();

(node:2009) UnhandledPromiseRejectionWarning: 错误: 找不到 UI 元素。 异常操作:{ "Action Name": "Tap", "Element Matcher": "((!(kindOfClass('RCTScrollView')) && kindOfClass('(null)')) || (((kindOfClass('UIView') || respondsToSelector(accessibilityContainer)) && parentThatMatches(kindOfClass('RCTScrollView'))) && ((kindOfClass('UIView') || respondsToSelector(accessibilityContainer)) && parentThatMatches(kindOfClass('(null)')))))", "Recovery Suggestion": "Check if the element exists in the UI hierarchy printed below. If it exists, adjust the matcher so that it accurately matches element." }

错误跟踪:[ { "Description": "Interaction cannot continue because the desired element was not found.", "Error Domain": "com.google.earlgrey.ElementInteractionErrorDomain", "Error Code": "0", "File Name": "GREYElementInteraction.m", "Function Name": "-[GREYElementInteraction matchedElementsWithTimeout:error:]", "Line": "124" } ]

等待元素(by.text('Continue')).tap();

错误:找不到 UI 元素。 异常操作:{ "Action Name": "Tap", "Element Matcher": "((!(kindOfClass('RCTScrollView')) && (((kindOfClass('UILabel') || kindOfClass('UITextField') || kindOfClass('UITextView')) && hasText('Continue')) || (kindOfClass('RCTTextView') && 具有可访问性标签的对象 "Continue"))) || (((kindOfClass('UIView') || respondsToSelector(accessibilityContainer)) && parentThatMatches(kindOfClass('RCTScrollView'))) && ((kindOfClass('UIView') || respondsToSelector(accessibilityContainer)) && parentThatMatches((((kindOfClass('UILabel') || kindOfClass('UITextField') || kindOfClass('UITextView')) && hasText('Continue')) || (kindOfClass('RCTTextView') && 一个带有 accessibilityLabel "Continue"))))))", "Recovery Suggestion": "Check if the element exists in the UI hierarchy printed below. If it exists, adjust the matcher so that it accurately matches element." }

等待元素(by.text('Continue').and(by.type('_UIAlertControllerActionView'))).tap(); 错误:找不到 UI 元素。

这不是您可以与之互动的提醒。该警报由与您的应用程序不同的进程呈现,Detox 无法与其交互。相反,您应该模拟显示此内容的 API 。