em = $container->get('doctrine')->getManager(); } /** * {@inheritdoc} */ public function configure(): void { $this->setName('prometeo:test:selenium2katalon'); $this->addArgument( 'seleniumfile', InputArgument::REQUIRED, 'Selenium File in SIDE format' ) ; $this->addArgument( 'katalonfile', InputArgument::OPTIONAL, 'Katalon File in HTML format' ); } /** * {@inheritdoc} */ public function execute(InputInterface $input, OutputInterface $output): void { $seleniumfile=$input->getArgument('seleniumfile'); if ($input->getArgument('prefix')) { $katalonfile=$input->getArgument('katalonfile'); }else{ $katalonfile=$seleniumfile.'.html'; } $selenium=file_get_contents($seleniumfile); $seleniumobj=json_decode($selenium,true); $header=" ".$seleniumobj['name']." "; $body=''; foreach($seleniumobj['tests'] as $test){ $body.=""; foreach($test['commands'] as $command){ $body.=""; } $body.="
".$test['name']."
".$command['command']."".$command['target'].""; foreach($command['targets'] as $target){ $body.=""; } $body.=''.$command['value']."
"; } $body=''; file_put_contents($katalonfile,$header.$body); echo "Conversion finalizada"; } }