CasperJS断言
生活随笔
收集整理的這篇文章主要介紹了
CasperJS断言
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
特征
CasperJS具有一系列特征。 它具有一些列功能與斷言,都是你期望一個好的測試API所具有的,包括:
* assertTextExists (文本存在斷言)
* assertTitle (標題斷言)
* assertHttpStatus (HTTP狀態斷言)
* assertDoesntExist (不存在斷言)
* assertUrlMatch (Url匹配斷言)
this.test.assertExists(
{type: 'xpath', path: '//input[@id="FullName"]' },
'the element exists'
); this.test.assertExists(
{type: 'xpath', path: '//input[@id="Company"]' },
'the element exists'
); this.test.assertExists(
{type: 'xpath', path: '//input[@id="Email"]' },
'the element exists'
); this.test.assertExists(
{type: 'xpath', path: '//input[@id="Password"]' },
'the element exists'
); this.test.assertExists(
{type: 'xpath', path: '//input[@id="PromoCode"]' },
'the element exists'
);
在上面的五個斷言中,我查找了五個輸入域控件,它們的ID分別是‘FullName’, ‘Company’, ‘Email’, ‘Password’ 和‘PromoCode’。用XPath查找選擇列表控件元素同樣容易。
總結
以上是生活随笔為你收集整理的CasperJS断言的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: java代码块执行顺序
- 下一篇: 十图详解tensorflow数据读取机制