sapui5 opa5 opa脚本无法识别View

时间:2017-09-08 11:15:51

标签: sapui5 sapui5-opa

我编写了一个OPA脚本,但它没有识别View ID。能帮我解决这个问题吗?

OPA脚本无法在文本区域字段中输入“在描述中测试”文本

我的脚本失败,我看到下面的错误。

There was no Input
Opa timeout
This is what Opa logged:
all results were filtered out by the matchers - skipping the check -  sap.ui.test.pipelines.MatcherPipeline
Callstack:
    at fillDescription (https://webidetesting7755399-w3446edba.dispatcher.int.sap.hana.ondemand.com/webapp/test/integration/pages/ActivitySet.js?eval:58:19)
    at Object.eval (https://webidetesting7755399-w3446edba.dispatcher.int.sap.hana.ondemand.com/webapp/test/integration/AllActivitySets.js?eval:32:30)
Expected:   
true
Result:     
false
Diff:   
trufalse

以下是我的代码..

Opa5.extendConfig({
        viewName : "test",
        arrangements: new Common(),
        viewNamespace: "com.tools.melody.activityForm.view.",
        autoWait: true
    });

opaTest("Enter Description", function (Given, When, Then) {
            // Arrangements
            //Given.iStartMyApp();

            //Actions
            When.onTheActivitySetPage.fillDescription();
        });

fillDescription: function () {
                        return this.waitFor({
                            id:"activityFormDescription",
                            //controlType: "sap.m.TextArea",
                            actions: new EnterText({                            
                                text: "Testing in Description"
                            }),
                            success: function() {
                                Opa5.assert.ok(true, "Testing in Description");
                            },
                            errorMessage: "There was no Input"
                        });
                    },

查看文件ID ::

<TextArea id="activityFormDescription" value="{default>/0/Description}" change="handleChange"></TextArea>

1 个答案:

答案 0 :(得分:1)

尝试将viewName参数传递给waitFor函数。

fillDescription: function () {
    return this.waitFor({
        id:"activityFormDescription",
        viewName : "test",
        actions: new EnterText({                            
            text: "Testing in Description"
        }),
        success: function() {
            Opa5.assert.ok(true, "Testing in Description");
        },
        errorMessage: "There was no Input"
    });
},