zoukankan      html  css  js  c++  java
  • 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查找选择列表控件元素同样容易。

  • 相关阅读:
    scla-基础-函数-元组(0)
    scala-基础-映射(1)
    Scala-基础-数组(1)
    Scala-基础-函数(2)
    Scala-基础-函数(1)
    Scala-基础-流程控制语句
    Scala-基础-运算符
    机器猫工作笔记(持续更新中...)
    收集的URL
    苹果审核指南(中文)
  • 原文地址:https://www.cnblogs.com/c-x-a/p/7268838.html
Copyright © 2011-2022 走看看