第一口我决定记下来的是一个业内外都能看懂的锅,简洁大方.
大家都知道一般的网页侧边都有一个导航区,或者可以叫它索引列表,我测试的这个网页有两个索引列表,可以通过下拉菜单切换.
本次测试的系统中这两个索引列表分别就叫his和physical,对应的也是两大块功能,在physical下做业务时收到了一个his的消息,我去点击这个消息,消息的内容跳转了,但是侧边导航没有跳转就依然还是physical.这一段根据路由name匹配侧边栏的代码就是有问题的:
if (to.name.startsWith('home')) {
if (to.meta.sidebar && to.meta.sidebar === 'hisModule'
curIdentity = 'hisModule';
} else if (to.meta.sidebar && to.meta.sidebar === 'physical') {
curIdentity = 'physicalModule';
}
原因是侧边导航栏没有和具体页面的路径做绑定,只是根据功能模块的名字去判断侧边栏该展示什么,但是本次消息的跳转链接是没有具体的模块名称的,所以开发在套if...else中又加了对于路径name及path的一段判断,修改之后就是这个样子了:
if (to.name) {
if (to.name.includes('wait_register') || to.name.includes('admission') || to.name.includes('unreadReport')
|| to.name.includes('nurseAssessment') || to.name.includes('skinTest') || to.name.includes('treatment') ||
to.name.includes('examination') || to.name.includes('executeExamine') || to.name.includes('special_disease') ||
to.name.includes('treated')) {
curIdentity = 'hisModule';
} else {
curIdentity = 'physicalModule';
}
} else if (to.path) {
if (to.path.includes('wait_register') || to.path.includes('admission') || to.path.includes('unreadReport')
|| to.path.includes('nurseAssessment') || to.path.includes('skinTest') || to.path.includes('treatment') ||
to.path.includes('examination') || to.path.includes('executeExamine') || to.path.includes('special_disease') ||
to.path.includes('waitList')) {
curIdentity = 'hisModule';
} else {
curIdentity = 'physicalModule';
}
}
这样一段大改动之后当时消息跳转的时候导航区是跟着变过来了,但是从hismodule再往physicalmodule切的时候就切不过去了,因为开发同学只对部分链接加了绑定.
最后这跳不过去跳不回来的问题都解决了,终于赶上了发布时间,满心欢喜的发到线上.
谁知一大早用户问题反馈群就炸锅了,原因是if中判定为hismodule的path少加了两个项目|| to.path.includes('excuteFollow') || to.path.includes('viewResults')) ,判定为name的选项少加了 || to.name.includes('follow')) ,这些本该是hismodule的选项直接else到physicalmodule中去了,然而线上用户的权限一般只有一个功能,所以在使用系统的时候,侧边栏就是空的啥也没有.测试环境没有发现这个问题是因为作为测试的我并没有去关心开发如何去改的bug,也没有把这个代码拉下来瞅瞅,开发改完这个bug呢也没有说明测试范围.
所以,千万不要做纯黑盒的测试,不仅要知其然,还要知其所以然!
but,
最重要的还是有bug一定要及时改,别拖到发布那天......