My Lead OPA test failure caused by Dialog close animation-阿里云开发者社区

开发者社区> 开发者小助手-bz5> 正文

My Lead OPA test failure caused by Dialog close animation

简介: My Lead OPA test failure caused by Dialog close animation
+关注继续查看

One colleague encountered My Lead OPA test faiulre on test case “Add Product test”:


image.png


Error context

The main steps involved in this test faiulre:

Add button is clicked, Product list dialog appears

Product list dialog is closed by oFragment.close();

Add button is clicked again. Product list dialog is expected to open for the second time

Product “Basic service outdoor” is searched against the opened product dialog - failed!

image.png

Analysis

The root cause of failure in step4 is, the expected product list dialog is NOT opened in step3. When open function is called, it is returned early in line 415, as a result Dialog is not opened at all. The UI5 framework considered this popup instance is still in status OPENED.


image.png


In order to find out why popup instance has status OPENED, we have to check the previous step when this instance is intended to be closed. The close call only sets status as CLOSING.


image.png


The real close operation is wrapped in another callback fnClose with time delay 210 milliseconds. There will be a fade out animation implemented by jQuery and the status from CLOSING to CLOSED is only set at the end of this animation. So when the add button is clicked for the second time, this scheduled call is not triggered yet, so popup instance is not decided to open by UI5 framework.



image.png

There are four solutions to make OPA test pass.


solution 1

In original implementation, the dialog instance behaves as a singleton. The same instance is shared during multiple Add button press. If every time a new dialog instance is created, the previous status set by open or close will NOT have impact on the next button press, so this issue could be avoided.

Code change:



image.png

drawback

productive code must be changed, a slight overhead due to dialog instance initialization every time Add button is clicked.


solution 2

Since the real close operation is delayed to execute 210 milliseconds later, in Lead productive code, if we manually changes some internal flag of dialog status, such as bOpen and eOpenState on behalf of UI5 framework, the subsequent call of open() will succeed as expected.


image.png


drawback

UI5 will never expect those internal flag to be changed by application. Any application code with manipulation on those internal logic becomes fragile and will easily be broken on every UI5 version upgrade.


solution 3

When debugging the close implementation of dialog, we are aware of the fact that there is alternative of dialog close without any animation.


image.png


Based on this finding, we can use the API setDurations and pass 0 as parameter for closing animation.

See line 1207 in above screenshot, in this case fnClosed will immediately be executed, which can resolve the timing issue.



image.png

drawback

Now our UI behavior is changed due to this change. The dialog disappears from UI immediately after cancel button is clicked. Not so good user experience compared with default 210 animation effect. Compare the difference by the following two videos:

0 delay.zip

210 delay.zip


solution 4

Delay the second Add button press untill the previous close operation completely finishes with all animation done. This could be achieved by scheduling the original press call in a wrapper with setTimeout and a delay > 210 milliseconds.


image.png

Although all four solutions can work, however this solution 4 should be used as it only contains OPA code change and no impect on functionality & UX on our application.

image.png

版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。

相关文章
阿里云服务器如何登录?阿里云服务器的三种登录方法
购买阿里云ECS云服务器后如何登录?场景不同,大概有三种登录方式:
2942 0
阿里云服务器ECS远程登录用户名密码查询方法
阿里云服务器ECS远程连接登录输入用户名和密码,阿里云没有默认密码,如果购买时没设置需要先重置实例密码,Windows用户名是administrator,Linux账号是root,阿小云来详细说下阿里云服务器远程登录连接用户名和密码查询方法
11398 0
阿里云服务器端口号设置
阿里云服务器初级使用者可能面临的问题之一. 使用tomcat或者其他服务器软件设置端口号后,比如 一些不是默认的, mysql的 3306, mssql的1433,有时候打不开网页, 原因是没有在ecs安全组去设置这个端口号. 解决: 点击ecs下网络和安全下的安全组 在弹出的安全组中,如果没有就新建安全组,然后点击配置规则 最后如上图点击添加...或快速创建.   have fun!  将编程看作是一门艺术,而不单单是个技术。
10864 0
使用OpenApi弹性释放和设置云服务器ECS释放
云服务器ECS的一个重要特性就是按需创建资源。您可以在业务高峰期按需弹性的自定义规则进行资源创建,在完成业务计算的时候释放资源。本篇将提供几个Tips帮助您更加容易和自动化的完成云服务器的释放和弹性设置。
12051 0
阿里云服务器安全组设置内网互通的方法
虽然0.0.0.0/0使用非常方便,但是发现很多同学使用它来做内网互通,这是有安全风险的,实例有可能会在经典网络被内网IP访问到。下面介绍一下四种安全的内网互联设置方法。 购买前请先:领取阿里云幸运券,有很多优惠,可到下文中领取。
11798 0
腾讯云服务器 设置ngxin + fastdfs +tomcat 开机自启动
在tomcat中新建一个可以启动的 .sh 脚本文件 /usr/local/tomcat7/bin/ export JAVA_HOME=/usr/local/java/jdk7 export PATH=$JAVA_HOME/bin/:$PATH export CLASSPATH=.
4636 0
如何设置阿里云服务器安全组?阿里云安全组规则详细解说
阿里云安全组设置详细图文教程(收藏起来) 阿里云服务器安全组设置规则分享,阿里云服务器安全组如何放行端口设置教程。阿里云会要求客户设置安全组,如果不设置,阿里云会指定默认的安全组。那么,这个安全组是什么呢?顾名思义,就是为了服务器安全设置的。安全组其实就是一个虚拟的防火墙,可以让用户从端口、IP的维度来筛选对应服务器的访问者,从而形成一个云上的安全域。
7411 0
阿里云ECS云服务器初始化设置教程方法
阿里云ECS云服务器初始化是指将云服务器系统恢复到最初状态的过程,阿里云的服务器初始化是通过更换系统盘来实现的,是免费的,阿里云百科网分享服务器初始化教程: 服务器初始化教程方法 本文的服务器初始化是指将ECS云服务器系统恢复到最初状态,服务器中的数据也会被清空,所以初始化之前一定要先备份好。
7106 0
阿里云服务器ECS登录用户名是什么?系统不同默认账号也不同
阿里云服务器Windows系统默认用户名administrator,Linux镜像服务器用户名root
4217 0
2497
文章
0
问答
来源圈子
更多
+ 订阅
文章排行榜
最热
最新
相关电子书
更多
《2021云上架构与运维峰会演讲合集》
立即下载
《零基础CSS入门教程》
立即下载
《零基础HTML入门教程》
立即下载