Magento功能测试框架

时间:2019-02-26 12:17:27

标签: magento testing automation functional-testing magento-2.3

我尝试在运行getting started tutorial的情况下安装Magento功能测试框架

vendor/bin/mftf build:project 

我收到此错误

  

PHP警告:require_once(/ var / www / html / magento2):无法打开流:在第21行的/ var / www / html / magento2 / vendor / bin / mftf中没有此类文件或目录

     

PHP致命错误:require_once():无法在第21行的/ var / www / html / magento2 / vendor / bin / mftf中打开所需的''(include_path ='。:/ usr / share / php')

vendor / bin / mftf.php代码

#!/usr/bin/env php


<?
 php 
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
if (PHP_SAPI !== 'cli') {
    echo 'bin/mftf must be run as a CLI application';
    exit(1);

}

$autoloadPath = realpath(__DIR__ . '/../../../autoload.php'); 
$testBootstrapPath = realpath(__DIR__ . '/../dev/tests/functional/standalone_bootstrap.php'); 

try {
    if (file_exists($autoloadPath)) {
        require_once $autoloadPath;
    } else {
        require_once $testBootstrapPath;
        //require_once ( 'db/config.php');
       // require_once __DIR__ . '/vendor/bin/mftf';

    }  
} catch (\Exception $e) {
    echo 'Autoload error: ' . $e->getMessage();
    exit(1);
}    


try {
    $application = new Symfony\Component\Console\Application();
    $application->setName('Magento Functional Testing Framework CLI');
    $application->setVersion('2.3.8');
    /** @var \Magento\FunctionalTestingFramework\Console\CommandListInterface $commandList */
    $commandList = new \Magento\FunctionalTestingFramework\Console\CommandList;
    foreach ($commandList->getCommands() as $command) {
        $application->add($command);
        }
        $application->run();
    } catch (\Exception $e) {
        while ($e) {      
            echo $e->getMessage();
            echo $e->getTraceAsString();
        echo "\n\n";
        $e = $e->getPrevious();
    }
    exit(1);
}

0 个答案:

没有答案