简体   繁体   中英

BackstopJS - click and type in inputfield

I try to click in an inputfield. HTML is as follows: 在此处输入图像描述

<input tvv-form-control="" class="form-control ng-pristine ng-untouched ng-scope ng-empty ng-invalid ng-invalid-required ng-valid-tvv-max-text-length" placeholder="myUsername" type="text" name="userId" ng-model="userName" id="userName" required="" tvv-acl-always-show="true">

In my scenario I add following:

    "scenarios": [
        {
          "label": "testLogin",
          "url": "https://test.com/myTest/#/login",
          "referenceUrl": "https://stage.test.com/myTest/#/login",
          "clickSelector": "#userName.form-control.ng-scope.ng-valid-tvv-max-text-length.ng-not-empty.ng-dirty.ng-valid-parse.ng-valid.ng-valid-required.ng-touched",
          "delay": 5000
 } ]

When I run my test I get an error:

TimeoutError: waiting for selector `#userName.form-control.ng-scope.ng-valid-tvv-max-text-length.ng-not-empty.ng-dirty.ng-valid-parse.ng-valid.ng-valid-required.ng-touched` failed: timeout 30000ms exceeded

Sosmeone who can tell me what I'am doing wrong here?

Anyways, I got it to work by: "selector": "#userName"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM