2017-07-27 7 views
0

要素が存在するかどうかをチェックすると、要素が存在しないことを確認してジャスミンタイムアウトを取得するとコードが正常に動作します。要素のチェック中にジャスミンタイムアウトエラーが発生していません

var fee = $$('[ng-if="paymentDetails.responseObject[0].fee_amount > 0"]'); 
expect(fee.isPresent()).toBe(false); 

エラーが

Error: Timeout - Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL. 

スタックmessage-: エラー:タイムアウト - 非同期コールバックはjasmine.DEFAULT_TIMEOUT_INTERVALで指定されたタイムアウト内で呼び出されませんでしたが。 スタック: OnTimeoutパスで(timers.js:14:386)tryOnTimeoutで (timers.js:250:5)Timer.listOnTimeoutで (timers.js:214:5)config.jsのファイルの

私は私がまだタイムアウトを取得 browser.sleep(5000)browser.waitforAngular()を挿入してみました60secs

exports.config = { 
seleniumAddress: 'http://localhost:4444/wd/hub', 
multiCapabilities: [ 
    { 
     browserName: 'chrome', 
     shardTestFiles: true, 
     maxInstances: 1, 
     chromeOptions: { 
      args: [ 
       '--disable-infobars', 
       '--disable-extensions', 
       'verbose', 
       'log-path=./reports/chromedriver.log' 
      ], 
      prefs: { 
       'profile.password_manager_enabled': false, 
       'credentials_enable_service': false, 
       'password_manager_enabled': false 
      } 
     } 
    }, 
    { 
     browserName: 'internet explorer', 
     platform: 'ANY', 
     version: '11' 
    } 
    ], 
    framework: 'jasmine2', 
     suites: { 
     em2_login: ['e2e/tests/login/login.spec.js'] 
     } 
     useAllAngular2AppRoots: 'true', 
     allScriptsTimeout: 60000, 
     getPageTimeout: 60000, 

     jasmineNodeOpts: { 
     showColors: true, 
     displayStacktrace: true, 
     displaySpecDuration: true, 
     defaultTimeoutInterval: 60000, 
     disableChecks: true 
     }, 
     params: { 
     siteUrl: '' 
     }, 
     onPrepare: function() { 

     jasmine.DEFAULT_TIMEOUT_INTERVAL = 60000; 
     }, 
     }, 

ためにジャスミンのタイムアウトを設定ahve。ここで

が存在状態 -

<tbody> 
<!-- ngRepeat: lineItem in paymentDetails.responseObject[0].schedules[0].schedule_line_items track by $index --> 
<tr class="ng-scope" ng-repeat="lineItem in paymentDetails.responseObject[0].schedules[0].schedule_line_items track by $index"> 
<td class="ng-binding">Jul 27, 2017</td> 
<td> 
<td class="ng-binding">$45.00</td> 
<!-- ngIf: paymentDetails.responseObject[0].fee_amount > 0 --> 
<td class="ng-binding ng-scope" ng-if="paymentDetails.responseObject[0].fee_amount > 0">$0.90</td> 
<!-- end ngIf: paymentDetails.responseObject[0].fee_amount > 0 --> 
<td> 
<td class="" ng-switch="" on="lineItem.statusString" ng-show="lineItem.statusString" style=""> 
<td class="ng-binding ng-hide" ng-show="!lineItem.statusString" ng-bind-html="receiptTemplate.ready" style="">Ready</td> 
<td class="ng-binding" ng-show="lineItem.authorizationString" ng-bind-html="lineItem.authorizationString" style="">53433 Bogus Gateway: Forced success</td> 
<td class="ng-hide" ng-show="!lineItem.authorizationString" style=""/> 
<td> 
</tr> 

を持つ要素のためのHTMLコードで誰もがこれで私を助けてくださいことはできますか?

+0

完全な 'conf.js'ファイルを投稿できますか?ありがとう! – demouser123

+0

完全なconf.jsファイルを投稿しました。 – Smitha

答えて

0

このコードは私にとって役に立ちました。

var fee = $$('[ng-if="paymentDetails.responseObject[0].fee_amount > 0"]').get(0); 
expect(fee.isPresent()).toBe(false); 
関連する問題