BehatMink

Behat Mink: 000 - Blocking Issues in Mink for Drupal

  • Mink is probably a great tool for basic websites that don't implement a heavy back-end system.
  • Mink COULD be a winner IF
    • migrates to selenium3 webdriver
    • exposes the entire selenium3 api
    • provides a means to send XPATH directly to selenium api
      • currently catches, parses, translates, THEN sends to api
    • provides a means to send CSS directly to selenium api
      • currently catches, parses, translates, THEN sends to api

Behat front end is a solid Cucumber BDD Engine

  • Still requires a sensible & well-designed test framework to hook into
  • Design the framework around PHPUnit
  • Use Behat to provide BDD translation for feature files
  • BDD isn't test...

Behat Mink: 12 - JavaScript 02

 

/**
 * @Then /^I should see the modal "([^"]*)"$/
 */
public function iShouldSeeTheModal($title)
{
	$this->getSession()->wait(20000, '(0 === jQuery.active && 0 === jQuery(\':animated\').length)');
	$this->assertElementContainsText('#modal-from-dom .modal-header h3', $title);
	assertTrue($this->getSession()->getPage()->find('css', '#modal-from-dom')->isVisible());
}

I’ll run through this method now line-by-line:

Tags

CentOS7: 06-BehatMink Reporting and Output CLI Options

 


Run Behat Tests

bin/behat -c tests/behat/behat.profiles.yml --format pretty --out logs/report.txt --format junit --out logs/xml --format progress

 

bin/behat -c tests/behat/behat.profiles.yml --format pretty --out logs/report.txt --format junit --out logs/junitxml  --format progress --no-colors

 

With Suite Spec

[setup@c7 behatmink]$ bin/behat -c tests/behat/behat.profiles.yml --format pretty --out logs/report.txt --format junit --out logs/junitxml --format progress --no-colors -p p_goutte --suite=smoke

 

tail phantomjs.log

tail -f  /var/www/tools/phantomjs/phantomjs.log

 

Tags

CentOS7: 04-PhantomJS systemd Service Wrapper

  • systemd makes simple services so much easier to deal with

 

Create phantomjs.service

touch /etc/systemd/system/phantomjs

 

[setup@c7 ~]$ cd /etc/systemd
[setup@c7 systemd]$ ls
bootchart.conf  coredump.conf  journald.conf  logind.conf  system  system.conf  user  user.conf
[setup@c7 systemd]$ cd system


[setup@c7 system]$ sudo touch phantomjs.service
[sudo] password for setup:

 

Subscribe to BehatMink