4

在 MTAF 中运行样本测试时,我们遇到了更多问题。

我已经按照 MTAF 文档完成了所有基本安装设置。

当我尝试运行示例测试时,在 Netbeans 中发现了以下问题。

1) Firefox 未运行,尝试在 Netbeans 6.9.1 中运行测试时。

在此处输入图像描述

phpunit.xml

<?xml version="1.0" encoding="UTF-8"?>
<phpunit backupGlobals="true"
         backupStaticAttributes="false"
         bootstrap="bootstrap.php"
         cacheTokens="true"
         colors="true"
         convertErrorsToExceptions="true"
         convertNoticesToExceptions="true"
         convertWarningsToExceptions="true"
         forceCoversAnnotation="false"
         mapTestClassNameToCoveredClassName="false"
         printerClass="PHPUnit_TextUI_ResultPrinter"
         processIsolation="false"
         stopOnError="false"
         stopOnFailure="false"
         stopOnIncomplete="false"
         stopOnSkipped="false"
         testSuiteLoaderClass="PHPUnit_Runner_StandardTestSuiteLoader"
         strict="false"
         verbose="true">
    <testsuites>
        <testsuite name="All Tests">
            <directory suffix="Test.php">testsuite/Core/Mage</directory>
        </testsuite>
    </testsuites>
    <logging>
        <log type="coverage-html" target="./tmp/report" charset="UTF-8" yui="true" highlight="false"
         lowUpperBound="35" highLowerBound="70"/>
        <log type="coverage-xml" target="./tmp/coverage.xml"/>
        <log type="graphviz" target="./tmp/logfile.dot"/>
        <log type="json" target="./tmp/logfile.json"/>
        <log type="metrics-xml" target="./tmp/metrics.xml"/>
        <log type="plain" target="./tmp/logfile.txt"/>
        <log type="pmd-xml" target="./tmp/pmd.xml" cpdMinLines="5" cpdMinMatches="70"/>
        <log type="tap" target="./tmp/logfile.tap" logIncompleteSkipped="true"/>
        <log type="junit" target="./tmp/logfile.xml" logIncompleteSkipped="false"/>
        <log type="testdox-html" target="./tmp/testdox.html"/>
        <log type="testdox-text" target="./tmp/testdox.txt"/>
    </logging>
</phpunit>

配置.yml

browsers:
    googlechrome: &googlechrome
         name: 'Google Chrome'
         browser: '*googlechrome'
         host: 'localhost'
         port: 4444
         timeout: 60
    firefox: &firefox
         name: 'Firefox'
         browser: '*chrome'
         host: 'localhost'
         port: 4444
         timeout: 60
    iexplorer: &iexplorer
         name: 'Internet Explorer'
         browser: '*iexplore'
         host: 'localhost'
         port: 4444
         timeout: 60
    default: *firefox
framework:
    fixture_base_path: 'fixture'
    testsuite_base_path: 'testsuite'
    #work only if tests are run for single browser
    shareSession: true
    coverageScriptUrl: ''
    #captureScreenshotOnFailure works only for browsers that support it: Firefox/Chrome, IE with snapsIE tool
    captureScreenshotOnFailure: true
    saveHtmlPageOnFailure: false
    load_all_uimaps: true
    load_all_data: true
    cache:
        frontend:
            name: 'core'
            options:
                caching: false
                cache_id_prefix: 'selenium_'
                automatic_serialization: true
        backend:
            name: 'file'
            options:
                cache_dir: 'var/cache'
applications:
    mage: &mage
        fallbackOrderFixture: 'default'
        fallbackOrderHelper: 'Core'
        areas:
            admin:
                url: 'http://www.localhost.com/magento/index.php/admin/'
                base_page_uimap: 'log_in_to_admin'
                uimap_path: 'admin'
                login: 'admin'
                password: 'admin123'
            frontend:
                url: 'http://www.localhost.com/magento/index.php'
                base_page_uimap: 'home_page'
    default: *mage

2) 我需要在我的系统中添加/修改任何其他代码吗?

3)当我尝试单击运行下的测试项目时,它似乎是错误的,如下面的屏幕截图。

在此处输入图像描述

文件夹结构:

我使用了像 GITHUB 一样的测试文件夹结构。

但是 MTAF 文件给出了与参考文件不同的文件夹结构。

我可以在 GIT 和参考链接中看到不同的文件夹结构。

在测试框架工作中使用哪个正确的文件夹结构?

任何帮助我的赞赏。

4

2 回答 2

4

我使用了更新版本的 NetBeans(NetBeans IDE 7.2.1)。我解决了这个问题。

于 2013-11-13T06:05:18.220 回答
0

GIT 中的文件夹结构适用于 MTAF。只需在所需文件夹下的测试套件中添加测试用例即可。

于 2014-06-20T10:57:38.403 回答