Javascript 排毒匹配器在本地工作,但在Circle CI上失败 描述

Javascript 排毒匹配器在本地工作,但在Circle CI上失败 描述,javascript,continuous-integration,e2e-testing,circleci,detox,Javascript,Continuous Integration,E2e Testing,Circleci,Detox,当我在一个React原生Typescript项目中工作时,我在我的CI上实现e2e测试时遇到了问题 我正在用Catalina 10.15.6在Mac电脑上进行本地排毒。测试一致通过(在我注意到片状固定后) 当我推送更改时,Circle CI会自动运行(在Mac上),正确构建。然后,由于匹配器(在本地正常工作)的问题,测试都失败了 繁殖 在本地运行解毒构建和测试 启动Circle CI,配置为执行上述两项操作 预期行为 如果测试在本地通过并且所有匹配器都工作,那么同样的情况也会发生在Circle

当我在一个React原生Typescript项目中工作时,我在我的CI上实现e2e测试时遇到了问题

我正在用Catalina 10.15.6在Mac电脑上进行本地排毒。测试一致通过(在我注意到片状固定后)

当我推送更改时,Circle CI会自动运行(在Mac上),正确构建。然后,由于匹配器(在本地正常工作)的问题,测试都失败了

繁殖
  • 在本地运行解毒构建和测试
  • 启动Circle CI,配置为执行上述两项操作
  • 预期行为 如果测试在本地通过并且所有匹配器都工作,那么同样的情况也会发生在Circle CI机器上

    环境
    • 排毒:^17.0.0
    • 反应本机:0.62.2
    • 节点:12.18.0
    • 设备:iPhone11Pro(模拟器)
    • macOS:Catalina 10.15.6
    • Xcode:11.5.0
    • 笑话:^24.9.0
    • 笑话马戏团:^26.1.0
    • 类型脚本:^3.8.3
    • 纱线:1.22.4
    日志 以下是我在Circle CI上测试失败的结果:

    yarn run v1.22.5
    $ /Users/distiller/project/node_modules/.bin/detox test --cleanup
    detox[12206] INFO:  [test.js] cleanup=true reportSpecs=true useCustomLogger=true forceAdbInstall=false DETOX_START_TIMESTAMP=1599242684729 node_modules/.bin/jest --config e2e/config.json '--testNamePattern=^((?!:android:).)*$' --maxWorkers 1 e2e
    detox[12207] INFO:  [DetoxServer.js] server listening on localhost:49498...
    detox[12207] INFO:  [AppleSimUtils.js] xx.xxx.xxxxx launched. To watch simulator logs, run:
            /usr/bin/xcrun simctl spawn 03E73092-B137-4FA2-B3F9-EE1901FCCC1E log stream --level debug --style compact --predicate 'process == "xxxx"'
    detox[12207] INFO:  Project Test Suite is assigned to 03E73092-B137-4FA2-B3F9-EE1901FCCC1E {"type":"iPhone 11 Pro"}
    detox[12207] INFO:  Project Test Suite: should enter an invalid email and error message should appear
    detox[12207] INFO:  Project Test Suite: should enter an invalid email and error message should appear [FAIL]
    detox[12207] INFO:  Project Test Suite: should enter a registered email and pass the email input screen to login code entry
    detox[12207] INFO:  Project Test Suite: should enter a registered email and pass the email input screen to login code entry [FAIL]
    detox[12207] INFO:  Project Test Suite: should enter a valid email and invalid login code then error message should appear
    detox[12207] INFO:  at e2e/firstTest.e2e.js:176:19 
     DO NOT REMOVE
    detox[12207] INFO:  at e2e/firstTest.e2e.js:123:19 
     Something went wrong:  Error: Test Failed: Timed out while waiting for expectation: TOBEVISIBLE WITH MATCHER(identifier: == “xxxx”) TIMEOUT(1s)
    TIP: To print view hierarchy on failed actions/matches, use loglevel verbose and above.
        at processTicksAndRejections (internal/process/task_queues.js:97:5)
    detox[12207] INFO:  Project Test Suite: should enter a valid email and invalid login code then error message should appear [FAIL]
    detox[12207] INFO:  Project Test Suite: should enter a valid email then a valid login code and end up at the testing site preferences screen
    detox[12207] INFO:  at e2e/firstTest.e2e.js:200:19 
     DO NOT REMOVE
    detox[12207] INFO:  at e2e/firstTest.e2e.js:123:19 
     Something went wrong:  Error: Test Failed: Timed out while waiting for expectation: TOBEVISIBLE WITH MATCHER(identifier: == “xxxx”) TIMEOUT(1s)
    TIP: To print view hierarchy on failed actions/matches, use loglevel verbose and above.
        at processTicksAndRejections (internal/process/task_queues.js:97:5)
    detox[12207] INFO:  Project Test Suite: should enter a valid email then a valid login code and end up at the testing site preferences screen [FAIL]
    detox[12207] INFO:  Project Test Suite: should attempt to advance past testing site preferences screen without entering preference
    detox[12207] INFO:  Project Test Suite: should attempt to advance past testing site preferences screen without entering preference [FAIL]
    detox[12207] INFO:  Project Test Suite: should rank a testing site and advance to the availability page
    detox[12207] INFO:  Project Test Suite: should rank a testing site and advance to the availability page [FAIL]
    detox[12207] INFO:  Project Test Suite: should toggle a time slot, collapse an accordion, and then click submit
    detox[12207] INFO:  [AppleSimUtils.js] xxx.xxxx.xxxx launched. To watch simulator logs, run:
            /usr/bin/xcrun simctl spawn 03E73092-B137-4FA2-B3F9-EE1901FCCC1E log stream --level debug --style compact --predicate 'process == "XXXXX"'
    detox[12207] INFO:  Project Test Suite: should toggle a time slot, collapse an accordion, and then click submit [FAIL]
    
     FAIL  e2e/firstTest.e2e.js (174.609s)
      Project Test Suite
        ✕ should enter an invalid email and error message should appear (8205ms)
        ✕ should enter a registered email and pass the email input screen to login code entry (8695ms)
        ✕ should enter a valid email and invalid login code then error message should appear (10658ms)
        ✕ should enter a valid email then a valid login code and end up at the testing site preferences screen (13953ms)
        ✕ should attempt to advance past testing site preferences screen without entering preference (4959ms)
        ✕ should rank a testing site and advance to the availability page (5033ms)
        ✕ should toggle a time slot, collapse an accordion, and then click submit (9286ms)
    
      ● Project Test Suite › should enter an invalid email and error message should appear
    
        Test Failed: Failed expectation: TOBEVISIBLE WITH MATCHER(identifier: == “xxx”), View “<RCTUITextField: 0x7f9fb28ef600>” is not visible at point “{"x":59.333333333333343,"y":23.333333333333371}”; Window “<RCTRedBoxWindow: 0x7f9fb24b4650>” is above the tested view's window and its transparency around point “{"x":98.000001271565765,"y":309.66666730244958}” is below the tested threshold (0.5)
        TIP: To print view hierarchy on failed actions/matches, use loglevel verbose and above.
    
    
    
      ● Project Test Suite › should enter a registered email and pass the email input screen to login code entry
    
        Test Failed: No elements found for “MATCHER(identifier: == “xxx”)”
        TIP: To print view hierarchy on failed actions/matches, use loglevel verbose and above.
    
    
    
    
      ● Project Test Suite › should enter a valid email and invalid login code then error message should appear
    
        TypeError: Cannot read property 'XXXXX' of undefined
    
          80 |   it("should enter a valid email and invalid login code then error message should appear", async () => {
          81 |     const {
        > 82 |       constant,
             |       ^
          83 |       constant2,
          84 |     } = await someFunction();
          85 |     await expect(constant).toBeVisible();
    
          at _callee4$ (firstTest.e2e.js:82:7)
          at tryCatch (../node_modules/regenerator-runtime/runtime.js:45:40)
          at Generator.invoke [as _invoke] (../node_modules/regenerator-runtime/runtime.js:274:22)
          at Generator.prototype.<computed> [as next] (../node_modules/regenerator-runtime/runtime.js:97:21)
          at tryCatch (../node_modules/regenerator-runtime/runtime.js:45:40)
          at invoke (../node_modules/regenerator-runtime/runtime.js:135:20)
          at ../node_modules/regenerator-runtime/runtime.js:145:13
    
      ● Project Test Suite › should enter a valid email then a valid login code and end up at the testing site preferences screen
    
        Test Failed: No elements found for “MATCHER(text == “xxxx”)”
        TIP: To print view hierarchy on failed actions/matches, use loglevel verbose and above.
    
    
    
      ● Project Test Suite › should attempt to advance past testing site preferences screen without entering preference
    
        Test Failed: No elements found for “MATCHER(text == “xxxx”)”
        TIP: To print view hierarchy on failed actions/matches, use loglevel verbose and above.
    
    
    
      ● Project Test Suite › should rank a testing site and advance to the availability page
    
        Test Failed: No elements found for “MATCHER(text == “xxxx”)”
        TIP: To print view hierarchy on failed actions/matches, use loglevel verbose and above.
    
    
    
      ● Project Test Suite › should toggle a time slot, collapse an accordion, and then click submit
    
        Test Failed: No elements found for “MATCHER(identifier: == “xxxx”)”
        TIP: To print view hierarchy on failed actions/matches, use loglevel verbose and above.
    
    
    
    detox[12206] ERROR: [cli.js] Error: Command failed: node_modules/.bin/jest --config e2e/config.json '--testNamePattern=^((?!:android:).)*$' --maxWorkers 1 e2e
    
    error Command failed with exit code 1.
    info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
    
    Exited with code exit status 1
    
    纱线运行v1.22.5
    $/Users/distriller/project/node_modules/.bin/解毒测试--清理
    解毒[12206]信息:[test.js]cleanup=true reportSpecs=true useCustomLogger=true forceAdbInstall=false detox\u START\u TIMESTAMP=1599242684729 node\u modules/.bin/jest--config e2e/config.json'--testNamePattern=^((?!:android:))*$'--maxWorkers 1 e2e
    解毒[12207]信息:[解毒服务器.js]正在本地主机上侦听的服务器:49498。。。
    排毒[12207]信息:[AppleSimUtils.js]xx.xxx.xxxxx发布。要查看模拟器日志,请运行:
    /usr/bin/xcrun simctl spawn 03E73092-B137-4FA2-B3F9-EE1901FCC1E日志流--级别调试--样式压缩--谓词“进程==“xxxx”'
    解毒[12207]信息:项目测试套件分配给03E73092-B137-4FA2-B3F9-EE1901FCC1E{“类型”:“iPhone 11 Pro”}
    解毒[12207]信息:项目测试套件:应输入无效电子邮件,并显示错误消息
    解毒[12207]信息:项目测试套件:应输入无效电子邮件,并显示错误消息[失败]
    解毒[12207]信息:项目测试套件:应输入已注册的电子邮件,并通过电子邮件输入屏幕进入登录代码输入
    解毒[12207]信息:项目测试套件:应输入已注册的电子邮件,并通过电子邮件输入屏幕进入登录代码输入[失败]
    解毒[12207]信息:项目测试套件:应输入有效的电子邮件和无效的登录代码,然后出现错误消息
    排毒[12207]信息:在e2e/firstTest.e2e.js:176:19
    不要移除
    排毒[12207]信息:在e2e/firstTest.e2e.js:123:19
    出现错误:错误:测试失败:在等待预期时超时:使用MATCHER(标识符==“xxxx”)验证超时(1s)
    提示:要打印失败操作/匹配的视图层次结构,请使用loglevel verbose及更高版本。
    在处理和拒绝时(内部/process/task_queues.js:97:5)
    解毒[12207]信息:项目测试套件:应输入有效的电子邮件和无效的登录代码,然后出现错误消息[失败]
    解毒[12207]信息:项目测试套件:应输入有效的电子邮件,然后输入有效的登录代码,并在测试站点首选项屏幕结束
    排毒[12207]信息:在e2e/firstTest.e2e.js:200:19
    不要移除
    排毒[12207]信息:在e2e/firstTest.e2e.js:123:19
    出现错误:错误:测试失败:在等待预期时超时:使用MATCHER(标识符==“xxxx”)验证超时(1s)
    提示:要打印失败操作/匹配的视图层次结构,请使用loglevel verbose及更高版本。
    在处理和拒绝时(内部/process/task_queues.js:97:5)
    解毒[12207]信息:项目测试套件:应输入有效的电子邮件,然后输入有效的登录代码,最后出现在测试站点首选项屏幕[失败]
    排毒[12207]信息:项目测试套件:应尝试在不输入首选项的情况下提前通过测试站点首选项屏幕
    排毒[12207]信息:项目测试套件:应在不输入首选项[失败]的情况下,尝试提前通过测试站点首选项屏幕
    解毒[12207]信息:项目测试套件:应该对测试站点进行排名,并进入可用性页面
    解毒[12207]信息:项目测试套件:应该对测试站点进行排名,并进入可用性页面[失败]
    排毒[12207]信息:项目测试套件:应切换时间段,折叠手风琴,然后单击提交
    排毒[12207]信息:[AppleSimUtils.js]xxx.xxxx.xxxx已启动。要查看模拟器日志,请运行:
    /usr/bin/xcrun simctl spawn 03E73092-B137-4FA2-B3F9-EE1901FCC1E日志流--级别调试--样式压缩--谓词“进程==”XXXXX“
    Dexin[12207]INFO:Project TestSuite:应切换一个时隙,折叠一个手风琴,然后单击提交[FAIL]
    e2e/firstTest.e2e.js失败(174.609s)
    项目测试套件
    ✕ 应输入无效电子邮件并显示错误消息(8205毫秒)
    ✕ 应输入已注册的电子邮件,并通过电子邮件输入屏幕进入登录代码输入(8695ms)
    ✕ 如果输入有效的电子邮件和无效的登录代码,则应显示错误消息(10658ms)
    ✕ 应输入有效的电子邮件,然后输入有效的登录代码,并在测试站点首选项屏幕结束(13953ms)
    ✕ 应尝试在不输入首选项的情况下提前通过测试站点首选项屏幕(4959ms)
    ✕ 应该对测试站点进行排名并进入可用性页面(5033ms)
    ✕ 应切换时间段,折叠手风琴,然后单击提交(9286毫秒)
    ● 项目测试套件›应输入无效电子邮件,并显示错误消息
    测试失败:失败的预期:使用匹配器(标识符:=“xxx”)可验证,视图“”在点“{”x:59.3333 43,“y:23.3333 71}”处不可见;窗口“”位于测试视图的窗口上方,其点“{“x”:98.00000 1271565765,“y”:309.66666 730244958}”周围的透明度低于测试阈值(0.5)
    提示:要打印失败操作/匹配的视图层次结构,请使用loglevel verbose及更高版本。
    ● 项目测试套件›应输入注册表