From 5739ba07c853408c3f6cddf553f9699c78e5fb01 Mon Sep 17 00:00:00 2001 From: Narek Vardzelyan Date: Wed, 4 Nov 2015 17:33:00 +0400 Subject: [PATCH 01/29] Added main index.php file and composer.json file. --- composer.json | 3 +++ index.php | 2 ++ 2 files changed, 5 insertions(+) create mode 100644 composer.json create mode 100644 index.php diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..23eba36 --- /dev/null +++ b/composer.json @@ -0,0 +1,3 @@ +{ + "name": "narek_vardzelyan" +} diff --git a/index.php b/index.php new file mode 100644 index 0000000..a4abe2d --- /dev/null +++ b/index.php @@ -0,0 +1,2 @@ + Date: Wed, 4 Nov 2015 19:04:23 +0400 Subject: [PATCH 02/29] Added SeleniumOneToSeleniumToConverter class with it's methods and SeleniumTwoToBehatMinkFormatter class, but it's still incomplete. --- index.php | 77 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) diff --git a/index.php b/index.php index a4abe2d..9da3799 100644 --- a/index.php +++ b/index.php @@ -1,2 +1,79 @@ commandsTableXMLIterator = new SimpleXMLElementIterator($fileContent); +// var_dump($this->commandsTable); + } + + protected function getCommandsListTable() + { + while($this->commandsTableXMLIterator->current() !== null) { + if ($this->commandsTableXMLIterator->current()->getName() === 'table') { + return $this->commandsTableXMLIterator->current(); + } + $this->commandsTableXMLIterator->current()->next(); + } + return null; + } + + protected function getCommandsList() + { + $commandsListTableXMLIterator = $this->getCommandsListTable(); + $commandsList = []; + while ($commandsListTableXMLIterator->current() !== null) { + if ($commandsListTableXMLIterator->current()->getName() === 'tr') { + $childrens = $commandsListTableXMLIterator->current()->getChildren(); + $command = $childrens->__toString(); + $childrens->next(); + $target = $childrens->__toString(); + $childrens->next(); + $value = $childrens->__toString(); + $commandsList[] = [ + $command, + $target, + $value + ]; + } + } + return $commandsList; + } + + public function convert() + { + $commandsList = $this->getCommandsList(); + $commandsCount = count($CommandsList); + $commandsListInSeleniumTwo = []; + for ($i = 0; $i < $commandsCount; ++$i) { + $commandsListInSeleniumTwo[] = $this->appropriateCommandForSeleniumTwo($commandsList[$i]); + } + } + + protected function appropriateCommandForSeleniumTwo($command) + { + + } +} + +class SeleniumTwoToBehatMinkFormatter +{ + public function __construct() + { + + } + + public function format() + { + + } +} + +$fileOne = '/Users/narek_vardzelyan/Downloads/10 hour long Training Session is created.xhtml'; +$fileTwo = '/Users/narek_vardzelyan/Documents/search_wikipedia_html_testcase.html'; + +$converter = new SeleniumOneToSeleniumTwoConverter($fileOne); \ No newline at end of file From 425ebafc9565e6ace547007ad4e92b6db83bde68 Mon Sep 17 00:00:00 2001 From: Narek Vardzelyan Date: Thu, 5 Nov 2015 17:06:09 +0400 Subject: [PATCH 03/29] Added method getTestName to SeleniumOneToSeleniumTwoConverter class and writed some code for SeleniumTwoToBehatMinkFormatter's constructor and format method. --- index.php | 48 ++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 40 insertions(+), 8 deletions(-) diff --git a/index.php b/index.php index 9da3799..d5b3f74 100644 --- a/index.php +++ b/index.php @@ -2,13 +2,21 @@ class SeleniumOneToSeleniumTwoConverter { + protected $fileContent; protected $commandsTableXMLIterator; public function __construct($filename) { - $fileContent = file_get_contents($filename); - $this->commandsTableXMLIterator = new SimpleXMLElementIterator($fileContent); -// var_dump($this->commandsTable); + $this->fileContent = file_get_contents($filename); + $this->commandsTableXMLIterator = new SimpleXMLIterator($this->fileContent); + } + + public function getTestName() + { + $domNode = new DOMDocument('1.0', 'UTF-8'); + $domNode->loadXML($this->fileContent); + $title = $domNode->getElementsByTagName('title')[0]; + return $title->nodeValue; } protected function getCommandsListTable() @@ -47,7 +55,7 @@ protected function getCommandsList() public function convert() { $commandsList = $this->getCommandsList(); - $commandsCount = count($CommandsList); + $commandsCount = count($commandsList); $commandsListInSeleniumTwo = []; for ($i = 0; $i < $commandsCount; ++$i) { $commandsListInSeleniumTwo[] = $this->appropriateCommandForSeleniumTwo($commandsList[$i]); @@ -58,22 +66,46 @@ protected function appropriateCommandForSeleniumTwo($command) { } + + protected function open() + { + + } } class SeleniumTwoToBehatMinkFormatter { - public function __construct() + protected $contextFileContent; + protected $converter; + + public function __construct($fileName) { - + $this->contextFileContent = <<converter = new SeleniumOneToSeleniumTwoConverter($fileName); } public function format() { - + $testName = str_replace(' ', '', ucwords( + $this->converter->getTestName() + )); + $this->contextFileContent .= "public function {$testName}()\n{"; + var_dump($this->contextFileContent); } } $fileOne = '/Users/narek_vardzelyan/Downloads/10 hour long Training Session is created.xhtml'; $fileTwo = '/Users/narek_vardzelyan/Documents/search_wikipedia_html_testcase.html'; -$converter = new SeleniumOneToSeleniumTwoConverter($fileOne); \ No newline at end of file +$formatter = new SeleniumTwoToBehatMinkFormatter($fileOne); +$formatter->format(); \ No newline at end of file From b1c64665473ae9ab6e69326a2f5a29e488aa8bfb Mon Sep 17 00:00:00 2001 From: Narek Vardzelyan Date: Thu, 5 Nov 2015 20:47:20 +0400 Subject: [PATCH 04/29] Changed SeleniumTwoToBehatMinkFormatter's constructor. --- index.php | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/index.php b/index.php index d5b3f74..763c584 100644 --- a/index.php +++ b/index.php @@ -76,6 +76,7 @@ protected function open() class SeleniumTwoToBehatMinkFormatter { protected $contextFileContent; + protected $featureFileContent; protected $converter; public function __construct($fileName) @@ -90,6 +91,27 @@ public function __construct($fileName) */ class FeatureContext extends MinkContext { + /** + * Initializes context. + * Every scenario gets it's own context object. + * + * @param array \$parameters context parameters (set them up through behat.yml) + */ + public function __construct(array \$parameters) + { + // Initialize your context here + } + +FILE; + $this->featureFileContent = <<converter = new SeleniumOneToSeleniumTwoConverter($fileName); } From 7c133f9178e453187392414c49e2f1c0015769bf Mon Sep 17 00:00:00 2001 From: narek Date: Fri, 6 Nov 2015 08:31:29 +0400 Subject: [PATCH 05/29] Changed architechture, now formatting will be done without converting into Selenium Two. --- index.php | 238 +++++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 180 insertions(+), 58 deletions(-) diff --git a/index.php b/index.php index 763c584..52ed853 100644 --- a/index.php +++ b/index.php @@ -1,6 +1,158 @@ fileContent = file_get_contents($filename); +// $this->commandsTableXMLIterator = new SimpleXMLIterator($this->fileContent); +// } +// +// public function getTestName() +// { +// $domNode = new DOMDocument('1.0', 'UTF-8'); +// $domNode->loadXML($this->fileContent); +// $title = $domNode->getElementsByTagName('title')[0]; +// return $title->nodeValue; +// } +// +// protected function getCommandsListTable() +// { +// while($this->commandsTableXMLIterator->current() !== null) { +// if ($this->commandsTableXMLIterator->current()->getName() === 'table') { +// return $this->commandsTableXMLIterator->current(); +// } +// $this->commandsTableXMLIterator->current()->next(); +// } +// return null; +// } +// +// protected function getCommandsList() +// { +// $commandsListTableXMLIterator = $this->getCommandsListTable(); +// $commandsList = []; +// while ($commandsListTableXMLIterator->current() !== null) { +// if ($commandsListTableXMLIterator->current()->getName() === 'tr') { +// $childrens = $commandsListTableXMLIterator->current()->getChildren(); +// $command = $childrens->__toString(); +// $childrens->next(); +// $target = $childrens->__toString(); +// $childrens->next(); +// $value = $childrens->__toString(); +// $commandsList[] = [ +// $command, +// $target, +// $value +// ]; +// } +// } +// return $commandsList; +// } +// +// public function convert() +// { +// $commandsList = $this->getCommandsList(); +// $commandsCount = count($commandsList); +// $commandsListInSeleniumTwo = []; +// for ($i = 0; $i < $commandsCount; ++$i) { +// $commandsListInSeleniumTwo[] = $this->appropriateCommandForSeleniumTwo($commandsList[$i]); +// } +// } +// +// protected function appropriateCommandForSeleniumTwo($command) +// { +// switch($command[0]) { +// case 'open' : +// return [ +// 'get', +// $command[1] +// ]; +// break; +// case 'type' : +// return [ +// 'sendKeys', +// $command[1], +// $command[2] +// ]; +// break; +// case 'clickAndWait': +// return [ +// 'click', +// '//button' +// ]; +// break; +// case 'select' : +// return [ +// "findElement(ById('{$command[1]}'))", +// $command[2] +// ]; +// break; +// } +// } +// +// protected function open() +// { +// +// } +//} +// +//class SeleniumTwoToBehatMinkFormatter +//{ +// protected $contextFileContent; +// protected $featureFileContent; +// protected $converter; +// +// public function __construct($fileName) +// { +// $this->contextFileContent = <<featureFileContent = <<converter = new SeleniumOneToSeleniumTwoConverter($fileName); +// } +// +// public function format() +// { +// $testName = str_replace(' ', '', ucwords( +// $this->converter->getTestName() +// )); +// $this->contextFileContent .= "\n public function {$testName}()\n {"; +// var_dump($this->contextFileContent); +// } +//} + +class SeleniumOneToBehatMinkFormatter { protected $fileContent; protected $commandsTableXMLIterator; @@ -58,75 +210,45 @@ public function convert() $commandsCount = count($commandsList); $commandsListInSeleniumTwo = []; for ($i = 0; $i < $commandsCount; ++$i) { - $commandsListInSeleniumTwo[] = $this->appropriateCommandForSeleniumTwo($commandsList[$i]); + $commandsListInSeleniumTwo[] = $this->toBehatMink($commandsList[$i]); } } - protected function appropriateCommandForSeleniumTwo($command) - { - - } - - protected function open() + protected function toBehatMink($command) { - - } -} + $minkCommands = ''; + try { + switch($command[0]) { + case 'open': + + break; + case 'type': -class SeleniumTwoToBehatMinkFormatter -{ - protected $contextFileContent; - protected $featureFileContent; - protected $converter; - - public function __construct($fileName) - { - $this->contextFileContent = <<featureFileContent = <<converter = new SeleniumOneToSeleniumTwoConverter($fileName); - } - - public function format() - { - $testName = str_replace(' ', '', ucwords( - $this->converter->getTestName() - )); - $this->contextFileContent .= "public function {$testName}()\n{"; - var_dump($this->contextFileContent); + break; + default: + throw new Exception('There are not command with name '.$command[0]); + } + } catch (Exception $ex) { + die($e->getMessage()); + } + + } } -$fileOne = '/Users/narek_vardzelyan/Downloads/10 hour long Training Session is created.xhtml'; +$fileOne = '/home/narek/Downloads/10 hour long Training Session is created.xhtml'; $fileTwo = '/Users/narek_vardzelyan/Documents/search_wikipedia_html_testcase.html'; $formatter = new SeleniumTwoToBehatMinkFormatter($fileOne); From 1d9939a35dfa684eec9793b4681dfbc1f40667e9 Mon Sep 17 00:00:00 2001 From: Narek Vardzelyan Date: Fri, 6 Nov 2015 19:02:55 +0400 Subject: [PATCH 06/29] Added method toBehatMink, it's for changeing every SeleniumOne command to Behat Mink method, it wroten by switch but in the feuture I'll change it to factory. --- index.php | 231 +++++++++++++++--------------------------------------- 1 file changed, 62 insertions(+), 169 deletions(-) diff --git a/index.php b/index.php index 52ed853..c190157 100644 --- a/index.php +++ b/index.php @@ -1,166 +1,48 @@ fileContent = file_get_contents($filename); -// $this->commandsTableXMLIterator = new SimpleXMLIterator($this->fileContent); -// } -// -// public function getTestName() -// { -// $domNode = new DOMDocument('1.0', 'UTF-8'); -// $domNode->loadXML($this->fileContent); -// $title = $domNode->getElementsByTagName('title')[0]; -// return $title->nodeValue; -// } -// -// protected function getCommandsListTable() -// { -// while($this->commandsTableXMLIterator->current() !== null) { -// if ($this->commandsTableXMLIterator->current()->getName() === 'table') { -// return $this->commandsTableXMLIterator->current(); -// } -// $this->commandsTableXMLIterator->current()->next(); -// } -// return null; -// } -// -// protected function getCommandsList() -// { -// $commandsListTableXMLIterator = $this->getCommandsListTable(); -// $commandsList = []; -// while ($commandsListTableXMLIterator->current() !== null) { -// if ($commandsListTableXMLIterator->current()->getName() === 'tr') { -// $childrens = $commandsListTableXMLIterator->current()->getChildren(); -// $command = $childrens->__toString(); -// $childrens->next(); -// $target = $childrens->__toString(); -// $childrens->next(); -// $value = $childrens->__toString(); -// $commandsList[] = [ -// $command, -// $target, -// $value -// ]; -// } -// } -// return $commandsList; -// } -// -// public function convert() -// { -// $commandsList = $this->getCommandsList(); -// $commandsCount = count($commandsList); -// $commandsListInSeleniumTwo = []; -// for ($i = 0; $i < $commandsCount; ++$i) { -// $commandsListInSeleniumTwo[] = $this->appropriateCommandForSeleniumTwo($commandsList[$i]); -// } -// } -// -// protected function appropriateCommandForSeleniumTwo($command) -// { -// switch($command[0]) { -// case 'open' : -// return [ -// 'get', -// $command[1] -// ]; -// break; -// case 'type' : -// return [ -// 'sendKeys', -// $command[1], -// $command[2] -// ]; -// break; -// case 'clickAndWait': -// return [ -// 'click', -// '//button' -// ]; -// break; -// case 'select' : -// return [ -// "findElement(ById('{$command[1]}'))", -// $command[2] -// ]; -// break; -// } -// } -// -// protected function open() -// { -// -// } -//} -// -//class SeleniumTwoToBehatMinkFormatter -//{ -// protected $contextFileContent; -// protected $featureFileContent; -// protected $converter; -// -// public function __construct($fileName) -// { -// $this->contextFileContent = <<featureFileContent = <<converter = new SeleniumOneToSeleniumTwoConverter($fileName); -// } -// -// public function format() -// { -// $testName = str_replace(' ', '', ucwords( -// $this->converter->getTestName() -// )); -// $this->contextFileContent .= "\n public function {$testName}()\n {"; -// var_dump($this->contextFileContent); -// } -//} - class SeleniumOneToBehatMinkFormatter { protected $fileContent; - protected $commandsTableXMLIterator; + protected $testCaseXMLIterator; + protected $contextFileContent; + protected $featureFileContent; public function __construct($filename) { $this->fileContent = file_get_contents($filename); - $this->commandsTableXMLIterator = new SimpleXMLIterator($this->fileContent); + $this->testCaseXMLDOM = new DOMDocument($this->fileContent); + $this->contextFileContent = <<featureFileContent = <<commandsTableXMLIterator->current() !== null) { - if ($this->commandsTableXMLIterator->current()->getName() === 'table') { - return $this->commandsTableXMLIterator->current(); - } - $this->commandsTableXMLIterator->current()->next(); + $elements = $this->testCaseXMLDOM->getElementsByTagName(); + if (count($elements) !== 0) { + return $elements[0]; } return null; } @@ -220,22 +100,23 @@ protected function toBehatMink($command) try { switch($command[0]) { case 'open': - + $minkCommands .= "\t\$this->getSession()->visit({$command[1]});\n"; break; case 'type': - + $minkCommands .= "\t\$this->getSession()->fillFields({$command[1]}, {$command[2]});\n"; break; case 'clickAndWait': - + $minkCommands .= "\t\$this->getSession()->pressButton({$command[1]});\n"; + $minkCommands .= "\t\$this->getSession()->wait();\n"; break; case 'select': - + $minkCommands .= "\t\$this->getSession()->selectOption({$command[1]}, {$command[2]});\n"; break; case 'sendKeys': - + $minkCommands .= "\t\$this->getSession()->fillFields({$command[1]}, {$command[2]});\n"; break; case 'waitForElementPresent': - + $minkCommands .= "\t\$this->getSession()->wait(10000, 'document.getElementById('{$command[1]}')')"; break; default: throw new Exception('There are not command with name '.$command[0]); @@ -243,13 +124,25 @@ protected function toBehatMink($command) } catch (Exception $ex) { die($e->getMessage()); } - - + return $minkCommands; + } + + public function format() + { + $testName = str_replace(' ', '', ucwords( + $this->getTestName() + )); + $this->contextFileContent .= "\n public function {$testName}()\n {"; + $commands = $this->getCommandsList(); + foreach ($commands as $command) { + $this->contextFileContent .= $this->toBehatMink($command); + } + var_dump($this->contextFileContent); } } -$fileOne = '/home/narek/Downloads/10 hour long Training Session is created.xhtml'; +$fileOne = '/Users/narek_vardzelyan/Documents/10 hour long Training Session is created.xhtml'; $fileTwo = '/Users/narek_vardzelyan/Documents/search_wikipedia_html_testcase.html'; -$formatter = new SeleniumTwoToBehatMinkFormatter($fileOne); +$formatter = new SeleniumOneToBehatMinkFormatter($fileOne); $formatter->format(); \ No newline at end of file From 597e57d952587ffd85f64cc84796eb02c80a5bbd Mon Sep 17 00:00:00 2001 From: Narek Vardzelyan Date: Mon, 9 Nov 2015 16:44:56 +0400 Subject: [PATCH 07/29] Created new architecture, with SeleniumFileParser and Commands Factory. --- Commands.php | 76 ++++++++++++++++++++++++++++++++++++++++++ SeleniumFileParser.php | 24 +++++++++++++ composer.json | 3 -- index.php | 4 +-- 4 files changed, 102 insertions(+), 5 deletions(-) create mode 100644 Commands.php create mode 100644 SeleniumFileParser.php delete mode 100644 composer.json diff --git a/Commands.php b/Commands.php new file mode 100644 index 0000000..6136f97 --- /dev/null +++ b/Commands.php @@ -0,0 +1,76 @@ +testCaseXMLDOM->getElementsByTagName(); + $elements = $this->testCaseXMLDOM->getElementsByTagName('table'); if (count($elements) !== 0) { return $elements[0]; } @@ -64,7 +64,7 @@ protected function getCommandsListTable() protected function getCommandsList() { - $commandsListTableXMLIterator = $this->getCommandsListTable(); + $commandsListTableXMLIterator = new SimpleXMLIterator($this->getCommandsListTable()->saveXML()); $commandsList = []; while ($commandsListTableXMLIterator->current() !== null) { if ($commandsListTableXMLIterator->current()->getName() === 'tr') { From 22a1ea5a6763a99c502034127623c0f03dd89ca5 Mon Sep 17 00:00:00 2001 From: Narek Vardzelyan Date: Mon, 9 Nov 2015 19:38:21 +0400 Subject: [PATCH 08/29] Completed class SeleniumFileParser, created new file for class SeleniumRCToBehatMink and deleted unecessary methods for it, added toBehatMink methods content. --- Commands.php | 42 +++++---- SeleniumFileParser.php | 63 +++++++++++-- SeleniumRCToBehatMinkFormatter.php | 67 ++++++++++++++ index.php | 143 +---------------------------- 4 files changed, 149 insertions(+), 166 deletions(-) create mode 100644 SeleniumRCToBehatMinkFormatter.php diff --git a/Commands.php b/Commands.php index 6136f97..0a7f575 100644 --- a/Commands.php +++ b/Commands.php @@ -7,14 +7,14 @@ public function __construct() } - public static function build($type) + public static function build($type, $command) { if ($type == '') { throw new Exception('Invalid command type.'); } else { $className = ucfirst($type); if (class_exists($className)) { - return new $className(); + return new $className($command); } else { throw new Exception('Command type not found.'); } @@ -22,55 +22,65 @@ public static function build($type) } } -interface CommandInterface +abstract class BaseCommand { - public function toBehatMink(); + protected $command; + public function __construct($command) + { + $this->command = $command; + } + abstract public function toBehatMink(); } -class Open implements CommandInterface +class Open extends BaseCommand { public function toBehatMink() { - + return "\t\$this->getSession()->visit({$this->command[1]});\n"; } } -class Type implements CommandInterface +class Type extends BaseCommand { public function toBehatMink() { - + return "\t\$this->getSession()->fillFields({$this->command[1]}, " + . "{$this->command[2]});\n"; } } -class ClickAndWait implements CommandInterface +class ClickAndWait extends BaseCommand { public function toBehatMink() { - + return "\t\$this->getSession()->pressButton({$this->command[1]});\n" + . "\t\$this->getSession()->wait();\n"; } } -class Select implements CommandInterface +class Select extends BaseCommand { public function toBehatMink() { - + return "\t\$this->getSession()->selectOption({$this->commandcommand[1]}, " + . "{$this->commandcommand[2]});\n"; } } -class SendKeys implements CommandInterface +class SendKeys extends BaseCommand { public function toBehatMink() { - + return "\t\$this->getSession()->fillFields({$this->commandcommand[1]}, " + . "{$this->commandcommand[2]});\n"; } } -class WaitForElementPresent implements CommandInterface +class WaitForElementPresent extends BaseCommand { public function toBehatMink() { - + return "\t\$this->getSession()->wait(10000, 'document.getElementById" + . "('{$this->commandcommand[1]}')')"; } } \ No newline at end of file diff --git a/SeleniumFileParser.php b/SeleniumFileParser.php index b925f7b..3fedc60 100644 --- a/SeleniumFileParser.php +++ b/SeleniumFileParser.php @@ -1,24 +1,69 @@ testFileName = $testFileName; + $this->xml = new DOMDocument('1.0', 'UTF-8'); + $this->xml->load($testFileName); + } + + protected function getTestName() + { + $titleElements = $this->xml->getElementsByTagName('title'); + if ($titleElements->length == 0) { + throw new Exception("Wrong Selenium Ide file format.\n Test name absent.\n"); + } + return $titleElements->item(0)->nodeValue; + } + + protected function getBaseUrl() + { + $linkElements = $this->xml->getElementsByTagName('link'); + if ($linkElements->length == 0) { + throw new Exception("Wrong Selenium Ide file format.\n Base url absent.\n"); + } + return $linkElements->item(0)->getAttribute('href'); + } + + protected function getCommandsList() { - + $trElements = $this->xml->getElementsByTagName('tr'); + if ($trElements->length == 0) { + throw new Exception("Wrong Selenium Ide file format.\n Commands list absent.\n"); + } + $commandsList = []; + for ($i = 0; $i < $trElements->length; ++$i) { + $tdElements = $trElements->item($i)->getElementsByTagName('td'); + if ($tdElements->length < 3) { + throw new Exception("Wrong Selenium Ide file format.\n Command isn't full."); + } + $commandName = $tdElements->item(0); + $commandTarget = $tdElements->item(1); + $commandValue = $tdElements->item(2); + $commandsList[] = [ + 'name' => $commandName, + 'target' => $commandTarget, + 'value' => $commandValue + ]; + } + return $commandsList; } public function parse() { - + return [ + 'test_name' => $this->getTestName(), + 'base_url' => $this->getBaseUrl(), + 'commands_list' => $this->getCommandsList() + ]; } } diff --git a/SeleniumRCToBehatMinkFormatter.php b/SeleniumRCToBehatMinkFormatter.php new file mode 100644 index 0000000..e0d3c40 --- /dev/null +++ b/SeleniumRCToBehatMinkFormatter.php @@ -0,0 +1,67 @@ +seleniumFileParser = new SeleniumFileParser($fileName); + $this->minkContext = <<featureFileContent = <<getCommandByName($command); + $this->minkContext .= $commandObj->toBehatMink(); + } + } + + public function format() + { + $parsedXML = $this->seleniumFileParser->parse(); + $this->generate($parsedXML['commands_list']); + } +} diff --git a/index.php b/index.php index b5d02d3..cf3f257 100644 --- a/index.php +++ b/index.php @@ -1,148 +1,9 @@ fileContent = file_get_contents($filename); - $this->testCaseXMLDOM = new DOMDocument($this->fileContent); - $this->contextFileContent = <<featureFileContent = <<loadXML($this->fileContent); - $title = $domNode->getElementsByTagName('title')[0]; - return $title->nodeValue; - } - - protected function getCommandsListTable() - { - $elements = $this->testCaseXMLDOM->getElementsByTagName('table'); - if (count($elements) !== 0) { - return $elements[0]; - } - return null; - } - - protected function getCommandsList() - { - $commandsListTableXMLIterator = new SimpleXMLIterator($this->getCommandsListTable()->saveXML()); - $commandsList = []; - while ($commandsListTableXMLIterator->current() !== null) { - if ($commandsListTableXMLIterator->current()->getName() === 'tr') { - $childrens = $commandsListTableXMLIterator->current()->getChildren(); - $command = $childrens->__toString(); - $childrens->next(); - $target = $childrens->__toString(); - $childrens->next(); - $value = $childrens->__toString(); - $commandsList[] = [ - $command, - $target, - $value - ]; - } - } - return $commandsList; - } - - public function convert() - { - $commandsList = $this->getCommandsList(); - $commandsCount = count($commandsList); - $commandsListInSeleniumTwo = []; - for ($i = 0; $i < $commandsCount; ++$i) { - $commandsListInSeleniumTwo[] = $this->toBehatMink($commandsList[$i]); - } - } - - protected function toBehatMink($command) - { - $minkCommands = ''; - try { - switch($command[0]) { - case 'open': - $minkCommands .= "\t\$this->getSession()->visit({$command[1]});\n"; - break; - case 'type': - $minkCommands .= "\t\$this->getSession()->fillFields({$command[1]}, {$command[2]});\n"; - break; - case 'clickAndWait': - $minkCommands .= "\t\$this->getSession()->pressButton({$command[1]});\n"; - $minkCommands .= "\t\$this->getSession()->wait();\n"; - break; - case 'select': - $minkCommands .= "\t\$this->getSession()->selectOption({$command[1]}, {$command[2]});\n"; - break; - case 'sendKeys': - $minkCommands .= "\t\$this->getSession()->fillFields({$command[1]}, {$command[2]});\n"; - break; - case 'waitForElementPresent': - $minkCommands .= "\t\$this->getSession()->wait(10000, 'document.getElementById('{$command[1]}')')"; - break; - default: - throw new Exception('There are not command with name '.$command[0]); - } - } catch (Exception $ex) { - die($e->getMessage()); - } - return $minkCommands; - } - - public function format() - { - $testName = str_replace(' ', '', ucwords( - $this->getTestName() - )); - $this->contextFileContent .= "\n public function {$testName}()\n {"; - $commands = $this->getCommandsList(); - foreach ($commands as $command) { - $this->contextFileContent .= $this->toBehatMink($command); - } - var_dump($this->contextFileContent); - } -} +require_once 'SeleniumRCToBehatMinkFormatter.php'; $fileOne = '/Users/narek_vardzelyan/Documents/10 hour long Training Session is created.xhtml'; $fileTwo = '/Users/narek_vardzelyan/Documents/search_wikipedia_html_testcase.html'; -$formatter = new SeleniumOneToBehatMinkFormatter($fileOne); +$formatter = new SeleniumRCToBehatMinkFormatter($fileOne); $formatter->format(); \ No newline at end of file From c044962411200c28a3182eb7560db9c00f453da9 Mon Sep 17 00:00:00 2001 From: Narek Vardzelyan Date: Mon, 9 Nov 2015 20:17:07 +0400 Subject: [PATCH 09/29] Changed SeleniumRCToMinkFormatter class and BehtaFileGenerataor class --- BehatFilesGenerator.php | 86 ++++++++++++++++++++++++++++++ SeleniumRCToBehatMinkFormatter.php | 57 +++++--------------- index.php | 6 +-- 3 files changed, 102 insertions(+), 47 deletions(-) create mode 100644 BehatFilesGenerator.php diff --git a/BehatFilesGenerator.php b/BehatFilesGenerator.php new file mode 100644 index 0000000..b01b557 --- /dev/null +++ b/BehatFilesGenerator.php @@ -0,0 +1,86 @@ +seleniumFilePrser = new SeleniumFileParser($filePath); + $this->seleniumIdeParsedXML = $this->seleniumFileParser->parse(); + $this->seleniumRCToBehatMinkFormatter = new SeleniumRCToBehatMinkFormatter( + $this->seleniumIdeParsedXML + ); + } + + protected function getTestMethodName() + { + + } + + protected function getTestMethodContent() + { + + } + + protected function getTestFeatureFileName() + { + + } + + protected function generateContextFile() + { + $fileName = 'FeatureContext.php'; + $data = <<seleniumRCToBehatMinkFormatter->format()} +FILE; + file_put_contents($fileName, $data); + } + + protected function generateFeatureFile() + { + $fileName = ; + $data = <<generateContextFile(); + $this->generateFeatureFile(); + } +} diff --git a/SeleniumRCToBehatMinkFormatter.php b/SeleniumRCToBehatMinkFormatter.php index e0d3c40..18291cf 100644 --- a/SeleniumRCToBehatMinkFormatter.php +++ b/SeleniumRCToBehatMinkFormatter.php @@ -1,49 +1,21 @@ seleniumFileParser = new SeleniumFileParser($fileName); - $this->minkContext = <<featureFileContent = <<seleniumIdeparsedXML = $seleniumIdeparsedXML; + $this->minkContext = ''; } protected function getCommandByName($command) @@ -51,17 +23,14 @@ protected function getCommandByName($command) return CommandFactory::build($command['name'], $command); } - public function generate($commandsList) + public function format() { + $parsedXML = $this->seleniumFileParser->parse(); + $commandsList = $parsedXML['commands_list']; foreach ($commandsList as $command) { $commandObj = $this->getCommandByName($command); $this->minkContext .= $commandObj->toBehatMink(); } - } - - public function format() - { - $parsedXML = $this->seleniumFileParser->parse(); - $this->generate($parsedXML['commands_list']); + return $this->minkContext; } } diff --git a/index.php b/index.php index cf3f257..16769ed 100644 --- a/index.php +++ b/index.php @@ -1,9 +1,9 @@ format(); \ No newline at end of file +$BehatFileGenerator = new BehatFileGenerator($fileOne); +$BehatFileGenerator->generate(); \ No newline at end of file From bd09d38622df762d437a87e9f354d36c52032315 Mon Sep 17 00:00:00 2001 From: Narek Vardzelyan Date: Tue, 10 Nov 2015 09:12:48 +0400 Subject: [PATCH 10/29] Completed the application, but it must be tested. --- BehatFilesGenerator.php | 41 +++++++++++++++++++++-------------------- Commands.php | 3 +++ SeleniumFileParser.php | 4 ++-- index.php | 3 +++ 4 files changed, 29 insertions(+), 22 deletions(-) diff --git a/BehatFilesGenerator.php b/BehatFilesGenerator.php index b01b557..ecf4728 100644 --- a/BehatFilesGenerator.php +++ b/BehatFilesGenerator.php @@ -4,14 +4,13 @@ require_once 'SeleniumFileParser.php'; /** - * Description of BehatFilesGenerator - * + * This class generates Behat Mink context file and feature file. * @author narek_vardzelyan */ class BehatFilesGenerator { protected $seleniumRCToBehatMinkFormatter; protected $seleniumFileParser; - protected $SeleniumIdeParsedXML; + protected $seleniumIdeParsedXML; public function __construct($filePath) { @@ -22,19 +21,24 @@ public function __construct($filePath) ); } + protected function getTestName() + { + return $this->seleniumIdeParsedXML['test_name']; + } + protected function getTestMethodName() { - + //return $this->seleniumIdeParsedXML['test_name']; } protected function getTestMethodContent() { - + return $this->seleniumRCToBehatMinkFormattr->format(); } protected function getTestFeatureFileName() { - + return str_replace(' ', '_', $this->seleniumIdeParsedXML['test_name']); } protected function generateContextFile() @@ -46,36 +50,33 @@ protected function generateContextFile() /** * Features context. */ -class FeatureContext extends MinkContext -{ +class FeatureContext extends MinkContext\n{ /** * Initializes context. * Every scenario gets it's own context object. * * @param array \$parameters context parameters (set them up through behat.yml) */ - public function __construct(array \$parameters) - { - // Initialize your context here - }\n - {$this->seleniumRCToBehatMinkFormatter->format()} + public function __construct(array \$parameters)\n\t{ + // Initialize your context here\n\t}\n + public function {$this->getTestMethodName()}() + {\n{$this->seleniumRCToBehatMinkFormatter->format()}\n\t}\n} FILE; file_put_contents($fileName, $data); } protected function generateFeatureFile() { - $fileName = ; + $fileName = $this->getTestFeatureFileName(); $data = <<getTestName()} + Feature description @javascript - Scenario: Searching for a page with autocompletion - Given I am on "/wiki/Main_Page" + Scenario: {$this->getTestName()} + {$this->getTestName()} FILE; + file_put_contents($fileName, $data); } public function generate() diff --git a/Commands.php b/Commands.php index 0a7f575..ce4f45c 100644 --- a/Commands.php +++ b/Commands.php @@ -1,4 +1,7 @@ Date: Tue, 10 Nov 2015 09:46:16 +0400 Subject: [PATCH 11/29] Fixed some bugs. --- BehatFilesGenerator.php | 3 ++- Commands.php | 2 +- SeleniumFileParser.php | 15 ++++++++------- SeleniumRCToBehatMinkFormatter.php | 9 ++++----- index.php | 4 ++-- 5 files changed, 17 insertions(+), 16 deletions(-) diff --git a/BehatFilesGenerator.php b/BehatFilesGenerator.php index ecf4728..c0e41d3 100644 --- a/BehatFilesGenerator.php +++ b/BehatFilesGenerator.php @@ -14,7 +14,7 @@ class BehatFilesGenerator { public function __construct($filePath) { - $this->seleniumFilePrser = new SeleniumFileParser($filePath); + $this->seleniumFileParser = new SeleniumFileParser($filePath); $this->seleniumIdeParsedXML = $this->seleniumFileParser->parse(); $this->seleniumRCToBehatMinkFormatter = new SeleniumRCToBehatMinkFormatter( $this->seleniumIdeParsedXML @@ -28,6 +28,7 @@ protected function getTestName() protected function getTestMethodName() { + return 'somedumytestMethodName'; //return $this->seleniumIdeParsedXML['test_name']; } diff --git a/Commands.php b/Commands.php index ce4f45c..55f5073 100644 --- a/Commands.php +++ b/Commands.php @@ -19,7 +19,7 @@ public static function build($type, $command) if (class_exists($className)) { return new $className($command); } else { - throw new Exception('Command type not found.'); + throw new Exception("Command type({$className}) not found."); } } } diff --git a/SeleniumFileParser.php b/SeleniumFileParser.php index 8ff0af2..e057614 100644 --- a/SeleniumFileParser.php +++ b/SeleniumFileParser.php @@ -36,7 +36,11 @@ protected function getBaseUrl() protected function getCommandsList() { - $trElements = $this->xml->getElementsByTagName('tr'); + $tableBodyElement = $this->xml->getElementsByTagName('tbody')->item(0); + if ($tableBodyElement == null) { + throw new Exception("Wrong Selenium Ide file format.\n Commands list absent.\n"); + } + $trElements = $tableBodyElement->getElementsByTagName('tr'); if ($trElements->length == 0) { throw new Exception("Wrong Selenium Ide file format.\n Commands list absent.\n"); } @@ -46,13 +50,10 @@ protected function getCommandsList() if ($tdElements->length < 3) { throw new Exception("Wrong Selenium Ide file format.\n Command isn't full."); } - $commandName = $tdElements->item(0); - $commandTarget = $tdElements->item(1); - $commandValue = $tdElements->item(2); $commandsList[] = [ - 'name' => $commandName, - 'target' => $commandTarget, - 'value' => $commandValue + 'name' => $tdElements->item(0)->nodeValue, + 'target' => $tdElements->item(1)->nodeValue, + 'value' => $tdElements->item(2)->nodeValue ]; } return $commandsList; diff --git a/SeleniumRCToBehatMinkFormatter.php b/SeleniumRCToBehatMinkFormatter.php index 18291cf..9182a3c 100644 --- a/SeleniumRCToBehatMinkFormatter.php +++ b/SeleniumRCToBehatMinkFormatter.php @@ -10,11 +10,11 @@ class SeleniumRCToBehatMinkFormatter { protected $minkContext; - protected $seleniumIdeparsedXML; + protected $seleniumIdeParsedXML; - public function __construct($seleniumIdeparsedXML) + public function __construct($seleniumIdeParsedXML) { - $this->seleniumIdeparsedXML = $seleniumIdeparsedXML; + $this->seleniumIdeParsedXML = $seleniumIdeParsedXML; $this->minkContext = ''; } @@ -25,8 +25,7 @@ protected function getCommandByName($command) public function format() { - $parsedXML = $this->seleniumFileParser->parse(); - $commandsList = $parsedXML['commands_list']; + $commandsList = $this->seleniumIdeParsedXML['commands_list']; foreach ($commandsList as $command) { $commandObj = $this->getCommandByName($command); $this->minkContext .= $commandObj->toBehatMink(); diff --git a/index.php b/index.php index b96e03d..599c01f 100644 --- a/index.php +++ b/index.php @@ -3,10 +3,10 @@ * The file contains main logic of the application */ -require_once 'BehatFileGenerator.php'; +require_once 'BehatFilesGenerator.php'; $fileOne = '/Users/narek_vardzelyan/Documents/10 hour long Training Session is created.xhtml'; $fileTwo = '/Users/narek_vardzelyan/Documents/search_wikipedia_html_testcase.html'; -$BehatFileGenerator = new BehatFileGenerator($fileOne); +$BehatFileGenerator = new BehatFilesGenerator($fileOne); $BehatFileGenerator->generate(); \ No newline at end of file From c8559c16691064e29805fd5d33a0a80ced0b6c20 Mon Sep 17 00:00:00 2001 From: Narek Vardzelyan Date: Tue, 10 Nov 2015 14:33:37 +0400 Subject: [PATCH 12/29] Changed BehatFilesGenerator identifier to BehatTestGenerator, fixed bug about unknoun index, deleted unecessary class property from SeleniumRCToBehatMinFormatter class --- ...lesGenerator.php => BehatTestGenerator.php | 18 ++++++------ Commands.php | 28 ++++++++++++------- SeleniumRCToBehatMinkFormatter.php | 15 +++++----- index.php | 6 ++-- 4 files changed, 37 insertions(+), 30 deletions(-) rename BehatFilesGenerator.php => BehatTestGenerator.php (79%) diff --git a/BehatFilesGenerator.php b/BehatTestGenerator.php similarity index 79% rename from BehatFilesGenerator.php rename to BehatTestGenerator.php index c0e41d3..87fa61b 100644 --- a/BehatFilesGenerator.php +++ b/BehatTestGenerator.php @@ -7,23 +7,22 @@ * This class generates Behat Mink context file and feature file. * @author narek_vardzelyan */ -class BehatFilesGenerator { +class BehatTestGenerator { protected $seleniumRCToBehatMinkFormatter; - protected $seleniumFileParser; - protected $seleniumIdeParsedXML; + protected $seleniumIdeTestData; public function __construct($filePath) { - $this->seleniumFileParser = new SeleniumFileParser($filePath); - $this->seleniumIdeParsedXML = $this->seleniumFileParser->parse(); + $seleniumFileParser = new SeleniumFileParser($filePath); + $this->seleniumIdeTestData = $seleniumFileParser->parse(); $this->seleniumRCToBehatMinkFormatter = new SeleniumRCToBehatMinkFormatter( - $this->seleniumIdeParsedXML + $this->seleniumIdeTestData ); } protected function getTestName() { - return $this->seleniumIdeParsedXML['test_name']; + return $this->seleniumIdeTestData['test_name']; } protected function getTestMethodName() @@ -39,7 +38,7 @@ protected function getTestMethodContent() protected function getTestFeatureFileName() { - return str_replace(' ', '_', $this->seleniumIdeParsedXML['test_name']); + return str_replace(' ', '_', $this->seleniumIdeTestData['test_name']).'.featue'; } protected function generateContextFile() @@ -61,7 +60,8 @@ class FeatureContext extends MinkContext\n{ public function __construct(array \$parameters)\n\t{ // Initialize your context here\n\t}\n public function {$this->getTestMethodName()}() - {\n{$this->seleniumRCToBehatMinkFormatter->format()}\n\t}\n} + {\n{$this->seleniumRCToBehatMinkFormatter->format()} + }\n} FILE; file_put_contents($fileName, $data); } diff --git a/Commands.php b/Commands.php index 55f5073..51b094a 100644 --- a/Commands.php +++ b/Commands.php @@ -39,7 +39,7 @@ class Open extends BaseCommand { public function toBehatMink() { - return "\t\$this->getSession()->visit({$this->command[1]});\n"; + return "\t\$this->getSession()->visit(\"{$this->command['target']}\");\n"; } } @@ -47,8 +47,16 @@ class Type extends BaseCommand { public function toBehatMink() { - return "\t\$this->getSession()->fillFields({$this->command[1]}, " - . "{$this->command[2]});\n"; + return "\t\$this->getSession()->fillFields(\"{$this->command['target']}\", " + . "\"{$this->command['value']}\");\n"; + } +} + +class Click extends BaseCommand +{ + public function toBehatMink() + { + return "\t\$this->getSession()->clicLink(\"{$this->command['target']}\");\n"; } } @@ -56,7 +64,7 @@ class ClickAndWait extends BaseCommand { public function toBehatMink() { - return "\t\$this->getSession()->pressButton({$this->command[1]});\n" + return "\t\$this->getSession()->pressButton(\"{$this->command['target']}\");\n" . "\t\$this->getSession()->wait();\n"; } } @@ -65,8 +73,8 @@ class Select extends BaseCommand { public function toBehatMink() { - return "\t\$this->getSession()->selectOption({$this->commandcommand[1]}, " - . "{$this->commandcommand[2]});\n"; + return "\t\$this->getSession()->selectOption(\"{$this->command['target']}\", " + . "\"{$this->command['value']}\");\n"; } } @@ -74,8 +82,8 @@ class SendKeys extends BaseCommand { public function toBehatMink() { - return "\t\$this->getSession()->fillFields({$this->commandcommand[1]}, " - . "{$this->commandcommand[2]});\n"; + return "\t\$this->getSession()->fillFields(\"{$this->command['target']}\", " + . "\"{$this->command['value']}\");\n"; } } @@ -83,7 +91,7 @@ class WaitForElementPresent extends BaseCommand { public function toBehatMink() { - return "\t\$this->getSession()->wait(10000, 'document.getElementById" - . "('{$this->commandcommand[1]}')')"; + return "\t\$this->getSession()->wait('target'0000, 'document.getElementById" + . "(\"{$this->command['target']}\")')"; } } \ No newline at end of file diff --git a/SeleniumRCToBehatMinkFormatter.php b/SeleniumRCToBehatMinkFormatter.php index 9182a3c..40b8874 100644 --- a/SeleniumRCToBehatMinkFormatter.php +++ b/SeleniumRCToBehatMinkFormatter.php @@ -9,13 +9,11 @@ */ class SeleniumRCToBehatMinkFormatter { - protected $minkContext; - protected $seleniumIdeParsedXML; + protected $seleniumIdeTestData; - public function __construct($seleniumIdeParsedXML) + public function __construct($seleniumIdeTestData) { - $this->seleniumIdeParsedXML = $seleniumIdeParsedXML; - $this->minkContext = ''; + $this->seleniumIdeTestData = $seleniumIdeTestData; } protected function getCommandByName($command) @@ -25,11 +23,12 @@ protected function getCommandByName($command) public function format() { - $commandsList = $this->seleniumIdeParsedXML['commands_list']; + $minkContext = ''; + $commandsList = $this->seleniumIdeTestData['commands_list']; foreach ($commandsList as $command) { $commandObj = $this->getCommandByName($command); - $this->minkContext .= $commandObj->toBehatMink(); + $minkContext .= $commandObj->toBehatMink(); } - return $this->minkContext; + return $minkContext; } } diff --git a/index.php b/index.php index 599c01f..1f5e01b 100644 --- a/index.php +++ b/index.php @@ -3,10 +3,10 @@ * The file contains main logic of the application */ -require_once 'BehatFilesGenerator.php'; +require_once 'BehatTestGenerator.php'; $fileOne = '/Users/narek_vardzelyan/Documents/10 hour long Training Session is created.xhtml'; $fileTwo = '/Users/narek_vardzelyan/Documents/search_wikipedia_html_testcase.html'; -$BehatFileGenerator = new BehatFilesGenerator($fileOne); -$BehatFileGenerator->generate(); \ No newline at end of file +$BehatTestGenerator = new BehatTestGenerator($fileOne); +$BehatTestGenerator->generate(); \ No newline at end of file From ed9bce5be5cd7b35e0181ee95e583abca1cb4794 Mon Sep 17 00:00:00 2001 From: Narek Vardzelyan Date: Tue, 10 Nov 2015 16:12:39 +0400 Subject: [PATCH 13/29] Changed fileName to filePath, CommanfFactory wrote without if else, completed getTestMethodName method. --- BehatTestGenerator.php | 5 ++--- Commands.php | 14 ++++++-------- SeleniumFileParser.php | 8 ++++---- index.php | 6 +++--- 4 files changed, 15 insertions(+), 18 deletions(-) diff --git a/BehatTestGenerator.php b/BehatTestGenerator.php index 87fa61b..3762ba9 100644 --- a/BehatTestGenerator.php +++ b/BehatTestGenerator.php @@ -27,8 +27,7 @@ protected function getTestName() protected function getTestMethodName() { - return 'somedumytestMethodName'; - //return $this->seleniumIdeParsedXML['test_name']; + return str_replace(' ', '', ucwords($this->seleniumIdeTestData['test_name'])); } protected function getTestMethodContent() @@ -38,7 +37,7 @@ protected function getTestMethodContent() protected function getTestFeatureFileName() { - return str_replace(' ', '_', $this->seleniumIdeTestData['test_name']).'.featue'; + return str_replace(' ', '_', $this->seleniumIdeTestData['test_name']).'.feature'; } protected function generateContextFile() diff --git a/Commands.php b/Commands.php index 51b094a..8e83111 100644 --- a/Commands.php +++ b/Commands.php @@ -14,14 +14,12 @@ public static function build($type, $command) { if ($type == '') { throw new Exception('Invalid command type.'); - } else { - $className = ucfirst($type); - if (class_exists($className)) { - return new $className($command); - } else { - throw new Exception("Command type({$className}) not found."); - } } + $className = ucfirst($type); + if (!class_exists($className)) { + throw new Exception("Command type({$className}) not found."); + } + return new $className($command); } } @@ -94,4 +92,4 @@ public function toBehatMink() return "\t\$this->getSession()->wait('target'0000, 'document.getElementById" . "(\"{$this->command['target']}\")')"; } -} \ No newline at end of file +} diff --git a/SeleniumFileParser.php b/SeleniumFileParser.php index e057614..4bcb15f 100644 --- a/SeleniumFileParser.php +++ b/SeleniumFileParser.php @@ -6,14 +6,14 @@ * @author narek_vardzelyan */ class SeleniumFileParser { - protected $testFileName; + protected $filePath; protected $xml; - public function __construct($testFileName) + public function __construct($filePath) { - $this->testFileName = $testFileName; + $this->filePath = $filePath; $this->xml = new DOMDocument('1.0', 'UTF-8'); - $this->xml->load($testFileName); + $this->xml->load($filePath); } protected function getTestName() diff --git a/index.php b/index.php index 1f5e01b..8f6be1d 100644 --- a/index.php +++ b/index.php @@ -5,8 +5,8 @@ require_once 'BehatTestGenerator.php'; -$fileOne = '/Users/narek_vardzelyan/Documents/10 hour long Training Session is created.xhtml'; -$fileTwo = '/Users/narek_vardzelyan/Documents/search_wikipedia_html_testcase.html'; +$firstFilePath = '/Users/narek_vardzelyan/Documents/ten hour long Training Session is created.xhtml'; +$secondFilePath = '/Users/narek_vardzelyan/Documents/search_wikipedia_html_testcase.html'; -$BehatTestGenerator = new BehatTestGenerator($fileOne); +$BehatTestGenerator = new BehatTestGenerator($firstFilePath); $BehatTestGenerator->generate(); \ No newline at end of file From acf1ea4ccb3a9c7965c5b237b261aa3661bab622 Mon Sep 17 00:00:00 2001 From: Narek Vardzelyan Date: Tue, 10 Nov 2015 18:57:40 +0400 Subject: [PATCH 14/29] Changed nowfile content, now it more readable. --- BehatTestGenerator.php | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/BehatTestGenerator.php b/BehatTestGenerator.php index 3762ba9..ed4f046 100644 --- a/BehatTestGenerator.php +++ b/BehatTestGenerator.php @@ -44,23 +44,31 @@ protected function generateContextFile() { $fileName = 'FeatureContext.php'; $data = <<getTestMethodName()}() - {\n{$this->seleniumRCToBehatMinkFormatter->format()} - }\n} + { + {$this->seleniumRCToBehatMinkFormatter->format()} + } +} FILE; file_put_contents($fileName, $data); } From 0e98dae9d508e8b3f0d70602cdd84a809327b0be Mon Sep 17 00:00:00 2001 From: Narek Vardzelyan Date: Wed, 11 Nov 2015 10:48:46 +0400 Subject: [PATCH 15/29] Added composer autoload and Behat with Mink extension. --- .gitignore | 4 +- composer.json | 23 + composer.lock | 1455 +++++++++++++++++ .../BehatTestGenerator.php | 3 +- Commands.php => src/Commands.php | 8 +- .../SeleniumFileParser.php | 6 +- .../SeleniumRCToBehatMinkFormatter.php | 4 +- index.php => test.php | 4 +- 8 files changed, 1497 insertions(+), 10 deletions(-) create mode 100644 composer.json create mode 100644 composer.lock rename BehatTestGenerator.php => src/BehatTestGenerator.php (96%) rename Commands.php => src/Commands.php (95%) rename SeleniumFileParser.php => src/SeleniumFileParser.php (96%) rename SeleniumRCToBehatMinkFormatter.php => src/SeleniumRCToBehatMinkFormatter.php (89%) rename index.php => test.php (71%) diff --git a/.gitignore b/.gitignore index 187adb2..b076319 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ -/nbproject/ \ No newline at end of file +/nbproject/ +/vendor/ +/bin/ diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..c14c402 --- /dev/null +++ b/composer.json @@ -0,0 +1,23 @@ +{ + "name": "fouraitch/selenium-ide-php-behat-mink-formatter", + "authors": [ + { + "name": "Narek Vardzelyan", + "email": "narek.vardzelyan@of.am" + } + ], + "require": { + "behat/behat": "2.4.*@stable", + "behat/mink": "1.4.*@stable", + "behat/mink-extension": "*", + "behat/mink-goutte-driver": "*", + "behat/mink-selenium2-driver": "*" + }, + "minimum-stability": "dev", + "config": { + "bin-dir": "bin/" + }, + "autoload": { + "psr-4": {"Fouraitch\\": "src/"} + } +} diff --git a/composer.lock b/composer.lock new file mode 100644 index 0000000..a2208ef --- /dev/null +++ b/composer.lock @@ -0,0 +1,1455 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", + "This file is @generated automatically" + ], + "hash": "d13ddedf76a0d6f297bcc7966c4c43ff", + "content-hash": "d6a55bb0d4029706ed1e425d5f08fb6c", + "packages": [ + { + "name": "behat/behat", + "version": "v2.4.6", + "source": { + "type": "git", + "url": "https://github.com/Behat/Behat.git", + "reference": "f1d2964667cf4b21bb6c2c1564f26829a6954155" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Behat/Behat/zipball/f1d2964667cf4b21bb6c2c1564f26829a6954155", + "reference": "f1d2964667cf4b21bb6c2c1564f26829a6954155", + "shasum": "" + }, + "require": { + "behat/gherkin": "~2.2.9", + "php": ">=5.3.1", + "symfony/config": "~2.0", + "symfony/console": "~2.0", + "symfony/dependency-injection": "~2.0", + "symfony/event-dispatcher": "~2.0", + "symfony/finder": "~2.0", + "symfony/translation": "~2.0", + "symfony/yaml": "~2.0" + }, + "require-dev": { + "phpunit/phpunit": "~3.7.19" + }, + "suggest": { + "behat/mink-extension": "for integration with Mink testing framework", + "behat/symfony2-extension": "for integration with Symfony2 web framework", + "behat/yii-extension": "for integration with Yii web framework" + }, + "bin": [ + "bin/behat" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-develop": "2.4-dev" + } + }, + "autoload": { + "psr-0": { + "Behat\\Behat": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Konstantin Kudryashov", + "email": "ever.zet@gmail.com", + "homepage": "http://everzet.com" + } + ], + "description": "Scenario-oriented BDD framework for PHP 5.3", + "homepage": "http://behat.org/", + "keywords": [ + "BDD", + "Behat", + "Symfony2" + ], + "time": "2013-06-06 10:46:48" + }, + { + "name": "behat/gherkin", + "version": "v2.2.9", + "source": { + "type": "git", + "url": "https://github.com/Behat/Gherkin.git", + "reference": "cca2c477921ca38578d6e9759ea5e450f29c2d8f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Behat/Gherkin/zipball/cca2c477921ca38578d6e9759ea5e450f29c2d8f", + "reference": "cca2c477921ca38578d6e9759ea5e450f29c2d8f", + "shasum": "" + }, + "require": { + "php": ">=5.3.1", + "symfony/finder": ">=2.0,<2.4-dev" + }, + "require-dev": { + "symfony/config": ">=2.0,<2.4-dev", + "symfony/translation": ">=2.0,<2.4-dev", + "symfony/yaml": ">=2.0,<2.4-dev" + }, + "suggest": { + "symfony/config": "If you want to use Config component to manage resources", + "symfony/translation": "If you want to use Symfony2 translations adapter", + "symfony/yaml": "If you want to parse features, represented in YAML files" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-develop": "2.2-dev" + } + }, + "autoload": { + "psr-0": { + "Behat\\Gherkin": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Konstantin Kudryashov", + "email": "ever.zet@gmail.com", + "homepage": "http://everzet.com" + } + ], + "description": "Gherkin DSL parser for PHP 5.3", + "homepage": "http://behat.org/", + "keywords": [ + "BDD", + "Behat", + "DSL", + "Symfony2", + "parser" + ], + "time": "2013-03-02 10:38:40" + }, + { + "name": "behat/mink", + "version": "v1.4.3", + "source": { + "type": "git", + "url": "https://github.com/minkphp/Mink.git", + "reference": "0817070a6e2ec9f475fad9bfb81a962c462eb934" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/minkphp/Mink/zipball/0817070a6e2ec9f475fad9bfb81a962c462eb934", + "reference": "0817070a6e2ec9f475fad9bfb81a962c462eb934", + "shasum": "" + }, + "require": { + "php": ">=5.3.1", + "symfony/css-selector": ">=2.0,<2.4-dev" + }, + "suggest": { + "behat/mink-browserkit-driver": "extremely fast headless driver for Symfony\\Kernel-based apps (Sf2, Silex)", + "behat/mink-goutte-driver": "fast headless driver for any app without JS emulation", + "behat/mink-selenium2-driver": "slow, but JS-enabled driver for any app (requires Selenium2)", + "behat/mink-zombie-driver": "fast and JS-enabled headless driver for any app (requires node.js)" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-develop": "1.4.x-dev" + } + }, + "autoload": { + "psr-0": { + "Behat\\Mink": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Konstantin Kudryashov", + "email": "ever.zet@gmail.com", + "homepage": "http://everzet.com" + } + ], + "description": "Web acceptance testing framework for PHP 5.3", + "homepage": "http://mink.behat.org/", + "keywords": [ + "browser", + "testing", + "web" + ], + "time": "2013-03-02 15:53:18" + }, + { + "name": "behat/mink-browserkit-driver", + "version": "v1.0.5", + "source": { + "type": "git", + "url": "https://github.com/minkphp/MinkBrowserKitDriver.git", + "reference": "f2771b5fc4dbc233859addf37a7d150852f78418" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/minkphp/MinkBrowserKitDriver/zipball/f2771b5fc4dbc233859addf37a7d150852f78418", + "reference": "f2771b5fc4dbc233859addf37a7d150852f78418", + "shasum": "" + }, + "require": { + "behat/mink": "~1.4.3", + "php": ">=5.3.1", + "symfony/browser-kit": "~2.0", + "symfony/dom-crawler": "~2.0" + }, + "require-dev": { + "silex/silex": "@dev" + }, + "type": "mink-driver", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-0": { + "Behat\\Mink\\Driver": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Konstantin Kudryashov", + "email": "ever.zet@gmail.com", + "homepage": "http://everzet.com" + } + ], + "description": "Symfony2 BrowserKit driver for Mink framework", + "homepage": "http://mink.behat.org/", + "keywords": [ + "Mink", + "Symfony2", + "browser", + "testing" + ], + "time": "2013-04-13 12:17:15" + }, + { + "name": "behat/mink-extension", + "version": "v1.1.4", + "source": { + "type": "git", + "url": "https://github.com/Behat/MinkExtension.git", + "reference": "b4522f19fe96d423883f2e3650615e19d3a48c05" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Behat/MinkExtension/zipball/b4522f19fe96d423883f2e3650615e19d3a48c05", + "reference": "b4522f19fe96d423883f2e3650615e19d3a48c05", + "shasum": "" + }, + "require": { + "behat/behat": "~2.4.5", + "behat/mink": ">=1.4.3,<1.6-dev", + "php": ">=5.3.2" + }, + "require-dev": { + "behat/mink-goutte-driver": "~1.0" + }, + "type": "behat-extension", + "extra": { + "branch-alias": { + "dev-master": "1.1.x-dev" + } + }, + "autoload": { + "psr-0": { + "Behat\\MinkExtension": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Konstantin Kudryashov", + "email": "ever.zet@gmail.com", + "homepage": "http://everzet.com" + } + ], + "description": "Mink extension for Behat", + "homepage": "http://mink.behat.org", + "keywords": [ + "browser", + "gui", + "test", + "web" + ], + "time": "2013-06-04 12:18:22" + }, + { + "name": "behat/mink-goutte-driver", + "version": "v1.0.9", + "source": { + "type": "git", + "url": "https://github.com/minkphp/MinkGoutteDriver.git", + "reference": "fa1b073b48761464feb0b05e6825da44b20118d8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/minkphp/MinkGoutteDriver/zipball/fa1b073b48761464feb0b05e6825da44b20118d8", + "reference": "fa1b073b48761464feb0b05e6825da44b20118d8", + "shasum": "" + }, + "require": { + "behat/mink-browserkit-driver": ">=1.0.5,<1.2.0", + "fabpot/goutte": "~1.0.1", + "php": ">=5.3.1" + }, + "type": "mink-driver", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-0": { + "Behat\\Mink\\Driver": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Konstantin Kudryashov", + "email": "ever.zet@gmail.com", + "homepage": "http://everzet.com" + } + ], + "description": "Goutte driver for Mink framework", + "homepage": "http://mink.behat.org/", + "keywords": [ + "browser", + "goutte", + "headless", + "testing" + ], + "time": "2013-07-03 18:43:54" + }, + { + "name": "behat/mink-selenium2-driver", + "version": "v1.0.6", + "source": { + "type": "git", + "url": "https://github.com/minkphp/MinkSelenium2Driver.git", + "reference": "689f58cc82adc678696942f389d35196fa2453f8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/minkphp/MinkSelenium2Driver/zipball/689f58cc82adc678696942f389d35196fa2453f8", + "reference": "689f58cc82adc678696942f389d35196fa2453f8", + "shasum": "" + }, + "require": { + "behat/mink": "~1.4.3", + "instaclick/php-webdriver": "~1.0.12", + "php": ">=5.3.1" + }, + "type": "mink-driver", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-0": { + "Behat\\Mink\\Driver": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Konstantin Kudryashov", + "email": "ever.zet@gmail.com", + "homepage": "http://everzet.com" + }, + { + "name": "Pete Otaqui", + "email": "pete@otaqui.com", + "homepage": "https://github.com/pete-otaqui" + } + ], + "description": "Selenium2 (WebDriver) driver for Mink framework", + "homepage": "http://mink.behat.org/", + "keywords": [ + "ajax", + "browser", + "javascript", + "selenium", + "testing", + "webdriver" + ], + "time": "2013-04-13 12:56:28" + }, + { + "name": "fabpot/goutte", + "version": "1.0.x-dev", + "source": { + "type": "git", + "url": "https://github.com/FriendsOfPHP/Goutte.git", + "reference": "794b196e76bdd37b5155cdecbad311f0a3b07625" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/FriendsOfPHP/Goutte/zipball/794b196e76bdd37b5155cdecbad311f0a3b07625", + "reference": "794b196e76bdd37b5155cdecbad311f0a3b07625", + "shasum": "" + }, + "require": { + "ext-curl": "*", + "guzzle/http": "~3.1", + "php": ">=5.3.0", + "symfony/browser-kit": "~2.1", + "symfony/css-selector": "~2.1", + "symfony/dom-crawler": "~2.1", + "symfony/finder": "~2.1", + "symfony/process": "~2.1" + }, + "require-dev": { + "guzzle/plugin-history": "~3.1", + "guzzle/plugin-mock": "~3.1" + }, + "type": "application", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "psr-0": { + "Goutte": "." + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + } + ], + "description": "A simple PHP Web Scraper", + "homepage": "https://github.com/fabpot/Goutte", + "keywords": [ + "scraper" + ], + "time": "2014-10-09 15:52:51" + }, + { + "name": "guzzle/common", + "version": "v3.9.2", + "target-dir": "Guzzle/Common", + "source": { + "type": "git", + "url": "https://github.com/Guzzle3/common.git", + "reference": "2e36af7cf2ce3ea1f2d7c2831843b883a8e7b7dc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Guzzle3/common/zipball/2e36af7cf2ce3ea1f2d7c2831843b883a8e7b7dc", + "reference": "2e36af7cf2ce3ea1f2d7c2831843b883a8e7b7dc", + "shasum": "" + }, + "require": { + "php": ">=5.3.2", + "symfony/event-dispatcher": ">=2.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.7-dev" + } + }, + "autoload": { + "psr-0": { + "Guzzle\\Common": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Common libraries used by Guzzle", + "homepage": "http://guzzlephp.org/", + "keywords": [ + "collection", + "common", + "event", + "exception" + ], + "abandoned": "guzzle/guzzle", + "time": "2014-08-11 04:32:36" + }, + { + "name": "guzzle/http", + "version": "v3.9.2", + "target-dir": "Guzzle/Http", + "source": { + "type": "git", + "url": "https://github.com/Guzzle3/http.git", + "reference": "1e8dd1e2ba9dc42332396f39fbfab950b2301dc5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Guzzle3/http/zipball/1e8dd1e2ba9dc42332396f39fbfab950b2301dc5", + "reference": "1e8dd1e2ba9dc42332396f39fbfab950b2301dc5", + "shasum": "" + }, + "require": { + "guzzle/common": "self.version", + "guzzle/parser": "self.version", + "guzzle/stream": "self.version", + "php": ">=5.3.2" + }, + "suggest": { + "ext-curl": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.7-dev" + } + }, + "autoload": { + "psr-0": { + "Guzzle\\Http": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + } + ], + "description": "HTTP libraries used by Guzzle", + "homepage": "http://guzzlephp.org/", + "keywords": [ + "Guzzle", + "client", + "curl", + "http", + "http client" + ], + "abandoned": "guzzle/guzzle", + "time": "2014-08-11 04:32:36" + }, + { + "name": "guzzle/parser", + "version": "v3.9.2", + "target-dir": "Guzzle/Parser", + "source": { + "type": "git", + "url": "https://github.com/Guzzle3/parser.git", + "reference": "6874d171318a8e93eb6d224cf85e4678490b625c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Guzzle3/parser/zipball/6874d171318a8e93eb6d224cf85e4678490b625c", + "reference": "6874d171318a8e93eb6d224cf85e4678490b625c", + "shasum": "" + }, + "require": { + "php": ">=5.3.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.7-dev" + } + }, + "autoload": { + "psr-0": { + "Guzzle\\Parser": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Interchangeable parsers used by Guzzle", + "homepage": "http://guzzlephp.org/", + "keywords": [ + "URI Template", + "cookie", + "http", + "message", + "url" + ], + "abandoned": "guzzle/guzzle", + "time": "2014-02-05 18:29:46" + }, + { + "name": "guzzle/stream", + "version": "v3.9.2", + "target-dir": "Guzzle/Stream", + "source": { + "type": "git", + "url": "https://github.com/Guzzle3/stream.git", + "reference": "60c7fed02e98d2c518dae8f97874c8f4622100f0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Guzzle3/stream/zipball/60c7fed02e98d2c518dae8f97874c8f4622100f0", + "reference": "60c7fed02e98d2c518dae8f97874c8f4622100f0", + "shasum": "" + }, + "require": { + "guzzle/common": "self.version", + "php": ">=5.3.2" + }, + "suggest": { + "guzzle/http": "To convert Guzzle request objects to PHP streams" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.7-dev" + } + }, + "autoload": { + "psr-0": { + "Guzzle\\Stream": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + } + ], + "description": "Guzzle stream wrapper component", + "homepage": "http://guzzlephp.org/", + "keywords": [ + "Guzzle", + "component", + "stream" + ], + "abandoned": "guzzle/guzzle", + "time": "2014-05-01 21:36:02" + }, + { + "name": "instaclick/php-webdriver", + "version": "1.0.17", + "source": { + "type": "git", + "url": "https://github.com/instaclick/php-webdriver.git", + "reference": "47a6019553a7a5b42d35493276ffc2c9252c53d5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/instaclick/php-webdriver/zipball/47a6019553a7a5b42d35493276ffc2c9252c53d5", + "reference": "47a6019553a7a5b42d35493276ffc2c9252c53d5", + "shasum": "" + }, + "require": { + "ext-curl": "*", + "php": ">=5.3.2" + }, + "bin": [ + "bin/webunit" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-0": { + "WebDriver": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "Justin Bishop", + "email": "jubishop@gmail.com", + "role": "Developer" + }, + { + "name": "Anthon Pang", + "email": "apang@softwaredevelopment.ca", + "role": "developer" + } + ], + "description": "PHP WebDriver for Selenium 2", + "homepage": "http://instaclick.com/", + "keywords": [ + "browser", + "selenium", + "webdriver", + "webtest" + ], + "time": "2013-10-04 15:03:51" + }, + { + "name": "symfony/browser-kit", + "version": "2.8.x-dev", + "source": { + "type": "git", + "url": "https://github.com/symfony/browser-kit.git", + "reference": "589f32fe4f43155ea303d505171634c45f15e876" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/browser-kit/zipball/589f32fe4f43155ea303d505171634c45f15e876", + "reference": "589f32fe4f43155ea303d505171634c45f15e876", + "shasum": "" + }, + "require": { + "php": ">=5.3.9", + "symfony/dom-crawler": "~2.0,>=2.0.5|~3.0.0" + }, + "require-dev": { + "symfony/css-selector": "~2.0,>=2.0.5|~3.0.0", + "symfony/process": "~2.3.34|~2.7,>=2.7.6|~3.0.0" + }, + "suggest": { + "symfony/process": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\BrowserKit\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony BrowserKit Component", + "homepage": "https://symfony.com", + "time": "2015-11-02 20:29:24" + }, + { + "name": "symfony/config", + "version": "2.8.x-dev", + "source": { + "type": "git", + "url": "https://github.com/symfony/config.git", + "reference": "f042c9257b2bdebda285f7a5c089b9348bcb6f3d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/config/zipball/f042c9257b2bdebda285f7a5c089b9348bcb6f3d", + "reference": "f042c9257b2bdebda285f7a5c089b9348bcb6f3d", + "shasum": "" + }, + "require": { + "php": ">=5.3.9", + "symfony/filesystem": "~2.3|~3.0.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Config\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Config Component", + "homepage": "https://symfony.com", + "time": "2015-11-02 20:29:24" + }, + { + "name": "symfony/console", + "version": "2.8.x-dev", + "source": { + "type": "git", + "url": "https://github.com/symfony/console.git", + "reference": "74bf9202a531cc6942454eb9e2dd1e13bde34a31" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/console/zipball/74bf9202a531cc6942454eb9e2dd1e13bde34a31", + "reference": "74bf9202a531cc6942454eb9e2dd1e13bde34a31", + "shasum": "" + }, + "require": { + "php": ">=5.3.9", + "symfony/polyfill-mbstring": "~1.0" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/event-dispatcher": "~2.1|~3.0.0", + "symfony/process": "~2.1|~3.0.0" + }, + "suggest": { + "psr/log": "For using the console logger", + "symfony/event-dispatcher": "", + "symfony/process": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Console\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Console Component", + "homepage": "https://symfony.com", + "time": "2015-11-04 00:47:19" + }, + { + "name": "symfony/css-selector", + "version": "2.3.x-dev", + "target-dir": "Symfony/Component/CssSelector", + "source": { + "type": "git", + "url": "https://github.com/symfony/css-selector.git", + "reference": "b3639687d986c8c0c81e9bbdc7267032578a2289" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/css-selector/zipball/b3639687d986c8c0c81e9bbdc7267032578a2289", + "reference": "b3639687d986c8c0c81e9bbdc7267032578a2289", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.3-dev" + } + }, + "autoload": { + "psr-0": { + "Symfony\\Component\\CssSelector\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jean-François Simon", + "email": "jeanfrancois.simon@sensiolabs.com" + }, + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony CssSelector Component", + "homepage": "https://symfony.com", + "time": "2015-10-30 19:48:51" + }, + { + "name": "symfony/dependency-injection", + "version": "2.8.x-dev", + "source": { + "type": "git", + "url": "https://github.com/symfony/dependency-injection.git", + "reference": "eae068f6bbae4b10f096d6b3eb90953941a9c0e4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/eae068f6bbae4b10f096d6b3eb90953941a9c0e4", + "reference": "eae068f6bbae4b10f096d6b3eb90953941a9c0e4", + "shasum": "" + }, + "require": { + "php": ">=5.3.9" + }, + "conflict": { + "symfony/expression-language": "<2.6" + }, + "require-dev": { + "symfony/config": "~2.2|~3.0.0", + "symfony/expression-language": "~2.6|~3.0.0", + "symfony/yaml": "~2.1|~3.0.0" + }, + "suggest": { + "symfony/config": "", + "symfony/proxy-manager-bridge": "Generate service proxies to lazy load them", + "symfony/yaml": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\DependencyInjection\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony DependencyInjection Component", + "homepage": "https://symfony.com", + "time": "2015-11-07 08:30:54" + }, + { + "name": "symfony/dom-crawler", + "version": "2.8.x-dev", + "source": { + "type": "git", + "url": "https://github.com/symfony/dom-crawler.git", + "reference": "740c98235f5b6e2b0b13df2fb97c7a1c7d1a18fc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/740c98235f5b6e2b0b13df2fb97c7a1c7d1a18fc", + "reference": "740c98235f5b6e2b0b13df2fb97c7a1c7d1a18fc", + "shasum": "" + }, + "require": { + "php": ">=5.3.9", + "symfony/polyfill-mbstring": "~1.0" + }, + "require-dev": { + "symfony/css-selector": "~2.8|~3.0.0" + }, + "suggest": { + "symfony/css-selector": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\DomCrawler\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony DomCrawler Component", + "homepage": "https://symfony.com", + "time": "2015-11-02 20:29:39" + }, + { + "name": "symfony/event-dispatcher", + "version": "2.8.x-dev", + "source": { + "type": "git", + "url": "https://github.com/symfony/event-dispatcher.git", + "reference": "a5eb815363c0388e83247e7e9853e5dbc14999cc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/a5eb815363c0388e83247e7e9853e5dbc14999cc", + "reference": "a5eb815363c0388e83247e7e9853e5dbc14999cc", + "shasum": "" + }, + "require": { + "php": ">=5.3.9" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/config": "~2.0,>=2.0.5|~3.0.0", + "symfony/dependency-injection": "~2.6|~3.0.0", + "symfony/expression-language": "~2.6|~3.0.0", + "symfony/stopwatch": "~2.3|~3.0.0" + }, + "suggest": { + "symfony/dependency-injection": "", + "symfony/http-kernel": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\EventDispatcher\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony EventDispatcher Component", + "homepage": "https://symfony.com", + "time": "2015-10-30 20:15:42" + }, + { + "name": "symfony/filesystem", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/symfony/filesystem.git", + "reference": "232aa96494f0b44d25c8b7a11163c742e568c1a7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/232aa96494f0b44d25c8b7a11163c742e568c1a7", + "reference": "232aa96494f0b44d25c8b7a11163c742e568c1a7", + "shasum": "" + }, + "require": { + "php": ">=5.5.9" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Filesystem\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Filesystem Component", + "homepage": "https://symfony.com", + "time": "2015-11-10 13:34:42" + }, + { + "name": "symfony/finder", + "version": "2.3.x-dev", + "target-dir": "Symfony/Component/Finder", + "source": { + "type": "git", + "url": "https://github.com/symfony/finder.git", + "reference": "9f52ac1ad87a9571dbf4f62dadf9174ca38dce6b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/finder/zipball/9f52ac1ad87a9571dbf4f62dadf9174ca38dce6b", + "reference": "9f52ac1ad87a9571dbf4f62dadf9174ca38dce6b", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.3-dev" + } + }, + "autoload": { + "psr-0": { + "Symfony\\Component\\Finder\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Finder Component", + "homepage": "https://symfony.com", + "time": "2015-10-30 19:48:51" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "0b6a8940385311a24e060ec1fe35680e17c74497" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/0b6a8940385311a24e060ec1fe35680e17c74497", + "reference": "0b6a8940385311a24e060ec1fe35680e17c74497", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "time": "2015-11-04 20:28:58" + }, + { + "name": "symfony/process", + "version": "2.8.x-dev", + "source": { + "type": "git", + "url": "https://github.com/symfony/process.git", + "reference": "7d645ea9d254e488bca808f80e3ed3cb6d1bebcd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/process/zipball/7d645ea9d254e488bca808f80e3ed3cb6d1bebcd", + "reference": "7d645ea9d254e488bca808f80e3ed3cb6d1bebcd", + "shasum": "" + }, + "require": { + "php": ">=5.3.9" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Process\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Process Component", + "homepage": "https://symfony.com", + "time": "2015-10-30 20:15:42" + }, + { + "name": "symfony/translation", + "version": "2.8.x-dev", + "source": { + "type": "git", + "url": "https://github.com/symfony/translation.git", + "reference": "98b89a9091dde2af772d4c74a09447d317d1bdf4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/translation/zipball/98b89a9091dde2af772d4c74a09447d317d1bdf4", + "reference": "98b89a9091dde2af772d4c74a09447d317d1bdf4", + "shasum": "" + }, + "require": { + "php": ">=5.3.9", + "symfony/polyfill-mbstring": "~1.0" + }, + "conflict": { + "symfony/config": "<2.7" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/config": "~2.8", + "symfony/intl": "~2.4|~3.0.0", + "symfony/yaml": "~2.2|~3.0.0" + }, + "suggest": { + "psr/log": "To use logging capability in translator", + "symfony/config": "", + "symfony/yaml": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Translation\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Translation Component", + "homepage": "https://symfony.com", + "time": "2015-10-30 20:15:42" + }, + { + "name": "symfony/yaml", + "version": "2.8.x-dev", + "source": { + "type": "git", + "url": "https://github.com/symfony/yaml.git", + "reference": "5ff00ea2999343d42398fcb793bbfc64c92235ff" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/yaml/zipball/5ff00ea2999343d42398fcb793bbfc64c92235ff", + "reference": "5ff00ea2999343d42398fcb793bbfc64c92235ff", + "shasum": "" + }, + "require": { + "php": ">=5.3.9" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Yaml\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Yaml Component", + "homepage": "https://symfony.com", + "time": "2015-11-05 09:04:44" + } + ], + "packages-dev": [], + "aliases": [], + "minimum-stability": "dev", + "stability-flags": { + "behat/behat": 0, + "behat/mink": 0 + }, + "prefer-stable": false, + "prefer-lowest": false, + "platform": [], + "platform-dev": [] +} diff --git a/BehatTestGenerator.php b/src/BehatTestGenerator.php similarity index 96% rename from BehatTestGenerator.php rename to src/BehatTestGenerator.php index ed4f046..e2ab12b 100644 --- a/BehatTestGenerator.php +++ b/src/BehatTestGenerator.php @@ -1,7 +1,6 @@ filePath = $filePath; - $this->xml = new DOMDocument('1.0', 'UTF-8'); + $this->xml = new \DOMDocument('1.0', 'UTF-8'); $this->xml->load($filePath); } diff --git a/SeleniumRCToBehatMinkFormatter.php b/src/SeleniumRCToBehatMinkFormatter.php similarity index 89% rename from SeleniumRCToBehatMinkFormatter.php rename to src/SeleniumRCToBehatMinkFormatter.php index 40b8874..30e916f 100644 --- a/SeleniumRCToBehatMinkFormatter.php +++ b/src/SeleniumRCToBehatMinkFormatter.php @@ -1,6 +1,6 @@ generate(); \ No newline at end of file From ccc29ece06566129cfb426b727361bd35c3247b1 Mon Sep 17 00:00:00 2001 From: Narek Vardzelyan Date: Wed, 11 Nov 2015 11:56:48 +0400 Subject: [PATCH 16/29] Changed Commands class name to CommandFactory, created new method in BehatTestGenerator class to create directories for behat test. --- behat.yml | 6 ++++++ src/BehatTestGenerator.php | 13 +++++++++++-- src/{Commands.php => CommandFactory.php} | 2 +- src/SeleniumFileParser.php | 3 ++- src/SeleniumRCToBehatMinkFormatter.php | 2 +- 5 files changed, 21 insertions(+), 5 deletions(-) create mode 100644 behat.yml rename src/{Commands.php => CommandFactory.php} (99%) diff --git a/behat.yml b/behat.yml new file mode 100644 index 0000000..0e7f00f --- /dev/null +++ b/behat.yml @@ -0,0 +1,6 @@ +default: + extensions: + Behat\MinkExtension\Extension: + base_url: http://16.feature-sd-7626.website.ls.vu/ + goutte: ~ + selenium2: ~ \ No newline at end of file diff --git a/src/BehatTestGenerator.php b/src/BehatTestGenerator.php index e2ab12b..2ee1ca1 100644 --- a/src/BehatTestGenerator.php +++ b/src/BehatTestGenerator.php @@ -39,9 +39,17 @@ protected function getTestFeatureFileName() return str_replace(' ', '_', $this->seleniumIdeTestData['test_name']).'.feature'; } + protected function createFileStructure() + { + $filename = 'features/bootstrap/'; + if (!file_exists($filename)) { + mkdir($filename, 0777,true); + } + } + protected function generateContextFile() { - $fileName = 'FeatureContext.php'; + $fileName = 'features/bootstrap/FeatureContext.php'; $data = <<getTestMethodName()}() protected function generateFeatureFile() { - $fileName = $this->getTestFeatureFileName(); + $fileName = 'features/' . $this->getTestFeatureFileName(); $data = <<getTestName()} Feature description @@ -88,6 +96,7 @@ protected function generateFeatureFile() public function generate() { + $this->createFileStructure(); $this->generateContextFile(); $this->generateFeatureFile(); } diff --git a/src/Commands.php b/src/CommandFactory.php similarity index 99% rename from src/Commands.php rename to src/CommandFactory.php index b6001b9..49300b9 100644 --- a/src/Commands.php +++ b/src/CommandFactory.php @@ -7,7 +7,7 @@ use Exception; -class Commands +class CommandFactory { public function __construct() { diff --git a/src/SeleniumFileParser.php b/src/SeleniumFileParser.php index 60d76bc..7d829e4 100644 --- a/src/SeleniumFileParser.php +++ b/src/SeleniumFileParser.php @@ -3,6 +3,7 @@ namespace Fouraitch; use Exception; +use DOMDocument; /** * The class parses Selenium Ide html test file @@ -16,7 +17,7 @@ class SeleniumFileParser { public function __construct($filePath) { $this->filePath = $filePath; - $this->xml = new \DOMDocument('1.0', 'UTF-8'); + $this->xml = new DOMDocument('1.0', 'UTF-8'); $this->xml->load($filePath); } diff --git a/src/SeleniumRCToBehatMinkFormatter.php b/src/SeleniumRCToBehatMinkFormatter.php index 30e916f..a4d9290 100644 --- a/src/SeleniumRCToBehatMinkFormatter.php +++ b/src/SeleniumRCToBehatMinkFormatter.php @@ -18,7 +18,7 @@ public function __construct($seleniumIdeTestData) protected function getCommandByName($command) { - return Commands::build($command['name'], $command); + return CommandFactory::build($command['name'], $command); } public function format() From 383b0570d50bfc023bfa310176e2e752655fb460 Mon Sep 17 00:00:00 2001 From: Narek Vardzelyan Date: Wed, 11 Nov 2015 16:29:11 +0400 Subject: [PATCH 17/29] Changed command classes now they find out what type has selector and generates appropriate Mink method. --- .gitignore | 1 + src/BehatTestGenerator.php | 2 +- src/CommandFactory.php | 54 ++++++++++++++++++++++++++++++++------ 3 files changed, 48 insertions(+), 9 deletions(-) diff --git a/.gitignore b/.gitignore index b076319..e47df09 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ /nbproject/ /vendor/ /bin/ +/features/ diff --git a/src/BehatTestGenerator.php b/src/BehatTestGenerator.php index 2ee1ca1..8ff2667 100644 --- a/src/BehatTestGenerator.php +++ b/src/BehatTestGenerator.php @@ -73,7 +73,7 @@ public function __construct(array \$parameters) public function {$this->getTestMethodName()}() { - {$this->seleniumRCToBehatMinkFormatter->format()} + {$this->seleniumRCToBehatMinkFormatter->format()} } } FILE; diff --git a/src/CommandFactory.php b/src/CommandFactory.php index 49300b9..63decf6 100644 --- a/src/CommandFactory.php +++ b/src/CommandFactory.php @@ -49,8 +49,15 @@ class Type extends BaseCommand { public function toBehatMink() { - return "\t\$this->getSession()->fillFields(\"{$this->command['target']}\", " - . "\"{$this->command['value']}\");\n"; + $selectorType = strstr($this->command['target'], '=', true); + $selector = substr( + $this->command['target'], + strpos($this->command['target'], '=') + 1 + ); + if ($selectorType === 'id') { + return "\t\$this->getSession()->fillField(\"{$selector}\", " + . "\"{$this->command['value']}\");\n"; + } } } @@ -58,7 +65,22 @@ class Click extends BaseCommand { public function toBehatMink() { - return "\t\$this->getSession()->clicLink(\"{$this->command['target']}\");\n"; + $selectorType = strstr($this->command['target'], '=', true); + $selector = substr( + $this->command['target'], + strpos($this->command['target'], '=') + 1 + ); + if ($selectorType === 'id' || $selectorType === 'title' || + $selectorType === 'alt' || $selectorType === 'text' + ) { + return "\t\$this->getSession()->clicLink(\"{$selector}\");\n"; + } + if ($selectorType === 'css') { + + } + if ($selectorType === 'xpath') { + + } } } @@ -67,7 +89,7 @@ class ClickAndWait extends BaseCommand public function toBehatMink() { return "\t\$this->getSession()->pressButton(\"{$this->command['target']}\");\n" - . "\t\$this->getSession()->wait();\n"; + . "\t\$this->getSession()->wait(5000);\n"; } } @@ -84,8 +106,15 @@ class SendKeys extends BaseCommand { public function toBehatMink() { - return "\t\$this->getSession()->fillFields(\"{$this->command['target']}\", " - . "\"{$this->command['value']}\");\n"; + $selectorType = strstr($this->command['target'], '=', true); + $selector = substr( + $this->command['target'], + strpos($this->command['target'], '=') + 1 + ); + if ($selectorType === 'id' || $selectorType === 'css') { + return "\t\$this->getSession()->fillField('{$selector}', " + . "'{$this->command['value']}');\n"; + } } } @@ -93,7 +122,16 @@ class WaitForElementPresent extends BaseCommand { public function toBehatMink() { - return "\t\$this->getSession()->wait('target'0000, 'document.getElementById" - . "(\"{$this->command['target']}\")')"; + $selectorType = strstr($this->command['target'], '=', true); + $selector = substr( + $this->command['target'], + strpos($this->command['target'], '=') + 1 + ); + $selector = str_replace('"','\"' , $selector); + $selector = str_replace("'","\'" , $selector); + if ($selectorType === 'id' || $selectorType === 'css') { + return "\t\$this->getSession()->wait(5000, 'document.getElementById" + . "(\"{$selector}\")');\n"; + } } } From 32e87352c4213d63c76c6007f489cdae96faa337 Mon Sep 17 00:00:00 2001 From: Narek Vardzelyan Date: Wed, 11 Nov 2015 20:24:28 +0400 Subject: [PATCH 18/29] Changed Behat and Mink versions, changed SeleniumIde command's formatter's logic. --- behat.yml | 14 +- composer.json | 4 +- composer.lock | 682 +++++++++++++++++++------------------ src/BehatTestGenerator.php | 9 +- src/CommandFactory.php | 77 +++-- test.php | 3 +- 6 files changed, 423 insertions(+), 366 deletions(-) diff --git a/behat.yml b/behat.yml index 0e7f00f..0dc5a14 100644 --- a/behat.yml +++ b/behat.yml @@ -1,6 +1,12 @@ default: extensions: - Behat\MinkExtension\Extension: - base_url: http://16.feature-sd-7626.website.ls.vu/ - goutte: ~ - selenium2: ~ \ No newline at end of file + Behat\MinkExtension: +# base_url: http://16.feature-sd-7626.website.ls.vu/ +# goutte: ~ + selenium2: ~ + suites: + default: + contexts: + - FeatureContext: + parameters: + base_url: http://php.net \ No newline at end of file diff --git a/composer.json b/composer.json index c14c402..166fffd 100644 --- a/composer.json +++ b/composer.json @@ -7,8 +7,8 @@ } ], "require": { - "behat/behat": "2.4.*@stable", - "behat/mink": "1.4.*@stable", + "behat/behat": "3.*@stable", + "behat/mink": "1.7.*@stable", "behat/mink-extension": "*", "behat/mink-goutte-driver": "*", "behat/mink-selenium2-driver": "*" diff --git a/composer.lock b/composer.lock index a2208ef..3a0a22c 100644 --- a/composer.lock +++ b/composer.lock @@ -4,36 +4,40 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "d13ddedf76a0d6f297bcc7966c4c43ff", - "content-hash": "d6a55bb0d4029706ed1e425d5f08fb6c", + "hash": "b6c4b8404173f94362d31fadd2fe71cd", + "content-hash": "3614d4ff232c2b8e11cc00177f7905e6", "packages": [ { "name": "behat/behat", - "version": "v2.4.6", + "version": "v3.0.15", "source": { "type": "git", "url": "https://github.com/Behat/Behat.git", - "reference": "f1d2964667cf4b21bb6c2c1564f26829a6954155" + "reference": "b35ae3d45332d80c532af69cc36f780a9397a996" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Behat/Behat/zipball/f1d2964667cf4b21bb6c2c1564f26829a6954155", - "reference": "f1d2964667cf4b21bb6c2c1564f26829a6954155", + "url": "https://api.github.com/repos/Behat/Behat/zipball/b35ae3d45332d80c532af69cc36f780a9397a996", + "reference": "b35ae3d45332d80c532af69cc36f780a9397a996", "shasum": "" }, "require": { - "behat/gherkin": "~2.2.9", - "php": ">=5.3.1", - "symfony/config": "~2.0", - "symfony/console": "~2.0", - "symfony/dependency-injection": "~2.0", - "symfony/event-dispatcher": "~2.0", - "symfony/finder": "~2.0", - "symfony/translation": "~2.0", - "symfony/yaml": "~2.0" + "behat/gherkin": "~4.3", + "behat/transliterator": "~1.0", + "ext-mbstring": "*", + "php": ">=5.3.3", + "symfony/class-loader": "~2.1", + "symfony/config": "~2.3", + "symfony/console": "~2.1", + "symfony/dependency-injection": "~2.1", + "symfony/event-dispatcher": "~2.1", + "symfony/translation": "~2.3", + "symfony/yaml": "~2.1" }, "require-dev": { - "phpunit/phpunit": "~3.7.19" + "phpspec/prophecy-phpunit": "~1.0", + "phpunit/phpunit": "~4.0", + "symfony/process": "~2.1" }, "suggest": { "behat/mink-extension": "for integration with Mink testing framework", @@ -46,12 +50,13 @@ "type": "library", "extra": { "branch-alias": { - "dev-develop": "2.4-dev" + "dev-master": "3.0.x-dev" } }, "autoload": { "psr-0": { - "Behat\\Behat": "src/" + "Behat\\Behat": "src/", + "Behat\\Testwork": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -68,44 +73,49 @@ "description": "Scenario-oriented BDD framework for PHP 5.3", "homepage": "http://behat.org/", "keywords": [ + "Agile", "BDD", - "Behat", - "Symfony2" + "ScenarioBDD", + "Scrum", + "StoryBDD", + "User story", + "business", + "development", + "documentation", + "examples", + "symfony", + "testing" ], - "time": "2013-06-06 10:46:48" + "time": "2015-02-22 14:10:33" }, { "name": "behat/gherkin", - "version": "v2.2.9", + "version": "dev-master", "source": { "type": "git", "url": "https://github.com/Behat/Gherkin.git", - "reference": "cca2c477921ca38578d6e9759ea5e450f29c2d8f" + "reference": "6b3f8cf3560dc4909c4cddd4f1af3e1f6e9d80af" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Behat/Gherkin/zipball/cca2c477921ca38578d6e9759ea5e450f29c2d8f", - "reference": "cca2c477921ca38578d6e9759ea5e450f29c2d8f", + "url": "https://api.github.com/repos/Behat/Gherkin/zipball/6b3f8cf3560dc4909c4cddd4f1af3e1f6e9d80af", + "reference": "6b3f8cf3560dc4909c4cddd4f1af3e1f6e9d80af", "shasum": "" }, "require": { - "php": ">=5.3.1", - "symfony/finder": ">=2.0,<2.4-dev" + "php": ">=5.3.1" }, "require-dev": { - "symfony/config": ">=2.0,<2.4-dev", - "symfony/translation": ">=2.0,<2.4-dev", - "symfony/yaml": ">=2.0,<2.4-dev" + "phpunit/phpunit": "~4.0", + "symfony/yaml": "~2.1" }, "suggest": { - "symfony/config": "If you want to use Config component to manage resources", - "symfony/translation": "If you want to use Symfony2 translations adapter", "symfony/yaml": "If you want to parse features, represented in YAML files" }, "type": "library", "extra": { "branch-alias": { - "dev-develop": "2.2-dev" + "dev-master": "4.4-dev" } }, "autoload": { @@ -129,29 +139,33 @@ "keywords": [ "BDD", "Behat", + "Cucumber", "DSL", - "Symfony2", + "gherkin", "parser" ], - "time": "2013-03-02 10:38:40" + "time": "2015-09-29 13:41:19" }, { "name": "behat/mink", - "version": "v1.4.3", + "version": "v1.7.0", "source": { "type": "git", "url": "https://github.com/minkphp/Mink.git", - "reference": "0817070a6e2ec9f475fad9bfb81a962c462eb934" + "reference": "6c129030ec2cc029905cf969a56ca8f087b2dfdf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/minkphp/Mink/zipball/0817070a6e2ec9f475fad9bfb81a962c462eb934", - "reference": "0817070a6e2ec9f475fad9bfb81a962c462eb934", + "url": "https://api.github.com/repos/minkphp/Mink/zipball/6c129030ec2cc029905cf969a56ca8f087b2dfdf", + "reference": "6c129030ec2cc029905cf969a56ca8f087b2dfdf", "shasum": "" }, "require": { "php": ">=5.3.1", - "symfony/css-selector": ">=2.0,<2.4-dev" + "symfony/css-selector": "~2.1" + }, + "require-dev": { + "symfony/phpunit-bridge": "~2.7" }, "suggest": { "behat/mink-browserkit-driver": "extremely fast headless driver for Symfony\\Kernel-based apps (Sf2, Silex)", @@ -162,12 +176,12 @@ "type": "library", "extra": { "branch-alias": { - "dev-develop": "1.4.x-dev" + "dev-master": "1.7.x-dev" } }, "autoload": { - "psr-0": { - "Behat\\Mink": "src/" + "psr-4": { + "Behat\\Mink\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -181,47 +195,48 @@ "homepage": "http://everzet.com" } ], - "description": "Web acceptance testing framework for PHP 5.3", + "description": "Browser controller/emulator abstraction for PHP", "homepage": "http://mink.behat.org/", "keywords": [ "browser", "testing", "web" ], - "time": "2013-03-02 15:53:18" + "time": "2015-09-20 20:24:03" }, { "name": "behat/mink-browserkit-driver", - "version": "v1.0.5", + "version": "dev-master", "source": { "type": "git", "url": "https://github.com/minkphp/MinkBrowserKitDriver.git", - "reference": "f2771b5fc4dbc233859addf37a7d150852f78418" + "reference": "da47df1593dac132f04d24e7277ef40d33d9f201" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/minkphp/MinkBrowserKitDriver/zipball/f2771b5fc4dbc233859addf37a7d150852f78418", - "reference": "f2771b5fc4dbc233859addf37a7d150852f78418", + "url": "https://api.github.com/repos/minkphp/MinkBrowserKitDriver/zipball/da47df1593dac132f04d24e7277ef40d33d9f201", + "reference": "da47df1593dac132f04d24e7277ef40d33d9f201", "shasum": "" }, "require": { - "behat/mink": "~1.4.3", - "php": ">=5.3.1", - "symfony/browser-kit": "~2.0", - "symfony/dom-crawler": "~2.0" + "behat/mink": "~1.7@dev", + "php": ">=5.3.6", + "symfony/browser-kit": "~2.3", + "symfony/dom-crawler": "~2.3" }, "require-dev": { - "silex/silex": "@dev" + "silex/silex": "~1.2", + "symfony/phpunit-bridge": "~2.7" }, "type": "mink-driver", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "1.3.x-dev" } }, "autoload": { - "psr-0": { - "Behat\\Mink\\Driver": "src/" + "psr-4": { + "Behat\\Mink\\Driver\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -243,34 +258,36 @@ "browser", "testing" ], - "time": "2013-04-13 12:17:15" + "time": "2015-09-21 20:56:13" }, { "name": "behat/mink-extension", - "version": "v1.1.4", + "version": "dev-master", "source": { "type": "git", "url": "https://github.com/Behat/MinkExtension.git", - "reference": "b4522f19fe96d423883f2e3650615e19d3a48c05" + "reference": "06e2b99d92e175719d7e841d5be16b7df1a233c5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Behat/MinkExtension/zipball/b4522f19fe96d423883f2e3650615e19d3a48c05", - "reference": "b4522f19fe96d423883f2e3650615e19d3a48c05", + "url": "https://api.github.com/repos/Behat/MinkExtension/zipball/06e2b99d92e175719d7e841d5be16b7df1a233c5", + "reference": "06e2b99d92e175719d7e841d5be16b7df1a233c5", "shasum": "" }, "require": { - "behat/behat": "~2.4.5", - "behat/mink": ">=1.4.3,<1.6-dev", - "php": ">=5.3.2" + "behat/behat": "~3.0,>=3.0.5", + "behat/mink": "~1.5", + "php": ">=5.3.2", + "symfony/config": "~2.2" }, "require-dev": { - "behat/mink-goutte-driver": "~1.0" + "behat/mink-goutte-driver": "~1.1", + "phpspec/phpspec": "~2.0" }, "type": "behat-extension", "extra": { "branch-alias": { - "dev-master": "1.1.x-dev" + "dev-master": "2.1.x-dev" } }, "autoload": { @@ -283,50 +300,57 @@ "MIT" ], "authors": [ + { + "name": "Christophe Coevoet", + "email": "stof@notk.org" + }, { "name": "Konstantin Kudryashov", - "email": "ever.zet@gmail.com", - "homepage": "http://everzet.com" + "email": "ever.zet@gmail.com" } ], "description": "Mink extension for Behat", - "homepage": "http://mink.behat.org", + "homepage": "http://extensions.behat.org/mink", "keywords": [ "browser", "gui", "test", "web" ], - "time": "2013-06-04 12:18:22" + "time": "2015-09-29 17:42:41" }, { "name": "behat/mink-goutte-driver", - "version": "v1.0.9", + "version": "dev-master", "source": { "type": "git", "url": "https://github.com/minkphp/MinkGoutteDriver.git", - "reference": "fa1b073b48761464feb0b05e6825da44b20118d8" + "reference": "c8e254f127d6f2242b994afd4339fb62d471df3f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/minkphp/MinkGoutteDriver/zipball/fa1b073b48761464feb0b05e6825da44b20118d8", - "reference": "fa1b073b48761464feb0b05e6825da44b20118d8", + "url": "https://api.github.com/repos/minkphp/MinkGoutteDriver/zipball/c8e254f127d6f2242b994afd4339fb62d471df3f", + "reference": "c8e254f127d6f2242b994afd4339fb62d471df3f", "shasum": "" }, "require": { - "behat/mink-browserkit-driver": ">=1.0.5,<1.2.0", - "fabpot/goutte": "~1.0.1", + "behat/mink": "~1.6@dev", + "behat/mink-browserkit-driver": "~1.2@dev", + "fabpot/goutte": "~1.0.4|~2.0|~3.1", "php": ">=5.3.1" }, + "require-dev": { + "symfony/phpunit-bridge": "~2.7" + }, "type": "mink-driver", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "1.2.x-dev" } }, "autoload": { - "psr-0": { - "Behat\\Mink\\Driver": "src/" + "psr-4": { + "Behat\\Mink\\Driver\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -348,36 +372,39 @@ "headless", "testing" ], - "time": "2013-07-03 18:43:54" + "time": "2015-09-21 21:31:11" }, { "name": "behat/mink-selenium2-driver", - "version": "v1.0.6", + "version": "dev-master", "source": { "type": "git", "url": "https://github.com/minkphp/MinkSelenium2Driver.git", - "reference": "689f58cc82adc678696942f389d35196fa2453f8" + "reference": "bedbf1999c7ba1bc6921b30ee2eadf383e7ff5c9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/minkphp/MinkSelenium2Driver/zipball/689f58cc82adc678696942f389d35196fa2453f8", - "reference": "689f58cc82adc678696942f389d35196fa2453f8", + "url": "https://api.github.com/repos/minkphp/MinkSelenium2Driver/zipball/bedbf1999c7ba1bc6921b30ee2eadf383e7ff5c9", + "reference": "bedbf1999c7ba1bc6921b30ee2eadf383e7ff5c9", "shasum": "" }, "require": { - "behat/mink": "~1.4.3", - "instaclick/php-webdriver": "~1.0.12", + "behat/mink": "~1.7@dev", + "instaclick/php-webdriver": "~1.1", "php": ">=5.3.1" }, + "require-dev": { + "symfony/phpunit-bridge": "~2.7" + }, "type": "mink-driver", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "1.3.x-dev" } }, "autoload": { - "psr-0": { - "Behat\\Mink\\Driver": "src/" + "psr-4": { + "Behat\\Mink\\Driver\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -406,142 +433,133 @@ "testing", "webdriver" ], - "time": "2013-04-13 12:56:28" + "time": "2015-09-21 21:02:54" }, { - "name": "fabpot/goutte", - "version": "1.0.x-dev", + "name": "behat/transliterator", + "version": "dev-master", "source": { "type": "git", - "url": "https://github.com/FriendsOfPHP/Goutte.git", - "reference": "794b196e76bdd37b5155cdecbad311f0a3b07625" + "url": "https://github.com/Behat/Transliterator.git", + "reference": "868e05be3a9f25ba6424c2dd4849567f50715003" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/FriendsOfPHP/Goutte/zipball/794b196e76bdd37b5155cdecbad311f0a3b07625", - "reference": "794b196e76bdd37b5155cdecbad311f0a3b07625", + "url": "https://api.github.com/repos/Behat/Transliterator/zipball/868e05be3a9f25ba6424c2dd4849567f50715003", + "reference": "868e05be3a9f25ba6424c2dd4849567f50715003", "shasum": "" }, "require": { - "ext-curl": "*", - "guzzle/http": "~3.1", - "php": ">=5.3.0", - "symfony/browser-kit": "~2.1", - "symfony/css-selector": "~2.1", - "symfony/dom-crawler": "~2.1", - "symfony/finder": "~2.1", - "symfony/process": "~2.1" - }, - "require-dev": { - "guzzle/plugin-history": "~3.1", - "guzzle/plugin-mock": "~3.1" + "php": ">=5.3.3" }, - "type": "application", + "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-master": "1.1-dev" } }, "autoload": { "psr-0": { - "Goutte": "." + "Behat\\Transliterator": "src/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - } + "Artistic-1.0" ], - "description": "A simple PHP Web Scraper", - "homepage": "https://github.com/fabpot/Goutte", + "description": "String transliterator", "keywords": [ - "scraper" + "i18n", + "slug", + "transliterator" ], - "time": "2014-10-09 15:52:51" + "time": "2015-09-28 16:26:35" }, { - "name": "guzzle/common", - "version": "v3.9.2", - "target-dir": "Guzzle/Common", + "name": "fabpot/goutte", + "version": "dev-master", "source": { "type": "git", - "url": "https://github.com/Guzzle3/common.git", - "reference": "2e36af7cf2ce3ea1f2d7c2831843b883a8e7b7dc" + "url": "https://github.com/FriendsOfPHP/Goutte.git", + "reference": "3cbc6ed222422a28400e470050f14928a153207e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Guzzle3/common/zipball/2e36af7cf2ce3ea1f2d7c2831843b883a8e7b7dc", - "reference": "2e36af7cf2ce3ea1f2d7c2831843b883a8e7b7dc", + "url": "https://api.github.com/repos/FriendsOfPHP/Goutte/zipball/3cbc6ed222422a28400e470050f14928a153207e", + "reference": "3cbc6ed222422a28400e470050f14928a153207e", "shasum": "" }, "require": { - "php": ">=5.3.2", - "symfony/event-dispatcher": ">=2.1" + "guzzlehttp/guzzle": "^6.0", + "php": ">=5.5.0", + "symfony/browser-kit": "~2.1|~3.0", + "symfony/css-selector": "~2.1|~3.0", + "symfony/dom-crawler": "~2.1|~3.0" }, - "type": "library", + "type": "application", "extra": { "branch-alias": { - "dev-master": "3.7-dev" + "dev-master": "3.1-dev" } }, "autoload": { - "psr-0": { - "Guzzle\\Common": "" + "psr-4": { + "Goutte\\": "Goutte" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], - "description": "Common libraries used by Guzzle", - "homepage": "http://guzzlephp.org/", + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + } + ], + "description": "A simple PHP Web Scraper", + "homepage": "https://github.com/FriendsOfPHP/Goutte", "keywords": [ - "collection", - "common", - "event", - "exception" + "scraper" ], - "abandoned": "guzzle/guzzle", - "time": "2014-08-11 04:32:36" + "time": "2015-11-05 12:58:44" }, { - "name": "guzzle/http", - "version": "v3.9.2", - "target-dir": "Guzzle/Http", + "name": "guzzlehttp/guzzle", + "version": "dev-master", "source": { "type": "git", - "url": "https://github.com/Guzzle3/http.git", - "reference": "1e8dd1e2ba9dc42332396f39fbfab950b2301dc5" + "url": "https://github.com/guzzle/guzzle.git", + "reference": "4f11935f709ef5e279af9da062507e72bd356e1a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Guzzle3/http/zipball/1e8dd1e2ba9dc42332396f39fbfab950b2301dc5", - "reference": "1e8dd1e2ba9dc42332396f39fbfab950b2301dc5", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/4f11935f709ef5e279af9da062507e72bd356e1a", + "reference": "4f11935f709ef5e279af9da062507e72bd356e1a", "shasum": "" }, "require": { - "guzzle/common": "self.version", - "guzzle/parser": "self.version", - "guzzle/stream": "self.version", - "php": ">=5.3.2" + "guzzlehttp/promises": "~1.0", + "guzzlehttp/psr7": "~1.1", + "php": ">=5.5.0" }, - "suggest": { - "ext-curl": "*" + "require-dev": { + "ext-curl": "*", + "phpunit/phpunit": "~4.0", + "psr/log": "~1.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.7-dev" + "dev-master": "6.1-dev" } }, "autoload": { - "psr-0": { - "Guzzle\\Http": "" + "files": [ + "src/functions_include.php" + ], + "psr-4": { + "GuzzleHttp\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -555,95 +573,107 @@ "homepage": "https://github.com/mtdowling" } ], - "description": "HTTP libraries used by Guzzle", + "description": "Guzzle is a PHP HTTP client library", "homepage": "http://guzzlephp.org/", "keywords": [ - "Guzzle", "client", "curl", + "framework", "http", - "http client" + "http client", + "rest", + "web service" ], - "abandoned": "guzzle/guzzle", - "time": "2014-08-11 04:32:36" + "time": "2015-10-27 04:12:26" }, { - "name": "guzzle/parser", - "version": "v3.9.2", - "target-dir": "Guzzle/Parser", + "name": "guzzlehttp/promises", + "version": "dev-master", "source": { "type": "git", - "url": "https://github.com/Guzzle3/parser.git", - "reference": "6874d171318a8e93eb6d224cf85e4678490b625c" + "url": "https://github.com/guzzle/promises.git", + "reference": "b1e1c0d55f8083c71eda2c28c12a228d708294ea" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Guzzle3/parser/zipball/6874d171318a8e93eb6d224cf85e4678490b625c", - "reference": "6874d171318a8e93eb6d224cf85e4678490b625c", + "url": "https://api.github.com/repos/guzzle/promises/zipball/b1e1c0d55f8083c71eda2c28c12a228d708294ea", + "reference": "b1e1c0d55f8083c71eda2c28c12a228d708294ea", "shasum": "" }, "require": { - "php": ">=5.3.2" + "php": ">=5.5.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.7-dev" + "dev-master": "1.0-dev" } }, "autoload": { - "psr-0": { - "Guzzle\\Parser": "" - } + "psr-4": { + "GuzzleHttp\\Promise\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], - "description": "Interchangeable parsers used by Guzzle", - "homepage": "http://guzzlephp.org/", + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + } + ], + "description": "Guzzle promises library", "keywords": [ - "URI Template", - "cookie", - "http", - "message", - "url" + "promise" ], - "abandoned": "guzzle/guzzle", - "time": "2014-02-05 18:29:46" + "time": "2015-10-15 22:28:00" }, { - "name": "guzzle/stream", - "version": "v3.9.2", - "target-dir": "Guzzle/Stream", + "name": "guzzlehttp/psr7", + "version": "1.2.1", "source": { "type": "git", - "url": "https://github.com/Guzzle3/stream.git", - "reference": "60c7fed02e98d2c518dae8f97874c8f4622100f0" + "url": "https://github.com/guzzle/psr7.git", + "reference": "4d0bdbe1206df7440219ce14c972aa57cc5e4982" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Guzzle3/stream/zipball/60c7fed02e98d2c518dae8f97874c8f4622100f0", - "reference": "60c7fed02e98d2c518dae8f97874c8f4622100f0", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/4d0bdbe1206df7440219ce14c972aa57cc5e4982", + "reference": "4d0bdbe1206df7440219ce14c972aa57cc5e4982", "shasum": "" }, "require": { - "guzzle/common": "self.version", - "php": ">=5.3.2" + "php": ">=5.4.0", + "psr/http-message": "~1.0" }, - "suggest": { - "guzzle/http": "To convert Guzzle request objects to PHP streams" + "provide": { + "psr/http-message-implementation": "1.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.7-dev" + "dev-master": "1.0-dev" } }, "autoload": { - "psr-0": { - "Guzzle\\Stream": "" - } + "psr-4": { + "GuzzleHttp\\Psr7\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -656,41 +686,40 @@ "homepage": "https://github.com/mtdowling" } ], - "description": "Guzzle stream wrapper component", - "homepage": "http://guzzlephp.org/", + "description": "PSR-7 message implementation", "keywords": [ - "Guzzle", - "component", - "stream" + "http", + "message", + "stream", + "uri" ], - "abandoned": "guzzle/guzzle", - "time": "2014-05-01 21:36:02" + "time": "2015-11-03 01:34:55" }, { "name": "instaclick/php-webdriver", - "version": "1.0.17", + "version": "dev-master", "source": { "type": "git", "url": "https://github.com/instaclick/php-webdriver.git", - "reference": "47a6019553a7a5b42d35493276ffc2c9252c53d5" + "reference": "bb2bc96d91e6f8c3312a9f6899bb2370f489a638" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/instaclick/php-webdriver/zipball/47a6019553a7a5b42d35493276ffc2c9252c53d5", - "reference": "47a6019553a7a5b42d35493276ffc2c9252c53d5", + "url": "https://api.github.com/repos/instaclick/php-webdriver/zipball/bb2bc96d91e6f8c3312a9f6899bb2370f489a638", + "reference": "bb2bc96d91e6f8c3312a9f6899bb2370f489a638", "shasum": "" }, "require": { "ext-curl": "*", "php": ">=5.3.2" }, - "bin": [ - "bin/webunit" - ], + "require-dev": { + "satooshi/php-coveralls": "dev-master" + }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "1.4.x-dev" } }, "autoload": { @@ -711,7 +740,7 @@ { "name": "Anthon Pang", "email": "apang@softwaredevelopment.ca", - "role": "developer" + "role": "Fork Maintainer" } ], "description": "PHP WebDriver for Selenium 2", @@ -722,7 +751,56 @@ "webdriver", "webtest" ], - "time": "2013-10-04 15:03:51" + "time": "2015-07-03 18:24:04" + }, + { + "name": "psr/http-message", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-message.git", + "reference": "85d63699f0dbedb190bbd4b0d2b9dc707ea4c298" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-message/zipball/85d63699f0dbedb190bbd4b0d2b9dc707ea4c298", + "reference": "85d63699f0dbedb190bbd4b0d2b9dc707ea4c298", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP messages", + "keywords": [ + "http", + "http-message", + "psr", + "psr-7", + "request", + "response" + ], + "time": "2015-05-04 20:22:00" }, { "name": "symfony/browser-kit", @@ -781,6 +859,58 @@ "homepage": "https://symfony.com", "time": "2015-11-02 20:29:24" }, + { + "name": "symfony/class-loader", + "version": "2.8.x-dev", + "source": { + "type": "git", + "url": "https://github.com/symfony/class-loader.git", + "reference": "0dcd6ee72b76f730c12484eb489f2171029201e5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/class-loader/zipball/0dcd6ee72b76f730c12484eb489f2171029201e5", + "reference": "0dcd6ee72b76f730c12484eb489f2171029201e5", + "shasum": "" + }, + "require": { + "php": ">=5.3.9" + }, + "require-dev": { + "symfony/finder": "~2.0,>=2.0.5|~3.0.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\ClassLoader\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony ClassLoader Component", + "homepage": "https://symfony.com", + "time": "2015-10-30 20:15:42" + }, { "name": "symfony/config", "version": "2.8.x-dev", @@ -893,30 +1023,29 @@ }, { "name": "symfony/css-selector", - "version": "2.3.x-dev", - "target-dir": "Symfony/Component/CssSelector", + "version": "2.8.x-dev", "source": { "type": "git", "url": "https://github.com/symfony/css-selector.git", - "reference": "b3639687d986c8c0c81e9bbdc7267032578a2289" + "reference": "b600fec37c0efca08046d481d79e7eabc07108ff" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/css-selector/zipball/b3639687d986c8c0c81e9bbdc7267032578a2289", - "reference": "b3639687d986c8c0c81e9bbdc7267032578a2289", + "url": "https://api.github.com/repos/symfony/css-selector/zipball/b600fec37c0efca08046d481d79e7eabc07108ff", + "reference": "b600fec37c0efca08046d481d79e7eabc07108ff", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=5.3.9" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.3-dev" + "dev-master": "2.8-dev" } }, "autoload": { - "psr-0": { + "psr-4": { "Symfony\\Component\\CssSelector\\": "" }, "exclude-from-classmap": [ @@ -943,7 +1072,7 @@ ], "description": "Symfony CssSelector Component", "homepage": "https://symfony.com", - "time": "2015-10-30 19:48:51" + "time": "2015-10-30 20:15:42" }, { "name": "symfony/dependency-injection", @@ -1172,56 +1301,6 @@ "homepage": "https://symfony.com", "time": "2015-11-10 13:34:42" }, - { - "name": "symfony/finder", - "version": "2.3.x-dev", - "target-dir": "Symfony/Component/Finder", - "source": { - "type": "git", - "url": "https://github.com/symfony/finder.git", - "reference": "9f52ac1ad87a9571dbf4f62dadf9174ca38dce6b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/9f52ac1ad87a9571dbf4f62dadf9174ca38dce6b", - "reference": "9f52ac1ad87a9571dbf4f62dadf9174ca38dce6b", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.3-dev" - } - }, - "autoload": { - "psr-0": { - "Symfony\\Component\\Finder\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Finder Component", - "homepage": "https://symfony.com", - "time": "2015-10-30 19:48:51" - }, { "name": "symfony/polyfill-mbstring", "version": "dev-master", @@ -1278,55 +1357,6 @@ ], "time": "2015-11-04 20:28:58" }, - { - "name": "symfony/process", - "version": "2.8.x-dev", - "source": { - "type": "git", - "url": "https://github.com/symfony/process.git", - "reference": "7d645ea9d254e488bca808f80e3ed3cb6d1bebcd" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/7d645ea9d254e488bca808f80e3ed3cb6d1bebcd", - "reference": "7d645ea9d254e488bca808f80e3ed3cb6d1bebcd", - "shasum": "" - }, - "require": { - "php": ">=5.3.9" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.8-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Process\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Process Component", - "homepage": "https://symfony.com", - "time": "2015-10-30 20:15:42" - }, { "name": "symfony/translation", "version": "2.8.x-dev", diff --git a/src/BehatTestGenerator.php b/src/BehatTestGenerator.php index 8ff2667..6bcfc03 100644 --- a/src/BehatTestGenerator.php +++ b/src/BehatTestGenerator.php @@ -60,6 +60,8 @@ protected function generateContextFile() */ class FeatureContext extends MinkContext { + protected \$BaseUrl; + /** * Initializes context. * Every scenario gets it's own context object. @@ -68,9 +70,12 @@ class FeatureContext extends MinkContext */ public function __construct(array \$parameters) { - // Initialize your context here + \$this->BaseUrl = \$parameters['base_url']; } + /** + * @Given /^{$this->getTestName()}$/ + */ public function {$this->getTestMethodName()}() { {$this->seleniumRCToBehatMinkFormatter->format()} @@ -89,7 +94,7 @@ protected function generateFeatureFile() @javascript Scenario: {$this->getTestName()} - {$this->getTestName()} + Given {$this->getTestName()} FILE; file_put_contents($fileName, $data); } diff --git a/src/CommandFactory.php b/src/CommandFactory.php index 63decf6..6b3d241 100644 --- a/src/CommandFactory.php +++ b/src/CommandFactory.php @@ -30,18 +30,53 @@ public static function build($type, $command) abstract class BaseCommand { protected $command; + protected static $isPageCreated = false; public function __construct($command) { $this->command = $command; } abstract public function toBehatMink(); + protected function getElementByTarget($target) + { + $selectorType = strstr($target, '=', true); + $selector = str_replace("'", "\'", substr($target, strpos($target, '=') + 1)); + $result = ''; + if (!self::$isPageCreated) { + $result = "\t\$page = \$this->getSession()->getPage();\n"; + self::$isPageCreated = true; + } + if ($selectorType === 'id') { + return $result . "\t\$element = \$page->fileById('{$selector}');\n"; + } + if ($selectorType === 'css') { + return $result . "\t\$element = \$page->find('css', '{$selector}');\n"; + } + if ($selectorType === 'link') { + return $result . "\t\$escapedValue = \$this->getSession()->getSelectorsHandler()->xpathLiteral('{$selector}');\n" + . "\t\$element = \$page->find('named', array('link', \$escapedValue));\n"; + } + if ($selectorType === 'name') { + return $result . "\t\$escapedValue = \$this->getSession()->getSelectorsHandler()->xpathLiteral('{$selector}');\n" + . "\t\$element = \$page->find('named', array('id_or_name', \$escapedValue));\n"; + } + if ($selectorType === 'xpath') { + return $result . "\t\$element = \$page->find('xpath', '{$selector}');\n"; + } + if (strstr($selector, 'document.') === 0) { + return "\t\$element = \$this->getSession()->evaluateScript('{$selector}');\n"; + } + if (strstr($selector, '//') === 0) { + return $result . "\t\$element = \$page->find('xpath', '{$selector}');\n"; + } + return $result . "\t\$element = \$page->fileById('{$selector}');\n"; + } } class Open extends BaseCommand { public function toBehatMink() { - return "\t\$this->getSession()->visit(\"{$this->command['target']}\");\n"; + return "\t\$this->getSession()->visit(\$this->BaseUrl . \"{$this->command['target']}\");\n\n"; } } @@ -49,15 +84,8 @@ class Type extends BaseCommand { public function toBehatMink() { - $selectorType = strstr($this->command['target'], '=', true); - $selector = substr( - $this->command['target'], - strpos($this->command['target'], '=') + 1 - ); - if ($selectorType === 'id') { - return "\t\$this->getSession()->fillField(\"{$selector}\", " - . "\"{$this->command['value']}\");\n"; - } + return $this->getElementByTarget($this->command['target']) + . "\t\$element->setValue('{$this->command['value']}');\n\n"; } } @@ -65,22 +93,8 @@ class Click extends BaseCommand { public function toBehatMink() { - $selectorType = strstr($this->command['target'], '=', true); - $selector = substr( - $this->command['target'], - strpos($this->command['target'], '=') + 1 - ); - if ($selectorType === 'id' || $selectorType === 'title' || - $selectorType === 'alt' || $selectorType === 'text' - ) { - return "\t\$this->getSession()->clicLink(\"{$selector}\");\n"; - } - if ($selectorType === 'css') { - - } - if ($selectorType === 'xpath') { - - } + return $this->getElementByTarget($this->command['target']). + "\t\$element->click();\n\n"; } } @@ -88,8 +102,9 @@ class ClickAndWait extends BaseCommand { public function toBehatMink() { - return "\t\$this->getSession()->pressButton(\"{$this->command['target']}\");\n" - . "\t\$this->getSession()->wait(5000);\n"; + return $this->getElementByTarget($this->command['target']) + ."\t\$element->click();\n" + . "\t\$this->getSession()->wait(5000);\n\n"; } } @@ -98,7 +113,7 @@ class Select extends BaseCommand public function toBehatMink() { return "\t\$this->getSession()->selectOption(\"{$this->command['target']}\", " - . "\"{$this->command['value']}\");\n"; + . "\"{$this->command['value']}\");\n\n"; } } @@ -113,7 +128,7 @@ public function toBehatMink() ); if ($selectorType === 'id' || $selectorType === 'css') { return "\t\$this->getSession()->fillField('{$selector}', " - . "'{$this->command['value']}');\n"; + . "'{$this->command['value']}');\n\n"; } } } @@ -131,7 +146,7 @@ public function toBehatMink() $selector = str_replace("'","\'" , $selector); if ($selectorType === 'id' || $selectorType === 'css') { return "\t\$this->getSession()->wait(5000, 'document.getElementById" - . "(\"{$selector}\")');\n"; + . "(\"{$selector}\")');\n\n"; } } } diff --git a/test.php b/test.php index 7c624aa..a8e1d0c 100644 --- a/test.php +++ b/test.php @@ -7,6 +7,7 @@ $firstFilePath = '/Users/narek_vardzelyan/Documents/ten hour long Training Session is created.xhtml'; $secondFilePath = '/Users/narek_vardzelyan/Documents/search_wikipedia_html_testcase.html'; +$thirdFilePath = '/Users/narek_vardzelyan/Documents/Testing php_net test two.html'; -$BehatTestGenerator = new Fouraitch\BehatTestGenerator($firstFilePath); +$BehatTestGenerator = new Fouraitch\BehatTestGenerator($thirdFilePath); $BehatTestGenerator->generate(); \ No newline at end of file From e71f79767ee789578a942c911fa105453c4e492d Mon Sep 17 00:00:00 2001 From: Narek Vardzelyan Date: Thu, 12 Nov 2015 20:55:24 +0400 Subject: [PATCH 19/29] Worked on Command Type and Select, but there still are problems with sendKeys. --- src/CommandFactory.php | 50 +++++++++++++++++++++++++++++++++++++----- test.php | 1 + 2 files changed, 46 insertions(+), 5 deletions(-) diff --git a/src/CommandFactory.php b/src/CommandFactory.php index 6b3d241..c5cd547 100644 --- a/src/CommandFactory.php +++ b/src/CommandFactory.php @@ -46,7 +46,7 @@ protected function getElementByTarget($target) self::$isPageCreated = true; } if ($selectorType === 'id') { - return $result . "\t\$element = \$page->fileById('{$selector}');\n"; + return $result . "\t\$element = \$page->findById('{$selector}');\n"; } if ($selectorType === 'css') { return $result . "\t\$element = \$page->find('css', '{$selector}');\n"; @@ -84,8 +84,30 @@ class Type extends BaseCommand { public function toBehatMink() { - return $this->getElementByTarget($this->command['target']) - . "\t\$element->setValue('{$this->command['value']}');\n\n"; + $result = $this->getElementByTarget($this->command['target']) +// . "\t\$element->sendKeys('{$this->command['value']}');\n"; +// . "\t\$element->setValue();\n" + . "\t\$element->focus();\n"; + $valueAsArray = str_split($this->command['value']); + foreach ($valueAsArray as $inputChar) { + $jsToEvaluate = "var keyboardEvent = document.createEvent('KeyboardEvent'); +var initMethod = typeof keyboardEvent.initKeyboardEvent !== 'undefined' ? 'initKeyboardEvent' : 'initKeyEvent'; +keyboardEvent[initMethod]( + 'keypress', // event type : keydown, keyup, keypress + true, // bubbles + true, // cancelable + window, // viewArg: should be window + false, // ctrlKeyArg + false, // altKeyArg + false, // shiftKeyArg + false, // metaKeyArg + 40, // keyCodeArg : unsigned long the virtual key code, else 0 + 0 // charCodeArgs : unsigned long the Unicode character associated with the depressed key, else 0 +); +document.dispatchEvent(keyboardEvent);"; + $result .= "\t\$this->getSession()->evaluateScript(\"{$jsToEvaluate}\");\n"; + } + return $result; } } @@ -112,8 +134,26 @@ class Select extends BaseCommand { public function toBehatMink() { - return "\t\$this->getSession()->selectOption(\"{$this->command['target']}\", " - . "\"{$this->command['value']}\");\n\n"; + $optionValueOrText = substr( + $this->command['value'], + strpos($this->command['value'], '=') + 1 + ); + return $this->getElementByTarget($this->command['target']) + . "\t\$element->selectOption({$optionValueOrText});\n\n"; + } +} + +class SelectAndWait extends BaseCommand +{ + public function toBehatMink() + { + $optionValueOrText = substr( + $this->command['value'], + strpos($this->command['value'], '=') + 1 + ); + return $this->getElementByTarget($this->command['target']) + . "\t\$element->selectOption('{$optionValueOrText}');\n" + . "\t\$this->getSession()->wait(5000);\n\n"; } } diff --git a/test.php b/test.php index a8e1d0c..d60ab1b 100644 --- a/test.php +++ b/test.php @@ -8,6 +8,7 @@ $firstFilePath = '/Users/narek_vardzelyan/Documents/ten hour long Training Session is created.xhtml'; $secondFilePath = '/Users/narek_vardzelyan/Documents/search_wikipedia_html_testcase.html'; $thirdFilePath = '/Users/narek_vardzelyan/Documents/Testing php_net test two.html'; +$fourthFilePath = '/Users/narek_vardzelyan/Documents/Testing php_net test three.html'; $BehatTestGenerator = new Fouraitch\BehatTestGenerator($thirdFilePath); $BehatTestGenerator->generate(); \ No newline at end of file From b119b68e8fde79636110fd38ff46c35ea1210e30 Mon Sep 17 00:00:00 2001 From: Narek Vardzelyan Date: Fri, 13 Nov 2015 12:32:55 +0400 Subject: [PATCH 20/29] Chenged event triger script. --- src/CommandFactory.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/CommandFactory.php b/src/CommandFactory.php index c5cd547..48d11df 100644 --- a/src/CommandFactory.php +++ b/src/CommandFactory.php @@ -90,8 +90,9 @@ public function toBehatMink() . "\t\$element->focus();\n"; $valueAsArray = str_split($this->command['value']); foreach ($valueAsArray as $inputChar) { - $jsToEvaluate = "var keyboardEvent = document.createEvent('KeyboardEvent'); -var initMethod = typeof keyboardEvent.initKeyboardEvent !== 'undefined' ? 'initKeyboardEvent' : 'initKeyEvent'; + $asciiCodeOfInputChar = ord($inputChar); + $jsToEvaluate = "keyboardEvent = document.createEvent('KeyboardEvent'); +initMethod = typeof keyboardEvent.initKeyboardEvent !== 'undefined' ? 'initKeyboardEvent' : 'initKeyEvent'; keyboardEvent[initMethod]( 'keypress', // event type : keydown, keyup, keypress true, // bubbles @@ -101,7 +102,7 @@ public function toBehatMink() false, // altKeyArg false, // shiftKeyArg false, // metaKeyArg - 40, // keyCodeArg : unsigned long the virtual key code, else 0 + {$asciiCodeOfInputChar}, // keyCodeArg : unsigned long the virtual key code, else 0 0 // charCodeArgs : unsigned long the Unicode character associated with the depressed key, else 0 ); document.dispatchEvent(keyboardEvent);"; From 61ee5666dd30400250726d925a146e13f67fb0d7 Mon Sep 17 00:00:00 2001 From: Narek Vardzelyan Date: Fri, 13 Nov 2015 14:23:30 +0400 Subject: [PATCH 21/29] Deleted behat with it's additional extensions. --- composer.json | 10 - composer.lock | 1485 ------------------------------------------------- 2 files changed, 1495 deletions(-) delete mode 100644 composer.lock diff --git a/composer.json b/composer.json index 166fffd..eac7d56 100644 --- a/composer.json +++ b/composer.json @@ -6,17 +6,7 @@ "email": "narek.vardzelyan@of.am" } ], - "require": { - "behat/behat": "3.*@stable", - "behat/mink": "1.7.*@stable", - "behat/mink-extension": "*", - "behat/mink-goutte-driver": "*", - "behat/mink-selenium2-driver": "*" - }, "minimum-stability": "dev", - "config": { - "bin-dir": "bin/" - }, "autoload": { "psr-4": {"Fouraitch\\": "src/"} } diff --git a/composer.lock b/composer.lock deleted file mode 100644 index 3a0a22c..0000000 --- a/composer.lock +++ /dev/null @@ -1,1485 +0,0 @@ -{ - "_readme": [ - "This file locks the dependencies of your project to a known state", - "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", - "This file is @generated automatically" - ], - "hash": "b6c4b8404173f94362d31fadd2fe71cd", - "content-hash": "3614d4ff232c2b8e11cc00177f7905e6", - "packages": [ - { - "name": "behat/behat", - "version": "v3.0.15", - "source": { - "type": "git", - "url": "https://github.com/Behat/Behat.git", - "reference": "b35ae3d45332d80c532af69cc36f780a9397a996" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Behat/Behat/zipball/b35ae3d45332d80c532af69cc36f780a9397a996", - "reference": "b35ae3d45332d80c532af69cc36f780a9397a996", - "shasum": "" - }, - "require": { - "behat/gherkin": "~4.3", - "behat/transliterator": "~1.0", - "ext-mbstring": "*", - "php": ">=5.3.3", - "symfony/class-loader": "~2.1", - "symfony/config": "~2.3", - "symfony/console": "~2.1", - "symfony/dependency-injection": "~2.1", - "symfony/event-dispatcher": "~2.1", - "symfony/translation": "~2.3", - "symfony/yaml": "~2.1" - }, - "require-dev": { - "phpspec/prophecy-phpunit": "~1.0", - "phpunit/phpunit": "~4.0", - "symfony/process": "~2.1" - }, - "suggest": { - "behat/mink-extension": "for integration with Mink testing framework", - "behat/symfony2-extension": "for integration with Symfony2 web framework", - "behat/yii-extension": "for integration with Yii web framework" - }, - "bin": [ - "bin/behat" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0.x-dev" - } - }, - "autoload": { - "psr-0": { - "Behat\\Behat": "src/", - "Behat\\Testwork": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Konstantin Kudryashov", - "email": "ever.zet@gmail.com", - "homepage": "http://everzet.com" - } - ], - "description": "Scenario-oriented BDD framework for PHP 5.3", - "homepage": "http://behat.org/", - "keywords": [ - "Agile", - "BDD", - "ScenarioBDD", - "Scrum", - "StoryBDD", - "User story", - "business", - "development", - "documentation", - "examples", - "symfony", - "testing" - ], - "time": "2015-02-22 14:10:33" - }, - { - "name": "behat/gherkin", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/Behat/Gherkin.git", - "reference": "6b3f8cf3560dc4909c4cddd4f1af3e1f6e9d80af" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Behat/Gherkin/zipball/6b3f8cf3560dc4909c4cddd4f1af3e1f6e9d80af", - "reference": "6b3f8cf3560dc4909c4cddd4f1af3e1f6e9d80af", - "shasum": "" - }, - "require": { - "php": ">=5.3.1" - }, - "require-dev": { - "phpunit/phpunit": "~4.0", - "symfony/yaml": "~2.1" - }, - "suggest": { - "symfony/yaml": "If you want to parse features, represented in YAML files" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.4-dev" - } - }, - "autoload": { - "psr-0": { - "Behat\\Gherkin": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Konstantin Kudryashov", - "email": "ever.zet@gmail.com", - "homepage": "http://everzet.com" - } - ], - "description": "Gherkin DSL parser for PHP 5.3", - "homepage": "http://behat.org/", - "keywords": [ - "BDD", - "Behat", - "Cucumber", - "DSL", - "gherkin", - "parser" - ], - "time": "2015-09-29 13:41:19" - }, - { - "name": "behat/mink", - "version": "v1.7.0", - "source": { - "type": "git", - "url": "https://github.com/minkphp/Mink.git", - "reference": "6c129030ec2cc029905cf969a56ca8f087b2dfdf" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/minkphp/Mink/zipball/6c129030ec2cc029905cf969a56ca8f087b2dfdf", - "reference": "6c129030ec2cc029905cf969a56ca8f087b2dfdf", - "shasum": "" - }, - "require": { - "php": ">=5.3.1", - "symfony/css-selector": "~2.1" - }, - "require-dev": { - "symfony/phpunit-bridge": "~2.7" - }, - "suggest": { - "behat/mink-browserkit-driver": "extremely fast headless driver for Symfony\\Kernel-based apps (Sf2, Silex)", - "behat/mink-goutte-driver": "fast headless driver for any app without JS emulation", - "behat/mink-selenium2-driver": "slow, but JS-enabled driver for any app (requires Selenium2)", - "behat/mink-zombie-driver": "fast and JS-enabled headless driver for any app (requires node.js)" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.7.x-dev" - } - }, - "autoload": { - "psr-4": { - "Behat\\Mink\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Konstantin Kudryashov", - "email": "ever.zet@gmail.com", - "homepage": "http://everzet.com" - } - ], - "description": "Browser controller/emulator abstraction for PHP", - "homepage": "http://mink.behat.org/", - "keywords": [ - "browser", - "testing", - "web" - ], - "time": "2015-09-20 20:24:03" - }, - { - "name": "behat/mink-browserkit-driver", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/minkphp/MinkBrowserKitDriver.git", - "reference": "da47df1593dac132f04d24e7277ef40d33d9f201" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/minkphp/MinkBrowserKitDriver/zipball/da47df1593dac132f04d24e7277ef40d33d9f201", - "reference": "da47df1593dac132f04d24e7277ef40d33d9f201", - "shasum": "" - }, - "require": { - "behat/mink": "~1.7@dev", - "php": ">=5.3.6", - "symfony/browser-kit": "~2.3", - "symfony/dom-crawler": "~2.3" - }, - "require-dev": { - "silex/silex": "~1.2", - "symfony/phpunit-bridge": "~2.7" - }, - "type": "mink-driver", - "extra": { - "branch-alias": { - "dev-master": "1.3.x-dev" - } - }, - "autoload": { - "psr-4": { - "Behat\\Mink\\Driver\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Konstantin Kudryashov", - "email": "ever.zet@gmail.com", - "homepage": "http://everzet.com" - } - ], - "description": "Symfony2 BrowserKit driver for Mink framework", - "homepage": "http://mink.behat.org/", - "keywords": [ - "Mink", - "Symfony2", - "browser", - "testing" - ], - "time": "2015-09-21 20:56:13" - }, - { - "name": "behat/mink-extension", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/Behat/MinkExtension.git", - "reference": "06e2b99d92e175719d7e841d5be16b7df1a233c5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Behat/MinkExtension/zipball/06e2b99d92e175719d7e841d5be16b7df1a233c5", - "reference": "06e2b99d92e175719d7e841d5be16b7df1a233c5", - "shasum": "" - }, - "require": { - "behat/behat": "~3.0,>=3.0.5", - "behat/mink": "~1.5", - "php": ">=5.3.2", - "symfony/config": "~2.2" - }, - "require-dev": { - "behat/mink-goutte-driver": "~1.1", - "phpspec/phpspec": "~2.0" - }, - "type": "behat-extension", - "extra": { - "branch-alias": { - "dev-master": "2.1.x-dev" - } - }, - "autoload": { - "psr-0": { - "Behat\\MinkExtension": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Christophe Coevoet", - "email": "stof@notk.org" - }, - { - "name": "Konstantin Kudryashov", - "email": "ever.zet@gmail.com" - } - ], - "description": "Mink extension for Behat", - "homepage": "http://extensions.behat.org/mink", - "keywords": [ - "browser", - "gui", - "test", - "web" - ], - "time": "2015-09-29 17:42:41" - }, - { - "name": "behat/mink-goutte-driver", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/minkphp/MinkGoutteDriver.git", - "reference": "c8e254f127d6f2242b994afd4339fb62d471df3f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/minkphp/MinkGoutteDriver/zipball/c8e254f127d6f2242b994afd4339fb62d471df3f", - "reference": "c8e254f127d6f2242b994afd4339fb62d471df3f", - "shasum": "" - }, - "require": { - "behat/mink": "~1.6@dev", - "behat/mink-browserkit-driver": "~1.2@dev", - "fabpot/goutte": "~1.0.4|~2.0|~3.1", - "php": ">=5.3.1" - }, - "require-dev": { - "symfony/phpunit-bridge": "~2.7" - }, - "type": "mink-driver", - "extra": { - "branch-alias": { - "dev-master": "1.2.x-dev" - } - }, - "autoload": { - "psr-4": { - "Behat\\Mink\\Driver\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Konstantin Kudryashov", - "email": "ever.zet@gmail.com", - "homepage": "http://everzet.com" - } - ], - "description": "Goutte driver for Mink framework", - "homepage": "http://mink.behat.org/", - "keywords": [ - "browser", - "goutte", - "headless", - "testing" - ], - "time": "2015-09-21 21:31:11" - }, - { - "name": "behat/mink-selenium2-driver", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/minkphp/MinkSelenium2Driver.git", - "reference": "bedbf1999c7ba1bc6921b30ee2eadf383e7ff5c9" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/minkphp/MinkSelenium2Driver/zipball/bedbf1999c7ba1bc6921b30ee2eadf383e7ff5c9", - "reference": "bedbf1999c7ba1bc6921b30ee2eadf383e7ff5c9", - "shasum": "" - }, - "require": { - "behat/mink": "~1.7@dev", - "instaclick/php-webdriver": "~1.1", - "php": ">=5.3.1" - }, - "require-dev": { - "symfony/phpunit-bridge": "~2.7" - }, - "type": "mink-driver", - "extra": { - "branch-alias": { - "dev-master": "1.3.x-dev" - } - }, - "autoload": { - "psr-4": { - "Behat\\Mink\\Driver\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Konstantin Kudryashov", - "email": "ever.zet@gmail.com", - "homepage": "http://everzet.com" - }, - { - "name": "Pete Otaqui", - "email": "pete@otaqui.com", - "homepage": "https://github.com/pete-otaqui" - } - ], - "description": "Selenium2 (WebDriver) driver for Mink framework", - "homepage": "http://mink.behat.org/", - "keywords": [ - "ajax", - "browser", - "javascript", - "selenium", - "testing", - "webdriver" - ], - "time": "2015-09-21 21:02:54" - }, - { - "name": "behat/transliterator", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/Behat/Transliterator.git", - "reference": "868e05be3a9f25ba6424c2dd4849567f50715003" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Behat/Transliterator/zipball/868e05be3a9f25ba6424c2dd4849567f50715003", - "reference": "868e05be3a9f25ba6424c2dd4849567f50715003", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1-dev" - } - }, - "autoload": { - "psr-0": { - "Behat\\Transliterator": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "Artistic-1.0" - ], - "description": "String transliterator", - "keywords": [ - "i18n", - "slug", - "transliterator" - ], - "time": "2015-09-28 16:26:35" - }, - { - "name": "fabpot/goutte", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/FriendsOfPHP/Goutte.git", - "reference": "3cbc6ed222422a28400e470050f14928a153207e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/FriendsOfPHP/Goutte/zipball/3cbc6ed222422a28400e470050f14928a153207e", - "reference": "3cbc6ed222422a28400e470050f14928a153207e", - "shasum": "" - }, - "require": { - "guzzlehttp/guzzle": "^6.0", - "php": ">=5.5.0", - "symfony/browser-kit": "~2.1|~3.0", - "symfony/css-selector": "~2.1|~3.0", - "symfony/dom-crawler": "~2.1|~3.0" - }, - "type": "application", - "extra": { - "branch-alias": { - "dev-master": "3.1-dev" - } - }, - "autoload": { - "psr-4": { - "Goutte\\": "Goutte" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - } - ], - "description": "A simple PHP Web Scraper", - "homepage": "https://github.com/FriendsOfPHP/Goutte", - "keywords": [ - "scraper" - ], - "time": "2015-11-05 12:58:44" - }, - { - "name": "guzzlehttp/guzzle", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/guzzle/guzzle.git", - "reference": "4f11935f709ef5e279af9da062507e72bd356e1a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/4f11935f709ef5e279af9da062507e72bd356e1a", - "reference": "4f11935f709ef5e279af9da062507e72bd356e1a", - "shasum": "" - }, - "require": { - "guzzlehttp/promises": "~1.0", - "guzzlehttp/psr7": "~1.1", - "php": ">=5.5.0" - }, - "require-dev": { - "ext-curl": "*", - "phpunit/phpunit": "~4.0", - "psr/log": "~1.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "6.1-dev" - } - }, - "autoload": { - "files": [ - "src/functions_include.php" - ], - "psr-4": { - "GuzzleHttp\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - } - ], - "description": "Guzzle is a PHP HTTP client library", - "homepage": "http://guzzlephp.org/", - "keywords": [ - "client", - "curl", - "framework", - "http", - "http client", - "rest", - "web service" - ], - "time": "2015-10-27 04:12:26" - }, - { - "name": "guzzlehttp/promises", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/guzzle/promises.git", - "reference": "b1e1c0d55f8083c71eda2c28c12a228d708294ea" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/promises/zipball/b1e1c0d55f8083c71eda2c28c12a228d708294ea", - "reference": "b1e1c0d55f8083c71eda2c28c12a228d708294ea", - "shasum": "" - }, - "require": { - "php": ">=5.5.0" - }, - "require-dev": { - "phpunit/phpunit": "~4.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "autoload": { - "psr-4": { - "GuzzleHttp\\Promise\\": "src/" - }, - "files": [ - "src/functions_include.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - } - ], - "description": "Guzzle promises library", - "keywords": [ - "promise" - ], - "time": "2015-10-15 22:28:00" - }, - { - "name": "guzzlehttp/psr7", - "version": "1.2.1", - "source": { - "type": "git", - "url": "https://github.com/guzzle/psr7.git", - "reference": "4d0bdbe1206df7440219ce14c972aa57cc5e4982" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/4d0bdbe1206df7440219ce14c972aa57cc5e4982", - "reference": "4d0bdbe1206df7440219ce14c972aa57cc5e4982", - "shasum": "" - }, - "require": { - "php": ">=5.4.0", - "psr/http-message": "~1.0" - }, - "provide": { - "psr/http-message-implementation": "1.0" - }, - "require-dev": { - "phpunit/phpunit": "~4.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "autoload": { - "psr-4": { - "GuzzleHttp\\Psr7\\": "src/" - }, - "files": [ - "src/functions_include.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - } - ], - "description": "PSR-7 message implementation", - "keywords": [ - "http", - "message", - "stream", - "uri" - ], - "time": "2015-11-03 01:34:55" - }, - { - "name": "instaclick/php-webdriver", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/instaclick/php-webdriver.git", - "reference": "bb2bc96d91e6f8c3312a9f6899bb2370f489a638" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/instaclick/php-webdriver/zipball/bb2bc96d91e6f8c3312a9f6899bb2370f489a638", - "reference": "bb2bc96d91e6f8c3312a9f6899bb2370f489a638", - "shasum": "" - }, - "require": { - "ext-curl": "*", - "php": ">=5.3.2" - }, - "require-dev": { - "satooshi/php-coveralls": "dev-master" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4.x-dev" - } - }, - "autoload": { - "psr-0": { - "WebDriver": "lib/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "Apache-2.0" - ], - "authors": [ - { - "name": "Justin Bishop", - "email": "jubishop@gmail.com", - "role": "Developer" - }, - { - "name": "Anthon Pang", - "email": "apang@softwaredevelopment.ca", - "role": "Fork Maintainer" - } - ], - "description": "PHP WebDriver for Selenium 2", - "homepage": "http://instaclick.com/", - "keywords": [ - "browser", - "selenium", - "webdriver", - "webtest" - ], - "time": "2015-07-03 18:24:04" - }, - { - "name": "psr/http-message", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/php-fig/http-message.git", - "reference": "85d63699f0dbedb190bbd4b0d2b9dc707ea4c298" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-message/zipball/85d63699f0dbedb190bbd4b0d2b9dc707ea4c298", - "reference": "85d63699f0dbedb190bbd4b0d2b9dc707ea4c298", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Http\\Message\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Common interface for HTTP messages", - "keywords": [ - "http", - "http-message", - "psr", - "psr-7", - "request", - "response" - ], - "time": "2015-05-04 20:22:00" - }, - { - "name": "symfony/browser-kit", - "version": "2.8.x-dev", - "source": { - "type": "git", - "url": "https://github.com/symfony/browser-kit.git", - "reference": "589f32fe4f43155ea303d505171634c45f15e876" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/browser-kit/zipball/589f32fe4f43155ea303d505171634c45f15e876", - "reference": "589f32fe4f43155ea303d505171634c45f15e876", - "shasum": "" - }, - "require": { - "php": ">=5.3.9", - "symfony/dom-crawler": "~2.0,>=2.0.5|~3.0.0" - }, - "require-dev": { - "symfony/css-selector": "~2.0,>=2.0.5|~3.0.0", - "symfony/process": "~2.3.34|~2.7,>=2.7.6|~3.0.0" - }, - "suggest": { - "symfony/process": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.8-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\BrowserKit\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony BrowserKit Component", - "homepage": "https://symfony.com", - "time": "2015-11-02 20:29:24" - }, - { - "name": "symfony/class-loader", - "version": "2.8.x-dev", - "source": { - "type": "git", - "url": "https://github.com/symfony/class-loader.git", - "reference": "0dcd6ee72b76f730c12484eb489f2171029201e5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/class-loader/zipball/0dcd6ee72b76f730c12484eb489f2171029201e5", - "reference": "0dcd6ee72b76f730c12484eb489f2171029201e5", - "shasum": "" - }, - "require": { - "php": ">=5.3.9" - }, - "require-dev": { - "symfony/finder": "~2.0,>=2.0.5|~3.0.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.8-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\ClassLoader\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony ClassLoader Component", - "homepage": "https://symfony.com", - "time": "2015-10-30 20:15:42" - }, - { - "name": "symfony/config", - "version": "2.8.x-dev", - "source": { - "type": "git", - "url": "https://github.com/symfony/config.git", - "reference": "f042c9257b2bdebda285f7a5c089b9348bcb6f3d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/f042c9257b2bdebda285f7a5c089b9348bcb6f3d", - "reference": "f042c9257b2bdebda285f7a5c089b9348bcb6f3d", - "shasum": "" - }, - "require": { - "php": ">=5.3.9", - "symfony/filesystem": "~2.3|~3.0.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.8-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Config\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Config Component", - "homepage": "https://symfony.com", - "time": "2015-11-02 20:29:24" - }, - { - "name": "symfony/console", - "version": "2.8.x-dev", - "source": { - "type": "git", - "url": "https://github.com/symfony/console.git", - "reference": "74bf9202a531cc6942454eb9e2dd1e13bde34a31" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/74bf9202a531cc6942454eb9e2dd1e13bde34a31", - "reference": "74bf9202a531cc6942454eb9e2dd1e13bde34a31", - "shasum": "" - }, - "require": { - "php": ">=5.3.9", - "symfony/polyfill-mbstring": "~1.0" - }, - "require-dev": { - "psr/log": "~1.0", - "symfony/event-dispatcher": "~2.1|~3.0.0", - "symfony/process": "~2.1|~3.0.0" - }, - "suggest": { - "psr/log": "For using the console logger", - "symfony/event-dispatcher": "", - "symfony/process": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.8-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Console\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Console Component", - "homepage": "https://symfony.com", - "time": "2015-11-04 00:47:19" - }, - { - "name": "symfony/css-selector", - "version": "2.8.x-dev", - "source": { - "type": "git", - "url": "https://github.com/symfony/css-selector.git", - "reference": "b600fec37c0efca08046d481d79e7eabc07108ff" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/css-selector/zipball/b600fec37c0efca08046d481d79e7eabc07108ff", - "reference": "b600fec37c0efca08046d481d79e7eabc07108ff", - "shasum": "" - }, - "require": { - "php": ">=5.3.9" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.8-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\CssSelector\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jean-François Simon", - "email": "jeanfrancois.simon@sensiolabs.com" - }, - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony CssSelector Component", - "homepage": "https://symfony.com", - "time": "2015-10-30 20:15:42" - }, - { - "name": "symfony/dependency-injection", - "version": "2.8.x-dev", - "source": { - "type": "git", - "url": "https://github.com/symfony/dependency-injection.git", - "reference": "eae068f6bbae4b10f096d6b3eb90953941a9c0e4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/eae068f6bbae4b10f096d6b3eb90953941a9c0e4", - "reference": "eae068f6bbae4b10f096d6b3eb90953941a9c0e4", - "shasum": "" - }, - "require": { - "php": ">=5.3.9" - }, - "conflict": { - "symfony/expression-language": "<2.6" - }, - "require-dev": { - "symfony/config": "~2.2|~3.0.0", - "symfony/expression-language": "~2.6|~3.0.0", - "symfony/yaml": "~2.1|~3.0.0" - }, - "suggest": { - "symfony/config": "", - "symfony/proxy-manager-bridge": "Generate service proxies to lazy load them", - "symfony/yaml": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.8-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\DependencyInjection\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony DependencyInjection Component", - "homepage": "https://symfony.com", - "time": "2015-11-07 08:30:54" - }, - { - "name": "symfony/dom-crawler", - "version": "2.8.x-dev", - "source": { - "type": "git", - "url": "https://github.com/symfony/dom-crawler.git", - "reference": "740c98235f5b6e2b0b13df2fb97c7a1c7d1a18fc" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/740c98235f5b6e2b0b13df2fb97c7a1c7d1a18fc", - "reference": "740c98235f5b6e2b0b13df2fb97c7a1c7d1a18fc", - "shasum": "" - }, - "require": { - "php": ">=5.3.9", - "symfony/polyfill-mbstring": "~1.0" - }, - "require-dev": { - "symfony/css-selector": "~2.8|~3.0.0" - }, - "suggest": { - "symfony/css-selector": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.8-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\DomCrawler\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony DomCrawler Component", - "homepage": "https://symfony.com", - "time": "2015-11-02 20:29:39" - }, - { - "name": "symfony/event-dispatcher", - "version": "2.8.x-dev", - "source": { - "type": "git", - "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "a5eb815363c0388e83247e7e9853e5dbc14999cc" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/a5eb815363c0388e83247e7e9853e5dbc14999cc", - "reference": "a5eb815363c0388e83247e7e9853e5dbc14999cc", - "shasum": "" - }, - "require": { - "php": ">=5.3.9" - }, - "require-dev": { - "psr/log": "~1.0", - "symfony/config": "~2.0,>=2.0.5|~3.0.0", - "symfony/dependency-injection": "~2.6|~3.0.0", - "symfony/expression-language": "~2.6|~3.0.0", - "symfony/stopwatch": "~2.3|~3.0.0" - }, - "suggest": { - "symfony/dependency-injection": "", - "symfony/http-kernel": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.8-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\EventDispatcher\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony EventDispatcher Component", - "homepage": "https://symfony.com", - "time": "2015-10-30 20:15:42" - }, - { - "name": "symfony/filesystem", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/symfony/filesystem.git", - "reference": "232aa96494f0b44d25c8b7a11163c742e568c1a7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/232aa96494f0b44d25c8b7a11163c742e568c1a7", - "reference": "232aa96494f0b44d25c8b7a11163c742e568c1a7", - "shasum": "" - }, - "require": { - "php": ">=5.5.9" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Filesystem\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Filesystem Component", - "homepage": "https://symfony.com", - "time": "2015-11-10 13:34:42" - }, - { - "name": "symfony/polyfill-mbstring", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "0b6a8940385311a24e060ec1fe35680e17c74497" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/0b6a8940385311a24e060ec1fe35680e17c74497", - "reference": "0b6a8940385311a24e060ec1fe35680e17c74497", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Mbstring\\": "" - }, - "files": [ - "bootstrap.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for the Mbstring extension", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "mbstring", - "polyfill", - "portable", - "shim" - ], - "time": "2015-11-04 20:28:58" - }, - { - "name": "symfony/translation", - "version": "2.8.x-dev", - "source": { - "type": "git", - "url": "https://github.com/symfony/translation.git", - "reference": "98b89a9091dde2af772d4c74a09447d317d1bdf4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/98b89a9091dde2af772d4c74a09447d317d1bdf4", - "reference": "98b89a9091dde2af772d4c74a09447d317d1bdf4", - "shasum": "" - }, - "require": { - "php": ">=5.3.9", - "symfony/polyfill-mbstring": "~1.0" - }, - "conflict": { - "symfony/config": "<2.7" - }, - "require-dev": { - "psr/log": "~1.0", - "symfony/config": "~2.8", - "symfony/intl": "~2.4|~3.0.0", - "symfony/yaml": "~2.2|~3.0.0" - }, - "suggest": { - "psr/log": "To use logging capability in translator", - "symfony/config": "", - "symfony/yaml": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.8-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Translation\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Translation Component", - "homepage": "https://symfony.com", - "time": "2015-10-30 20:15:42" - }, - { - "name": "symfony/yaml", - "version": "2.8.x-dev", - "source": { - "type": "git", - "url": "https://github.com/symfony/yaml.git", - "reference": "5ff00ea2999343d42398fcb793bbfc64c92235ff" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/5ff00ea2999343d42398fcb793bbfc64c92235ff", - "reference": "5ff00ea2999343d42398fcb793bbfc64c92235ff", - "shasum": "" - }, - "require": { - "php": ">=5.3.9" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.8-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Yaml\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Yaml Component", - "homepage": "https://symfony.com", - "time": "2015-11-05 09:04:44" - } - ], - "packages-dev": [], - "aliases": [], - "minimum-stability": "dev", - "stability-flags": { - "behat/behat": 0, - "behat/mink": 0 - }, - "prefer-stable": false, - "prefer-lowest": false, - "platform": [], - "platform-dev": [] -} From 34e12263ee9b53346413737eb8f0b9c8f5727e0b Mon Sep 17 00:00:00 2001 From: Narek Vardzelyan Date: Fri, 13 Nov 2015 18:13:21 +0400 Subject: [PATCH 22/29] Added version to the package. --- composer.json | 1 + 1 file changed, 1 insertion(+) diff --git a/composer.json b/composer.json index eac7d56..f538042 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,6 @@ { "name": "fouraitch/selenium-ide-php-behat-mink-formatter", + "version": "1.0", "authors": [ { "name": "Narek Vardzelyan", From ef546e3d9e1dd317d2af1ae3979a0a4f62b87f98 Mon Sep 17 00:00:00 2001 From: Narek Vardzelyan Date: Mon, 16 Nov 2015 10:40:23 +0400 Subject: [PATCH 23/29] Wrote new test for github.com, added new command classes Type and TypeAndWait. --- behat.yml | 2 +- composer.json | 10 + composer.lock | 1485 ++++++++++++++++++++++++++++++++++++++++ src/CommandFactory.php | 119 ++-- test.php | 3 +- 5 files changed, 1568 insertions(+), 51 deletions(-) create mode 100644 composer.lock diff --git a/behat.yml b/behat.yml index 0dc5a14..cf0e3c4 100644 --- a/behat.yml +++ b/behat.yml @@ -9,4 +9,4 @@ default: contexts: - FeatureContext: parameters: - base_url: http://php.net \ No newline at end of file + base_url: http://github.com \ No newline at end of file diff --git a/composer.json b/composer.json index f538042..0b05b49 100644 --- a/composer.json +++ b/composer.json @@ -7,7 +7,17 @@ "email": "narek.vardzelyan@of.am" } ], + "require": { + "behat/behat": "3.*@stable", + "behat/mink": "1.7.*@stable", + "behat/mink-extension": "*", + "behat/mink-goutte-driver": "*", + "behat/mink-selenium2-driver": "*" + }, "minimum-stability": "dev", + "config": { + "bin-dir": "bin/" + }, "autoload": { "psr-4": {"Fouraitch\\": "src/"} } diff --git a/composer.lock b/composer.lock new file mode 100644 index 0000000..17b47e7 --- /dev/null +++ b/composer.lock @@ -0,0 +1,1485 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", + "This file is @generated automatically" + ], + "hash": "6b84543bb0ab3481585d6ee572eb8d42", + "content-hash": "46cb555fc5c5451b5e1b435a59bd519e", + "packages": [ + { + "name": "behat/behat", + "version": "v3.0.15", + "source": { + "type": "git", + "url": "https://github.com/Behat/Behat.git", + "reference": "b35ae3d45332d80c532af69cc36f780a9397a996" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Behat/Behat/zipball/b35ae3d45332d80c532af69cc36f780a9397a996", + "reference": "b35ae3d45332d80c532af69cc36f780a9397a996", + "shasum": "" + }, + "require": { + "behat/gherkin": "~4.3", + "behat/transliterator": "~1.0", + "ext-mbstring": "*", + "php": ">=5.3.3", + "symfony/class-loader": "~2.1", + "symfony/config": "~2.3", + "symfony/console": "~2.1", + "symfony/dependency-injection": "~2.1", + "symfony/event-dispatcher": "~2.1", + "symfony/translation": "~2.3", + "symfony/yaml": "~2.1" + }, + "require-dev": { + "phpspec/prophecy-phpunit": "~1.0", + "phpunit/phpunit": "~4.0", + "symfony/process": "~2.1" + }, + "suggest": { + "behat/mink-extension": "for integration with Mink testing framework", + "behat/symfony2-extension": "for integration with Symfony2 web framework", + "behat/yii-extension": "for integration with Yii web framework" + }, + "bin": [ + "bin/behat" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0.x-dev" + } + }, + "autoload": { + "psr-0": { + "Behat\\Behat": "src/", + "Behat\\Testwork": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Konstantin Kudryashov", + "email": "ever.zet@gmail.com", + "homepage": "http://everzet.com" + } + ], + "description": "Scenario-oriented BDD framework for PHP 5.3", + "homepage": "http://behat.org/", + "keywords": [ + "Agile", + "BDD", + "ScenarioBDD", + "Scrum", + "StoryBDD", + "User story", + "business", + "development", + "documentation", + "examples", + "symfony", + "testing" + ], + "time": "2015-02-22 14:10:33" + }, + { + "name": "behat/gherkin", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/Behat/Gherkin.git", + "reference": "6b3f8cf3560dc4909c4cddd4f1af3e1f6e9d80af" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Behat/Gherkin/zipball/6b3f8cf3560dc4909c4cddd4f1af3e1f6e9d80af", + "reference": "6b3f8cf3560dc4909c4cddd4f1af3e1f6e9d80af", + "shasum": "" + }, + "require": { + "php": ">=5.3.1" + }, + "require-dev": { + "phpunit/phpunit": "~4.0", + "symfony/yaml": "~2.1" + }, + "suggest": { + "symfony/yaml": "If you want to parse features, represented in YAML files" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.4-dev" + } + }, + "autoload": { + "psr-0": { + "Behat\\Gherkin": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Konstantin Kudryashov", + "email": "ever.zet@gmail.com", + "homepage": "http://everzet.com" + } + ], + "description": "Gherkin DSL parser for PHP 5.3", + "homepage": "http://behat.org/", + "keywords": [ + "BDD", + "Behat", + "Cucumber", + "DSL", + "gherkin", + "parser" + ], + "time": "2015-09-29 13:41:19" + }, + { + "name": "behat/mink", + "version": "v1.7.0", + "source": { + "type": "git", + "url": "https://github.com/minkphp/Mink.git", + "reference": "6c129030ec2cc029905cf969a56ca8f087b2dfdf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/minkphp/Mink/zipball/6c129030ec2cc029905cf969a56ca8f087b2dfdf", + "reference": "6c129030ec2cc029905cf969a56ca8f087b2dfdf", + "shasum": "" + }, + "require": { + "php": ">=5.3.1", + "symfony/css-selector": "~2.1" + }, + "require-dev": { + "symfony/phpunit-bridge": "~2.7" + }, + "suggest": { + "behat/mink-browserkit-driver": "extremely fast headless driver for Symfony\\Kernel-based apps (Sf2, Silex)", + "behat/mink-goutte-driver": "fast headless driver for any app without JS emulation", + "behat/mink-selenium2-driver": "slow, but JS-enabled driver for any app (requires Selenium2)", + "behat/mink-zombie-driver": "fast and JS-enabled headless driver for any app (requires node.js)" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.7.x-dev" + } + }, + "autoload": { + "psr-4": { + "Behat\\Mink\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Konstantin Kudryashov", + "email": "ever.zet@gmail.com", + "homepage": "http://everzet.com" + } + ], + "description": "Browser controller/emulator abstraction for PHP", + "homepage": "http://mink.behat.org/", + "keywords": [ + "browser", + "testing", + "web" + ], + "time": "2015-09-20 20:24:03" + }, + { + "name": "behat/mink-browserkit-driver", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/minkphp/MinkBrowserKitDriver.git", + "reference": "da47df1593dac132f04d24e7277ef40d33d9f201" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/minkphp/MinkBrowserKitDriver/zipball/da47df1593dac132f04d24e7277ef40d33d9f201", + "reference": "da47df1593dac132f04d24e7277ef40d33d9f201", + "shasum": "" + }, + "require": { + "behat/mink": "~1.7@dev", + "php": ">=5.3.6", + "symfony/browser-kit": "~2.3", + "symfony/dom-crawler": "~2.3" + }, + "require-dev": { + "silex/silex": "~1.2", + "symfony/phpunit-bridge": "~2.7" + }, + "type": "mink-driver", + "extra": { + "branch-alias": { + "dev-master": "1.3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Behat\\Mink\\Driver\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Konstantin Kudryashov", + "email": "ever.zet@gmail.com", + "homepage": "http://everzet.com" + } + ], + "description": "Symfony2 BrowserKit driver for Mink framework", + "homepage": "http://mink.behat.org/", + "keywords": [ + "Mink", + "Symfony2", + "browser", + "testing" + ], + "time": "2015-09-21 20:56:13" + }, + { + "name": "behat/mink-extension", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/Behat/MinkExtension.git", + "reference": "06e2b99d92e175719d7e841d5be16b7df1a233c5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Behat/MinkExtension/zipball/06e2b99d92e175719d7e841d5be16b7df1a233c5", + "reference": "06e2b99d92e175719d7e841d5be16b7df1a233c5", + "shasum": "" + }, + "require": { + "behat/behat": "~3.0,>=3.0.5", + "behat/mink": "~1.5", + "php": ">=5.3.2", + "symfony/config": "~2.2" + }, + "require-dev": { + "behat/mink-goutte-driver": "~1.1", + "phpspec/phpspec": "~2.0" + }, + "type": "behat-extension", + "extra": { + "branch-alias": { + "dev-master": "2.1.x-dev" + } + }, + "autoload": { + "psr-0": { + "Behat\\MinkExtension": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christophe Coevoet", + "email": "stof@notk.org" + }, + { + "name": "Konstantin Kudryashov", + "email": "ever.zet@gmail.com" + } + ], + "description": "Mink extension for Behat", + "homepage": "http://extensions.behat.org/mink", + "keywords": [ + "browser", + "gui", + "test", + "web" + ], + "time": "2015-09-29 17:42:41" + }, + { + "name": "behat/mink-goutte-driver", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/minkphp/MinkGoutteDriver.git", + "reference": "c8e254f127d6f2242b994afd4339fb62d471df3f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/minkphp/MinkGoutteDriver/zipball/c8e254f127d6f2242b994afd4339fb62d471df3f", + "reference": "c8e254f127d6f2242b994afd4339fb62d471df3f", + "shasum": "" + }, + "require": { + "behat/mink": "~1.6@dev", + "behat/mink-browserkit-driver": "~1.2@dev", + "fabpot/goutte": "~1.0.4|~2.0|~3.1", + "php": ">=5.3.1" + }, + "require-dev": { + "symfony/phpunit-bridge": "~2.7" + }, + "type": "mink-driver", + "extra": { + "branch-alias": { + "dev-master": "1.2.x-dev" + } + }, + "autoload": { + "psr-4": { + "Behat\\Mink\\Driver\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Konstantin Kudryashov", + "email": "ever.zet@gmail.com", + "homepage": "http://everzet.com" + } + ], + "description": "Goutte driver for Mink framework", + "homepage": "http://mink.behat.org/", + "keywords": [ + "browser", + "goutte", + "headless", + "testing" + ], + "time": "2015-09-21 21:31:11" + }, + { + "name": "behat/mink-selenium2-driver", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/minkphp/MinkSelenium2Driver.git", + "reference": "bedbf1999c7ba1bc6921b30ee2eadf383e7ff5c9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/minkphp/MinkSelenium2Driver/zipball/bedbf1999c7ba1bc6921b30ee2eadf383e7ff5c9", + "reference": "bedbf1999c7ba1bc6921b30ee2eadf383e7ff5c9", + "shasum": "" + }, + "require": { + "behat/mink": "~1.7@dev", + "instaclick/php-webdriver": "~1.1", + "php": ">=5.3.1" + }, + "require-dev": { + "symfony/phpunit-bridge": "~2.7" + }, + "type": "mink-driver", + "extra": { + "branch-alias": { + "dev-master": "1.3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Behat\\Mink\\Driver\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Konstantin Kudryashov", + "email": "ever.zet@gmail.com", + "homepage": "http://everzet.com" + }, + { + "name": "Pete Otaqui", + "email": "pete@otaqui.com", + "homepage": "https://github.com/pete-otaqui" + } + ], + "description": "Selenium2 (WebDriver) driver for Mink framework", + "homepage": "http://mink.behat.org/", + "keywords": [ + "ajax", + "browser", + "javascript", + "selenium", + "testing", + "webdriver" + ], + "time": "2015-09-21 21:02:54" + }, + { + "name": "behat/transliterator", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/Behat/Transliterator.git", + "reference": "868e05be3a9f25ba6424c2dd4849567f50715003" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Behat/Transliterator/zipball/868e05be3a9f25ba6424c2dd4849567f50715003", + "reference": "868e05be3a9f25ba6424c2dd4849567f50715003", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1-dev" + } + }, + "autoload": { + "psr-0": { + "Behat\\Transliterator": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Artistic-1.0" + ], + "description": "String transliterator", + "keywords": [ + "i18n", + "slug", + "transliterator" + ], + "time": "2015-09-28 16:26:35" + }, + { + "name": "fabpot/goutte", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/FriendsOfPHP/Goutte.git", + "reference": "3cbc6ed222422a28400e470050f14928a153207e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/FriendsOfPHP/Goutte/zipball/3cbc6ed222422a28400e470050f14928a153207e", + "reference": "3cbc6ed222422a28400e470050f14928a153207e", + "shasum": "" + }, + "require": { + "guzzlehttp/guzzle": "^6.0", + "php": ">=5.5.0", + "symfony/browser-kit": "~2.1|~3.0", + "symfony/css-selector": "~2.1|~3.0", + "symfony/dom-crawler": "~2.1|~3.0" + }, + "type": "application", + "extra": { + "branch-alias": { + "dev-master": "3.1-dev" + } + }, + "autoload": { + "psr-4": { + "Goutte\\": "Goutte" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + } + ], + "description": "A simple PHP Web Scraper", + "homepage": "https://github.com/FriendsOfPHP/Goutte", + "keywords": [ + "scraper" + ], + "time": "2015-11-05 12:58:44" + }, + { + "name": "guzzlehttp/guzzle", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/guzzle/guzzle.git", + "reference": "a21d3ccb7ea39a5256079adaa7f0901fde02a5b0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/a21d3ccb7ea39a5256079adaa7f0901fde02a5b0", + "reference": "a21d3ccb7ea39a5256079adaa7f0901fde02a5b0", + "shasum": "" + }, + "require": { + "guzzlehttp/promises": "~1.0", + "guzzlehttp/psr7": "~1.1", + "php": ">=5.5.0" + }, + "require-dev": { + "ext-curl": "*", + "phpunit/phpunit": "~4.0", + "psr/log": "~1.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "6.1-dev" + } + }, + "autoload": { + "files": [ + "src/functions_include.php" + ], + "psr-4": { + "GuzzleHttp\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + } + ], + "description": "Guzzle is a PHP HTTP client library", + "homepage": "http://guzzlephp.org/", + "keywords": [ + "client", + "curl", + "framework", + "http", + "http client", + "rest", + "web service" + ], + "time": "2015-11-15 09:29:07" + }, + { + "name": "guzzlehttp/promises", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/guzzle/promises.git", + "reference": "b1e1c0d55f8083c71eda2c28c12a228d708294ea" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/promises/zipball/b1e1c0d55f8083c71eda2c28c12a228d708294ea", + "reference": "b1e1c0d55f8083c71eda2c28c12a228d708294ea", + "shasum": "" + }, + "require": { + "php": ">=5.5.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Promise\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + } + ], + "description": "Guzzle promises library", + "keywords": [ + "promise" + ], + "time": "2015-10-15 22:28:00" + }, + { + "name": "guzzlehttp/psr7", + "version": "1.2.1", + "source": { + "type": "git", + "url": "https://github.com/guzzle/psr7.git", + "reference": "4d0bdbe1206df7440219ce14c972aa57cc5e4982" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/4d0bdbe1206df7440219ce14c972aa57cc5e4982", + "reference": "4d0bdbe1206df7440219ce14c972aa57cc5e4982", + "shasum": "" + }, + "require": { + "php": ">=5.4.0", + "psr/http-message": "~1.0" + }, + "provide": { + "psr/http-message-implementation": "1.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Psr7\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + } + ], + "description": "PSR-7 message implementation", + "keywords": [ + "http", + "message", + "stream", + "uri" + ], + "time": "2015-11-03 01:34:55" + }, + { + "name": "instaclick/php-webdriver", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/instaclick/php-webdriver.git", + "reference": "bb2bc96d91e6f8c3312a9f6899bb2370f489a638" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/instaclick/php-webdriver/zipball/bb2bc96d91e6f8c3312a9f6899bb2370f489a638", + "reference": "bb2bc96d91e6f8c3312a9f6899bb2370f489a638", + "shasum": "" + }, + "require": { + "ext-curl": "*", + "php": ">=5.3.2" + }, + "require-dev": { + "satooshi/php-coveralls": "dev-master" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4.x-dev" + } + }, + "autoload": { + "psr-0": { + "WebDriver": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "Justin Bishop", + "email": "jubishop@gmail.com", + "role": "Developer" + }, + { + "name": "Anthon Pang", + "email": "apang@softwaredevelopment.ca", + "role": "Fork Maintainer" + } + ], + "description": "PHP WebDriver for Selenium 2", + "homepage": "http://instaclick.com/", + "keywords": [ + "browser", + "selenium", + "webdriver", + "webtest" + ], + "time": "2015-07-03 18:24:04" + }, + { + "name": "psr/http-message", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-message.git", + "reference": "85d63699f0dbedb190bbd4b0d2b9dc707ea4c298" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-message/zipball/85d63699f0dbedb190bbd4b0d2b9dc707ea4c298", + "reference": "85d63699f0dbedb190bbd4b0d2b9dc707ea4c298", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP messages", + "keywords": [ + "http", + "http-message", + "psr", + "psr-7", + "request", + "response" + ], + "time": "2015-05-04 20:22:00" + }, + { + "name": "symfony/browser-kit", + "version": "2.8.x-dev", + "source": { + "type": "git", + "url": "https://github.com/symfony/browser-kit.git", + "reference": "589f32fe4f43155ea303d505171634c45f15e876" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/browser-kit/zipball/589f32fe4f43155ea303d505171634c45f15e876", + "reference": "589f32fe4f43155ea303d505171634c45f15e876", + "shasum": "" + }, + "require": { + "php": ">=5.3.9", + "symfony/dom-crawler": "~2.0,>=2.0.5|~3.0.0" + }, + "require-dev": { + "symfony/css-selector": "~2.0,>=2.0.5|~3.0.0", + "symfony/process": "~2.3.34|~2.7,>=2.7.6|~3.0.0" + }, + "suggest": { + "symfony/process": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\BrowserKit\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony BrowserKit Component", + "homepage": "https://symfony.com", + "time": "2015-11-02 20:29:24" + }, + { + "name": "symfony/class-loader", + "version": "2.8.x-dev", + "source": { + "type": "git", + "url": "https://github.com/symfony/class-loader.git", + "reference": "0dcd6ee72b76f730c12484eb489f2171029201e5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/class-loader/zipball/0dcd6ee72b76f730c12484eb489f2171029201e5", + "reference": "0dcd6ee72b76f730c12484eb489f2171029201e5", + "shasum": "" + }, + "require": { + "php": ">=5.3.9" + }, + "require-dev": { + "symfony/finder": "~2.0,>=2.0.5|~3.0.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\ClassLoader\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony ClassLoader Component", + "homepage": "https://symfony.com", + "time": "2015-10-30 20:15:42" + }, + { + "name": "symfony/config", + "version": "2.8.x-dev", + "source": { + "type": "git", + "url": "https://github.com/symfony/config.git", + "reference": "f042c9257b2bdebda285f7a5c089b9348bcb6f3d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/config/zipball/f042c9257b2bdebda285f7a5c089b9348bcb6f3d", + "reference": "f042c9257b2bdebda285f7a5c089b9348bcb6f3d", + "shasum": "" + }, + "require": { + "php": ">=5.3.9", + "symfony/filesystem": "~2.3|~3.0.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Config\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Config Component", + "homepage": "https://symfony.com", + "time": "2015-11-02 20:29:24" + }, + { + "name": "symfony/console", + "version": "2.8.x-dev", + "source": { + "type": "git", + "url": "https://github.com/symfony/console.git", + "reference": "74bf9202a531cc6942454eb9e2dd1e13bde34a31" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/console/zipball/74bf9202a531cc6942454eb9e2dd1e13bde34a31", + "reference": "74bf9202a531cc6942454eb9e2dd1e13bde34a31", + "shasum": "" + }, + "require": { + "php": ">=5.3.9", + "symfony/polyfill-mbstring": "~1.0" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/event-dispatcher": "~2.1|~3.0.0", + "symfony/process": "~2.1|~3.0.0" + }, + "suggest": { + "psr/log": "For using the console logger", + "symfony/event-dispatcher": "", + "symfony/process": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Console\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Console Component", + "homepage": "https://symfony.com", + "time": "2015-11-04 00:47:19" + }, + { + "name": "symfony/css-selector", + "version": "2.8.x-dev", + "source": { + "type": "git", + "url": "https://github.com/symfony/css-selector.git", + "reference": "b600fec37c0efca08046d481d79e7eabc07108ff" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/css-selector/zipball/b600fec37c0efca08046d481d79e7eabc07108ff", + "reference": "b600fec37c0efca08046d481d79e7eabc07108ff", + "shasum": "" + }, + "require": { + "php": ">=5.3.9" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\CssSelector\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jean-François Simon", + "email": "jeanfrancois.simon@sensiolabs.com" + }, + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony CssSelector Component", + "homepage": "https://symfony.com", + "time": "2015-10-30 20:15:42" + }, + { + "name": "symfony/dependency-injection", + "version": "2.8.x-dev", + "source": { + "type": "git", + "url": "https://github.com/symfony/dependency-injection.git", + "reference": "eae068f6bbae4b10f096d6b3eb90953941a9c0e4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/eae068f6bbae4b10f096d6b3eb90953941a9c0e4", + "reference": "eae068f6bbae4b10f096d6b3eb90953941a9c0e4", + "shasum": "" + }, + "require": { + "php": ">=5.3.9" + }, + "conflict": { + "symfony/expression-language": "<2.6" + }, + "require-dev": { + "symfony/config": "~2.2|~3.0.0", + "symfony/expression-language": "~2.6|~3.0.0", + "symfony/yaml": "~2.1|~3.0.0" + }, + "suggest": { + "symfony/config": "", + "symfony/proxy-manager-bridge": "Generate service proxies to lazy load them", + "symfony/yaml": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\DependencyInjection\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony DependencyInjection Component", + "homepage": "https://symfony.com", + "time": "2015-11-07 08:30:54" + }, + { + "name": "symfony/dom-crawler", + "version": "2.8.x-dev", + "source": { + "type": "git", + "url": "https://github.com/symfony/dom-crawler.git", + "reference": "740c98235f5b6e2b0b13df2fb97c7a1c7d1a18fc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/740c98235f5b6e2b0b13df2fb97c7a1c7d1a18fc", + "reference": "740c98235f5b6e2b0b13df2fb97c7a1c7d1a18fc", + "shasum": "" + }, + "require": { + "php": ">=5.3.9", + "symfony/polyfill-mbstring": "~1.0" + }, + "require-dev": { + "symfony/css-selector": "~2.8|~3.0.0" + }, + "suggest": { + "symfony/css-selector": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\DomCrawler\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony DomCrawler Component", + "homepage": "https://symfony.com", + "time": "2015-11-02 20:29:39" + }, + { + "name": "symfony/event-dispatcher", + "version": "2.8.x-dev", + "source": { + "type": "git", + "url": "https://github.com/symfony/event-dispatcher.git", + "reference": "a5eb815363c0388e83247e7e9853e5dbc14999cc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/a5eb815363c0388e83247e7e9853e5dbc14999cc", + "reference": "a5eb815363c0388e83247e7e9853e5dbc14999cc", + "shasum": "" + }, + "require": { + "php": ">=5.3.9" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/config": "~2.0,>=2.0.5|~3.0.0", + "symfony/dependency-injection": "~2.6|~3.0.0", + "symfony/expression-language": "~2.6|~3.0.0", + "symfony/stopwatch": "~2.3|~3.0.0" + }, + "suggest": { + "symfony/dependency-injection": "", + "symfony/http-kernel": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\EventDispatcher\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony EventDispatcher Component", + "homepage": "https://symfony.com", + "time": "2015-10-30 20:15:42" + }, + { + "name": "symfony/filesystem", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/symfony/filesystem.git", + "reference": "232aa96494f0b44d25c8b7a11163c742e568c1a7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/232aa96494f0b44d25c8b7a11163c742e568c1a7", + "reference": "232aa96494f0b44d25c8b7a11163c742e568c1a7", + "shasum": "" + }, + "require": { + "php": ">=5.5.9" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Filesystem\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Filesystem Component", + "homepage": "https://symfony.com", + "time": "2015-11-10 13:34:42" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "0b6a8940385311a24e060ec1fe35680e17c74497" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/0b6a8940385311a24e060ec1fe35680e17c74497", + "reference": "0b6a8940385311a24e060ec1fe35680e17c74497", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "time": "2015-11-04 20:28:58" + }, + { + "name": "symfony/translation", + "version": "2.8.x-dev", + "source": { + "type": "git", + "url": "https://github.com/symfony/translation.git", + "reference": "98b89a9091dde2af772d4c74a09447d317d1bdf4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/translation/zipball/98b89a9091dde2af772d4c74a09447d317d1bdf4", + "reference": "98b89a9091dde2af772d4c74a09447d317d1bdf4", + "shasum": "" + }, + "require": { + "php": ">=5.3.9", + "symfony/polyfill-mbstring": "~1.0" + }, + "conflict": { + "symfony/config": "<2.7" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/config": "~2.8", + "symfony/intl": "~2.4|~3.0.0", + "symfony/yaml": "~2.2|~3.0.0" + }, + "suggest": { + "psr/log": "To use logging capability in translator", + "symfony/config": "", + "symfony/yaml": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Translation\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Translation Component", + "homepage": "https://symfony.com", + "time": "2015-10-30 20:15:42" + }, + { + "name": "symfony/yaml", + "version": "2.8.x-dev", + "source": { + "type": "git", + "url": "https://github.com/symfony/yaml.git", + "reference": "5ff00ea2999343d42398fcb793bbfc64c92235ff" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/yaml/zipball/5ff00ea2999343d42398fcb793bbfc64c92235ff", + "reference": "5ff00ea2999343d42398fcb793bbfc64c92235ff", + "shasum": "" + }, + "require": { + "php": ">=5.3.9" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Yaml\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Yaml Component", + "homepage": "https://symfony.com", + "time": "2015-11-05 09:04:44" + } + ], + "packages-dev": [], + "aliases": [], + "minimum-stability": "dev", + "stability-flags": { + "behat/behat": 0, + "behat/mink": 0 + }, + "prefer-stable": false, + "prefer-lowest": false, + "platform": [], + "platform-dev": [] +} diff --git a/src/CommandFactory.php b/src/CommandFactory.php index 48d11df..86a6796 100644 --- a/src/CommandFactory.php +++ b/src/CommandFactory.php @@ -38,37 +38,39 @@ public function __construct($command) abstract public function toBehatMink(); protected function getElementByTarget($target) { - $selectorType = strstr($target, '=', true); - $selector = str_replace("'", "\'", substr($target, strpos($target, '=') + 1)); $result = ''; if (!self::$isPageCreated) { $result = "\t\$page = \$this->getSession()->getPage();\n"; self::$isPageCreated = true; } - if ($selectorType === 'id') { - return $result . "\t\$element = \$page->findById('{$selector}');\n"; + if (preg_match('/^(id|css|link|name|xpath)/', $target, $out)) { + $selectorType = $out[0]; + $selector = str_replace("'", "\'", substr($target, strpos($target, '=') + 1)); + if ($selectorType === 'id') { + return $result . "\t\$element = \$page->findById('{$selector}');\n"; + } + if ($selectorType === 'css') { + return $result . "\t\$element = \$page->find('css', '{$selector}');\n"; + } + if ($selectorType === 'link') { + return $result . "\t\$escapedValue = \$this->getSession()->getSelectorsHandler()->xpathLiteral('{$selector}');\n" + . "\t\$element = \$page->find('named', array('link', \$escapedValue));\n"; + } + if ($selectorType === 'name') { + return $result . "\t\$escapedValue = \$this->getSession()->getSelectorsHandler()->xpathLiteral('{$selector}');\n" + . "\t\$element = \$page->find('named', array('id_or_name', \$escapedValue));\n"; + } + if ($selectorType === 'xpath') { + return $result . "\t\$element = \$page->find('xpath', '{$selector}');\n"; + } } - if ($selectorType === 'css') { - return $result . "\t\$element = \$page->find('css', '{$selector}');\n"; + if (strpos($target, 'document.') === 0) { + return "\t\$element = \$this->getSession()->evaluateScript('{$target}');\n"; } - if ($selectorType === 'link') { - return $result . "\t\$escapedValue = \$this->getSession()->getSelectorsHandler()->xpathLiteral('{$selector}');\n" - . "\t\$element = \$page->find('named', array('link', \$escapedValue));\n"; + if (strpos($target, '//') === 0) { + return $result . "\t\$element = \$page->find('xpath', \"{$target}\");\n"; } - if ($selectorType === 'name') { - return $result . "\t\$escapedValue = \$this->getSession()->getSelectorsHandler()->xpathLiteral('{$selector}');\n" - . "\t\$element = \$page->find('named', array('id_or_name', \$escapedValue));\n"; - } - if ($selectorType === 'xpath') { - return $result . "\t\$element = \$page->find('xpath', '{$selector}');\n"; - } - if (strstr($selector, 'document.') === 0) { - return "\t\$element = \$this->getSession()->evaluateScript('{$selector}');\n"; - } - if (strstr($selector, '//') === 0) { - return $result . "\t\$element = \$page->find('xpath', '{$selector}');\n"; - } - return $result . "\t\$element = \$page->fileById('{$selector}');\n"; + return $result . "\t\$element = \$page->fileById('{$target}');\n"; } } @@ -80,35 +82,54 @@ public function toBehatMink() } } +//class Type extends BaseCommand +//{ +// public function toBehatMink() +// { +// $result = $this->getElementByTarget($this->command['target']) +//// . "\t\$element->sendKeys('{$this->command['value']}');\n"; +//// . "\t\$element->setValue();\n" +// . "\t\$element->focus();\n"; +// $valueAsArray = str_split($this->command['value']); +// foreach ($valueAsArray as $inputChar) { +// $asciiCodeOfInputChar = ord($inputChar); +// $jsToEvaluate = "keyboardEvent = document.createEvent('KeyboardEvent'); +//initMethod = typeof keyboardEvent.initKeyboardEvent !== 'undefined' ? 'initKeyboardEvent' : 'initKeyEvent'; +//keyboardEvent[initMethod]( +// 'keypress', // event type : keydown, keyup, keypress +// true, // bubbles +// true, // cancelable +// window, // viewArg: should be window +// false, // ctrlKeyArg +// false, // altKeyArg +// false, // shiftKeyArg +// false, // metaKeyArg +// {$asciiCodeOfInputChar}, // keyCodeArg : unsigned long the virtual key code, else 0 +// 0 // charCodeArgs : unsigned long the Unicode character associated with the depressed key, else 0 +//); +//document.dispatchEvent(keyboardEvent);"; +// $result .= "\t\$this->getSession()->evaluateScript(\"{$jsToEvaluate}\");\n"; +// } +// return $result; +// } +//} + class Type extends BaseCommand { public function toBehatMink() { - $result = $this->getElementByTarget($this->command['target']) -// . "\t\$element->sendKeys('{$this->command['value']}');\n"; -// . "\t\$element->setValue();\n" - . "\t\$element->focus();\n"; - $valueAsArray = str_split($this->command['value']); - foreach ($valueAsArray as $inputChar) { - $asciiCodeOfInputChar = ord($inputChar); - $jsToEvaluate = "keyboardEvent = document.createEvent('KeyboardEvent'); -initMethod = typeof keyboardEvent.initKeyboardEvent !== 'undefined' ? 'initKeyboardEvent' : 'initKeyEvent'; -keyboardEvent[initMethod]( - 'keypress', // event type : keydown, keyup, keypress - true, // bubbles - true, // cancelable - window, // viewArg: should be window - false, // ctrlKeyArg - false, // altKeyArg - false, // shiftKeyArg - false, // metaKeyArg - {$asciiCodeOfInputChar}, // keyCodeArg : unsigned long the virtual key code, else 0 - 0 // charCodeArgs : unsigned long the Unicode character associated with the depressed key, else 0 -); -document.dispatchEvent(keyboardEvent);"; - $result .= "\t\$this->getSession()->evaluateScript(\"{$jsToEvaluate}\");\n"; - } - return $result; + return $this->getElementByTarget($this->command['target']). + "\t\$element->setValue('{$this->command['value']}');\n\n"; + } +} + +class TypeAndWait extends BaseCommand +{ + public function toBehatMink() + { + return $this->getElementByTarget($this->command['target']). + "\t\$element->setValue('{$this->command['value']}');\n" + . "\t\$this->getSession()->wait(5000);\n\n"; } } @@ -140,7 +161,7 @@ public function toBehatMink() strpos($this->command['value'], '=') + 1 ); return $this->getElementByTarget($this->command['target']) - . "\t\$element->selectOption({$optionValueOrText});\n\n"; + . "\t\$element->selectOption('{$optionValueOrText}');\n\n"; } } diff --git a/test.php b/test.php index d60ab1b..2e1b047 100644 --- a/test.php +++ b/test.php @@ -9,6 +9,7 @@ $secondFilePath = '/Users/narek_vardzelyan/Documents/search_wikipedia_html_testcase.html'; $thirdFilePath = '/Users/narek_vardzelyan/Documents/Testing php_net test two.html'; $fourthFilePath = '/Users/narek_vardzelyan/Documents/Testing php_net test three.html'; +$fifthFilePath = '/Users/narek_vardzelyan/Documents/github_test_two.xhtml'; -$BehatTestGenerator = new Fouraitch\BehatTestGenerator($thirdFilePath); +$BehatTestGenerator = new Fouraitch\BehatTestGenerator($fifthFilePath); $BehatTestGenerator->generate(); \ No newline at end of file From eb3863a199b17f96341ec9f829f4be901552d601 Mon Sep 17 00:00:00 2001 From: Narek Vardzelyan Date: Mon, 16 Nov 2015 18:16:41 +0400 Subject: [PATCH 24/29] Changed main namspace of project. --- behat.yml | 2 +- composer.json | 4 +- composer.lock | 8 +-- src/BehatTestGenerator.php | 2 +- src/CommandFactory.php | 72 +++++++++++++------------- src/SeleniumFileParser.php | 2 +- src/SeleniumRCToBehatMinkFormatter.php | 2 +- test.php | 2 +- 8 files changed, 47 insertions(+), 47 deletions(-) diff --git a/behat.yml b/behat.yml index cf0e3c4..0dc5a14 100644 --- a/behat.yml +++ b/behat.yml @@ -9,4 +9,4 @@ default: contexts: - FeatureContext: parameters: - base_url: http://github.com \ No newline at end of file + base_url: http://php.net \ No newline at end of file diff --git a/composer.json b/composer.json index 0b05b49..6b282f5 100644 --- a/composer.json +++ b/composer.json @@ -7,7 +7,7 @@ "email": "narek.vardzelyan@of.am" } ], - "require": { + "require-dev": { "behat/behat": "3.*@stable", "behat/mink": "1.7.*@stable", "behat/mink-extension": "*", @@ -19,6 +19,6 @@ "bin-dir": "bin/" }, "autoload": { - "psr-4": {"Fouraitch\\": "src/"} + "psr-4": {"Fouraitch\\SeleniumIdeFormatter\\": "src/"} } } diff --git a/composer.lock b/composer.lock index 17b47e7..62a5569 100644 --- a/composer.lock +++ b/composer.lock @@ -4,9 +4,10 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "6b84543bb0ab3481585d6ee572eb8d42", - "content-hash": "46cb555fc5c5451b5e1b435a59bd519e", - "packages": [ + "hash": "9d0e9790eb7bdb6754b788721e649002", + "content-hash": "8b51cb5bfbdeca165bafbba45a1aab45", + "packages": [], + "packages-dev": [ { "name": "behat/behat", "version": "v3.0.15", @@ -1471,7 +1472,6 @@ "time": "2015-11-05 09:04:44" } ], - "packages-dev": [], "aliases": [], "minimum-stability": "dev", "stability-flags": { diff --git a/src/BehatTestGenerator.php b/src/BehatTestGenerator.php index 6bcfc03..849fb52 100644 --- a/src/BehatTestGenerator.php +++ b/src/BehatTestGenerator.php @@ -1,6 +1,6 @@ getElementByTarget($this->command['target']) -//// . "\t\$element->sendKeys('{$this->command['value']}');\n"; -//// . "\t\$element->setValue();\n" -// . "\t\$element->focus();\n"; -// $valueAsArray = str_split($this->command['value']); -// foreach ($valueAsArray as $inputChar) { -// $asciiCodeOfInputChar = ord($inputChar); -// $jsToEvaluate = "keyboardEvent = document.createEvent('KeyboardEvent'); -//initMethod = typeof keyboardEvent.initKeyboardEvent !== 'undefined' ? 'initKeyboardEvent' : 'initKeyEvent'; -//keyboardEvent[initMethod]( -// 'keypress', // event type : keydown, keyup, keypress -// true, // bubbles -// true, // cancelable -// window, // viewArg: should be window -// false, // ctrlKeyArg -// false, // altKeyArg -// false, // shiftKeyArg -// false, // metaKeyArg -// {$asciiCodeOfInputChar}, // keyCodeArg : unsigned long the virtual key code, else 0 -// 0 // charCodeArgs : unsigned long the Unicode character associated with the depressed key, else 0 -//); -//document.dispatchEvent(keyboardEvent);"; -// $result .= "\t\$this->getSession()->evaluateScript(\"{$jsToEvaluate}\");\n"; -// } -// return $result; -// } -//} - class Type extends BaseCommand { public function toBehatMink() { - return $this->getElementByTarget($this->command['target']). - "\t\$element->setValue('{$this->command['value']}');\n\n"; + $result = $this->getElementByTarget($this->command['target']) +// . "\t\$element->sendKeys('{$this->command['value']}');\n"; +// . "\t\$element->setValue();\n" + . "\t\$element->focus();\n"; + $valueAsArray = str_split($this->command['value']); + foreach ($valueAsArray as $inputChar) { + $asciiCodeOfInputChar = ord($inputChar); + $jsToEvaluate = "keyboardEvent = document.createEvent('KeyboardEvent'); +initMethod = typeof keyboardEvent.initKeyboardEvent !== 'undefined' ? 'initKeyboardEvent' : 'initKeyEvent'; +keyboardEvent[initMethod]( + 'keypress', // event type : keydown, keyup, keypress + true, // bubbles + true, // cancelable + window, // viewArg: should be window + false, // ctrlKeyArg + false, // altKeyArg + false, // shiftKeyArg + false, // metaKeyArg + {$asciiCodeOfInputChar}, // keyCodeArg : unsigned long the virtual key code, else 0 + 0 // charCodeArgs : unsigned long the Unicode character associated with the depressed key, else 0 +); +document.dispatchEvent(keyboardEvent);"; + $result .= "\t\$this->getSession()->evaluateScript(\"{$jsToEvaluate}\");\n"; + } + return $result; } } +//class Type extends BaseCommand +//{ +// public function toBehatMink() +// { +// return $this->getElementByTarget($this->command['target']). +// "\t\$element->setValue('{$this->command['value']}');\n\n"; +// } +//} + class TypeAndWait extends BaseCommand { public function toBehatMink() diff --git a/src/SeleniumFileParser.php b/src/SeleniumFileParser.php index 7d829e4..f5ed37d 100644 --- a/src/SeleniumFileParser.php +++ b/src/SeleniumFileParser.php @@ -1,6 +1,6 @@ generate(); \ No newline at end of file From 2deb8b773d77ffa14a55455f47b126545a8e946a Mon Sep 17 00:00:00 2001 From: Narek Vardzelyan Date: Mon, 16 Nov 2015 19:22:26 +0400 Subject: [PATCH 25/29] Added licence to package. --- composer.json | 1 + 1 file changed, 1 insertion(+) diff --git a/composer.json b/composer.json index 6b282f5..dd37fea 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,7 @@ { "name": "fouraitch/selenium-ide-php-behat-mink-formatter", "version": "1.0", + "license": "MIT", "authors": [ { "name": "Narek Vardzelyan", From 0f8e71787ebc4c70b0e91fef5ee999e1a7600ffa Mon Sep 17 00:00:00 2001 From: Narek Vardzelyan Date: Tue, 17 Nov 2015 12:56:11 +0400 Subject: [PATCH 26/29] Added convert.php file and did some changes into .gitignore. --- .gitignore | 2 +- bin/convert.php | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ composer.json | 3 ++- 3 files changed, 52 insertions(+), 2 deletions(-) create mode 100644 bin/convert.php diff --git a/.gitignore b/.gitignore index e47df09..aee4cde 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ /nbproject/ /vendor/ -/bin/ +/bin/behat /features/ diff --git a/bin/convert.php b/bin/convert.php new file mode 100644 index 0000000..c745b2b --- /dev/null +++ b/bin/convert.php @@ -0,0 +1,49 @@ + "\e[1;31m", + 'green' => "\e[1;32m" + ]; + echo $colors[$color]; +} + +function resetTextColor() +{ + echo "\e[0m"; +} + +try { + if ($_SERVER['argc'] < 2) { + throw new Exception("There are not enough parameters.\n"); + } + if ($_SERVER['argc'] > 2) { + throw new Exception("There are too many parameters.\n"); + } + + $fileName = $_SERVER['argv'][1]; + if (preg_match('/^[0-9]/', $fileName)) { + throw new Exception("Test file name must not start with number.\n"); + } + $filePath = 'LearnshipSeleniumTests/TestCases/' . $fileName; + if (!file_exists($filePath)) { + throw new Exception("Wrong file name.\n"); + } + $testGenerator = new BehatTestGenerator($filePath); + $testGenerator->generate(); + setTextColor('green'); + echo "Your test converted successfully.\n" + . "Now you can run \"bin/behat features/{$fileName}\"\n"; +} catch (Exception $ex) { + setTextColor('red'); + echo $ex->getMessage(); +} +resetTextColor(); diff --git a/composer.json b/composer.json index dd37fea..cbd120d 100644 --- a/composer.json +++ b/composer.json @@ -21,5 +21,6 @@ }, "autoload": { "psr-4": {"Fouraitch\\SeleniumIdeFormatter\\": "src/"} - } + }, + "bin": ["bin/convert"] } From 4c82708da803bb9bb30c05d7f64618f091a330ec Mon Sep 17 00:00:00 2001 From: Narek Vardzelyan Date: Tue, 17 Nov 2015 13:02:21 +0400 Subject: [PATCH 27/29] Fixed typo in composer.json. --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index cbd120d..420f18f 100644 --- a/composer.json +++ b/composer.json @@ -22,5 +22,5 @@ "autoload": { "psr-4": {"Fouraitch\\SeleniumIdeFormatter\\": "src/"} }, - "bin": ["bin/convert"] + "bin": ["bin/convert.php"] } From 31b0d589b9e4d04b1979eccb496faa8e930263cb Mon Sep 17 00:00:00 2001 From: Narek Vardzelyan Date: Tue, 17 Nov 2015 16:05:34 +0400 Subject: [PATCH 28/29] Changed the way how requires composer's autoload.php file, changed the mode of convert.php file and rename it to conver, now it can be exacuted without php in front of call command. --- bin/{convert.php => convert} | 6 ++-- src/CommandFactory.php | 68 ++++++++++++++++++------------------ 2 files changed, 37 insertions(+), 37 deletions(-) rename bin/{convert.php => convert} (87%) diff --git a/bin/convert.php b/bin/convert similarity index 87% rename from bin/convert.php rename to bin/convert index c745b2b..a04a97f 100644 --- a/bin/convert.php +++ b/bin/convert @@ -3,7 +3,7 @@ * This file is converts input file from SeleniumIde xml format to Behat php format */ -require_once __DIR__ . '/vendor/autoload.php'; +require_once __DIR__ . '/../../../../vendor/autoload.php'; use Fouraitch\SeleniumIdeFormatter\BehatTestGenerator; @@ -29,11 +29,11 @@ function resetTextColor() throw new Exception("There are too many parameters.\n"); } - $fileName = $_SERVER['argv'][1]; + $filePath = $_SERVER['argv'][1]; + $fileName = strstr($filePath, strrpos($filePath, '/')); if (preg_match('/^[0-9]/', $fileName)) { throw new Exception("Test file name must not start with number.\n"); } - $filePath = 'LearnshipSeleniumTests/TestCases/' . $fileName; if (!file_exists($filePath)) { throw new Exception("Wrong file name.\n"); } diff --git a/src/CommandFactory.php b/src/CommandFactory.php index 9a49810..cd3af3b 100644 --- a/src/CommandFactory.php +++ b/src/CommandFactory.php @@ -82,47 +82,47 @@ public function toBehatMink() } } -class Type extends BaseCommand -{ - public function toBehatMink() - { - $result = $this->getElementByTarget($this->command['target']) -// . "\t\$element->sendKeys('{$this->command['value']}');\n"; -// . "\t\$element->setValue();\n" - . "\t\$element->focus();\n"; - $valueAsArray = str_split($this->command['value']); - foreach ($valueAsArray as $inputChar) { - $asciiCodeOfInputChar = ord($inputChar); - $jsToEvaluate = "keyboardEvent = document.createEvent('KeyboardEvent'); -initMethod = typeof keyboardEvent.initKeyboardEvent !== 'undefined' ? 'initKeyboardEvent' : 'initKeyEvent'; -keyboardEvent[initMethod]( - 'keypress', // event type : keydown, keyup, keypress - true, // bubbles - true, // cancelable - window, // viewArg: should be window - false, // ctrlKeyArg - false, // altKeyArg - false, // shiftKeyArg - false, // metaKeyArg - {$asciiCodeOfInputChar}, // keyCodeArg : unsigned long the virtual key code, else 0 - 0 // charCodeArgs : unsigned long the Unicode character associated with the depressed key, else 0 -); -document.dispatchEvent(keyboardEvent);"; - $result .= "\t\$this->getSession()->evaluateScript(\"{$jsToEvaluate}\");\n"; - } - return $result; - } -} - //class Type extends BaseCommand //{ // public function toBehatMink() // { -// return $this->getElementByTarget($this->command['target']). -// "\t\$element->setValue('{$this->command['value']}');\n\n"; +// $result = $this->getElementByTarget($this->command['target']) +//// . "\t\$element->sendKeys('{$this->command['value']}');\n"; +//// . "\t\$element->setValue();\n" +// . "\t\$element->focus();\n"; +// $valueAsArray = str_split($this->command['value']); +// foreach ($valueAsArray as $inputChar) { +// $asciiCodeOfInputChar = ord($inputChar); +// $jsToEvaluate = "keyboardEvent = document.createEvent('KeyboardEvent'); +//initMethod = typeof keyboardEvent.initKeyboardEvent !== 'undefined' ? 'initKeyboardEvent' : 'initKeyEvent'; +//keyboardEvent[initMethod]( +// 'keypress', // event type : keydown, keyup, keypress +// true, // bubbles +// true, // cancelable +// window, // viewArg: should be window +// false, // ctrlKeyArg +// false, // altKeyArg +// false, // shiftKeyArg +// false, // metaKeyArg +// {$asciiCodeOfInputChar}, // keyCodeArg : unsigned long the virtual key code, else 0 +// 0 // charCodeArgs : unsigned long the Unicode character associated with the depressed key, else 0 +//); +//document.dispatchEvent(keyboardEvent);"; +// $result .= "\t\$this->getSession()->evaluateScript(\"{$jsToEvaluate}\");\n"; +// } +// return $result; // } //} +class Type extends BaseCommand +{ + public function toBehatMink() + { + return $this->getElementByTarget($this->command['target']). + "\t\$element->setValue('{$this->command['value']}');\n\n"; + } +} + class TypeAndWait extends BaseCommand { public function toBehatMink() From f1f426f8b35a2cc73f940c06983f82f96e8da553 Mon Sep 17 00:00:00 2001 From: Narek Vardzelyan Date: Tue, 17 Nov 2015 16:09:24 +0400 Subject: [PATCH 29/29] Changed convert.php to conver. --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 420f18f..cbd120d 100644 --- a/composer.json +++ b/composer.json @@ -22,5 +22,5 @@ "autoload": { "psr-4": {"Fouraitch\\SeleniumIdeFormatter\\": "src/"} }, - "bin": ["bin/convert.php"] + "bin": ["bin/convert"] }