Skip navigation links
com.auxiliary.testcase.templet

Class AbstractPresetCaseTemplet

    • Constructor Detail

      • AbstractPresetCaseTemplet

        public AbstractPresetCaseTemplet(File xmlTempletFile)
        构造对象,读取xml文件模板类
        Parameters:
        xmlTempletFile - xml模板文件类对象
      • AbstractPresetCaseTemplet

        protected AbstractPresetCaseTemplet(String fileName)
        构造对象,根据资源文件夹中的默认模板文件名,对模板文件进行读取
        Parameters:
        fileName - 文件名称
    • Method Detail

      • getTempletContent

        public List<String> getTempletContent(LabelType labelType,
                                              String groupName,
                                              String... ids)
        该方法用于返回用指定例组中的指定id对应的内容
        Parameters:
        labelType - 预设用例模板内容枚举
        groupName - 用例组名称
        ids - 用例id组
        Returns:
        获取到的内容集合
        Since:
        autest 4.0.0
      • getContentList

        protected List<String> getContentList(String groupName,
                                              String labelName,
                                              String otherXpath,
                                              String attName,
                                              String... ids)
        该方法用于读取模板中的指定内容,并将所有需要读取的内容组成集合进行返回
        Parameters:
        groupName - 用例组名称
        labelName - 读取的标签
        otherXpath - 需要拼接的xpath内容
        attName - 读取的属性名称
        ids - 用例id组
        Returns:
        内容集合
        Since:
        autest 4.0.0
      • getAttributeValue

        protected List<String> getAttributeValue(String xptah,
                                                 String attribute)
        该方法用于根据指定的xptah内容,查找并返回元素指定属性下的内容集合
        Parameters:
        xptah - 查找元素的xpath
        attribute - 元素对应的属性
        Returns:
        元素指定属性的内容集合
        Since:
        autest 4.0.0
      • getXpathFormat

        protected String getXpathFormat(String groupName,
                                        String labelName,
                                        String id,
                                        String lowerLabel)
        该方法用于生成查找元素的xpath信息
        Parameters:
        groupName - 用例组名称
        labelName - 标签名称
        id - 标签id
        lowerLabel - 下级元素标签
        Returns:
        格式化后的xpath
        Since:
        autest 4.0.0
      • createCaseDataList

        protected List<CaseData> createCaseDataList(AbstractPresetCaseTemplet templetClass,
                                                    Map<LabelType,List<Entry<String,String[]>>> allContentMap)
        该方法用于生成测试用例集合
        Parameters:
        templetClass - 测试用例模板读取类
        allContentMap - 需要读取的测试用例集合
        Returns:
        生成的测试用例信息集合
        Since:
        autest 4.0.0
      • addContent

        protected Map<LabelType,List<Entry<String,String[]>>> addContent(Map<LabelType,List<Entry<String,String[]>>> allContentMap,
                                                                         LabelType labelType,
                                                                         List<Entry<String,String[]>> contentList)
        该方法用于将需要添加的测试用例内容,附加到内容map集合中,并返回该集合进行返回
        Parameters:
        allContentMap - 所有测试用例内容集合
        labelType - 标签枚举
        contentList - 内容集合
        Returns:
        附加内容后的map集合
        Since:
        autest 4.0.0

Copyright © 2024. All rights reserved.