专栏首页Jerry的SAP技术分享why My Lead OPA test add Lead fails

why My Lead OPA test add Lead fails

When you perform OPA test for my lead application, test case “add Lead” via this url: It will fail:

The reason could be analyzed via the below picture:

Our OPA test code calls fireLiveChange function. The live change event handling written in My lead application code is called, which performs oModel.read to read possible values for “f”. Since we pass “true” to read API, this read is done asynchronously, that is, the execution flow directly returns to our OPA code. Our OPA test code calls oInput.getSuggestionItems. Unfortunately Items is now still initial, since the asynchronous OData call does not finish yet in timeslot t1. items[0].getText causes the failure of OPA test. Till timeslot t2, OData request is done and success handling is called, to fill the SuggestionItems aggregation. t2 > t1, it is too late now. For detail screenshot of the above five steps, please refer to picture below.

Screenshot for step1

Screenshot for step2

Screenshot for step3

Screenshot for step5

Solution

We would like to achieve the following call sequences:

As suggested by Diablo, we could try “wait for aggregation” concept and API to fulfill it: http://veui5infra.dhcp.wdf.sap.corp:8080/sapui5-sdk-dist/docs/api/symbols/sap.ui.test.matchers.html To be updated soon.

I have added the new matcher mentioned in wiki and now OPA test of add Lead test succeeds.

To summarize, The newly added matcher will lead to an endless loop by a periodical check with polling interval 400 milliseconds by default, as a result the asynchronously executed OData request has enough time to finish. In the end we have the following expected time sequence chart.

If you would like to debug matcher logic, please set breakpoint on line below.

本文参与腾讯云自媒体分享计划,欢迎正在阅读的你也加入,一起分享。

我来说两句

0 条评论
登录 后参与评论

相关文章

  • Leetcode上的解法看不懂?试着用动画的方式去辅助理解

    https://github.com/MisterBooo/LeetCodeAnimation

    Jerry Wang
  • GUID_COMP and GUID_COMPC - IBASE table

    ticket 1548725 2011 [Sorting of Ibase compments suppress structure]. The correct...

    Jerry Wang
  • why there are two duplicate metadata requests

    版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。

    Jerry Wang
  • 什么是开发混合云应用的核心因素

    虽然为混合云部署开发应用并不是某种黑暗魔法,但是对于很多企业来说,这还是一项具有一定神秘性的工作。 可以想象,任何设想进行混合云开发的用户最终都需要完成很多个这...

    静一
  • 混合云应用对于企业的意义

    虽然为混合云部署开发应用并不是某种黑暗魔法,但是对于很多企业来说,这还是一项具有一定神秘性的工作。 可以想象,任何设想进行混合云开发的用户最终都需要完...

    静一
  • 分布式链路追踪 SkyWalking 源码分析 —— Agent DictionaryManager 字典管理

    摘要: 原创出处 http://www.iocoder.cn/SkyWalking/agent-dictionary/ 「芋道源码」欢迎转载,保留摘要,谢谢!

    芋道源码
  • 运营app,第一步要做什么?【从0开始运营APP之①】

    无论是大公司还是小企业,从0开始推广一个APP,都要经历一个创业过程——时刻面临人少、缺资源,“无推广预算”的窘境。腾讯云分析从这个月开始,将推出【从0开始运...

    腾讯大数据
  • 全网首发:逐一解读云原生应用开发“12-Factors”

    作者自序: 12原则的提出已有五年之久,可惜业界一直缺乏一篇对其进行简明解读的指导性文章,所以我决定写这样一篇文章。在微服务模式的大背景下,力求对12原则的来龙...

    yuanyi928
  • 可能是你见过的最完善的微前端解决方案

    技术栈无关:主框架不限制接入应用的技术栈,子应用具备完全自主权 独立开发、独立部署:子应用仓库独立,前后端可独立开发,部署完成后主框架自动完成同步更新 独立运行...

    用户4962466
  • 如何打造一个以应用为核心的运维体系

    在前面《有了CMDB,为什么还要应用配置管理》一文中,描述了CMDB和应用配置管理的关系,这里面提到了非常核心的一个概念:应用,。但是,上篇中更多的是从运维的角...

    赵成

扫码关注云+社区

领取腾讯云代金券