配置文件未导出配置对象,加载配置文件失败。量角器错误

时间:2016-02-25 11:25:21

标签: jasmine protractor

在运行命令' Protractor conf.js'我收到错误加载配置文件失败。我无法纠正它。下面是配置文件和测试用例文件代码。

conf.js:

describe('LockTest', function() {
  it('LockTheScenarioTest', function() {
  var reportsTest = element(by.repeater('row in BaseCollection').row(0));
   reportsTest.element(by.id('22090')).click();
   reportsTest.element(by.id('22090')).element(by.xpath('following-sibling::ul')).click();
   browser.sleep(4000);
    browser.waitForAngular();
    element(by.buttonText('Ok')).click();
   expect(element(by.binding('signInName')).getText()).
        toEqual('Pratham Nagabhushan');
   });
});

待办事项-spec.js

private SpannableString addClickablePart(String string) {


        string = string.replaceAll("\\n"," \n ");

        string += " ";
        SpannableString ss = new SpannableString(string);
        String[] words = string.split(" ");
        for (final String word : words) {


            if (CommonUtilities.isValidURL(word)) {


                int lastIndex = 0;

                while(lastIndex != -1){

                    lastIndex = string.indexOf(word+" ",lastIndex);

                    if(lastIndex != -1){
                        ClickableSpan clickableSpan = new ClickableSpan() {
                            @Override
                            public void onClick(View textView) {
                                //use word here to make a decision

                                isRefreshingNecessary = false;

                                Intent mIntent = new Intent(ctx, UserWebsiteActivity.class);
                                mIntent.putExtra("website", word);
                                startActivity(mIntent);
                            }
                        };

                        ss.setSpan(clickableSpan, lastIndex, lastIndex + word.length(),
                                Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);

                        lastIndex += word.length();
                    }
                }


            }
        }

        return ss;
    }

我不确定因为它无法工作。请提出可能问题的建议。

1 个答案:

答案 0 :(得分:1)

当我将您的配置复制粘贴到WebStorm时,它会在browser.driver.manage().window().maximize();行之后抱怨额外的字符:

enter image description here

删除它,你应该很高兴。