FacebookPHP

PHPUnit-Webdriver: 09 - PhantomJS ( GhostDriver )

  • https://github.com/detro/ghostdriver
  • PhantomJS has ghostdriver embedded so it is an all-in-one package
  • PhantomJS has crashes periodically, so have some concerns about using it.
  • As of 2018.11.28:
    • [FOR PHP] I currently prefer to use chromedriver with the --headless CLI spec for CI/CD use
      • if only to ensure consistent runtime & capability support
    • There are good reasons to implement other drivers - but I'd lean towards implementing other webdrivers AFTER a chromedriver solution is build & stable.
      • Then FireFox & IE headful
      • Then these two in headless
    • FireFox PHP driver currently has issues with the php-webdriver(Facebook WebDriver), so have not implemented FF in my latest PHPUnit-php-webdriver framework.

 


 

PHPUnit-Webdriver: 10 - PageObjectModel Framework

  • When testing web applications ( or any complex product ) modeling the application is critical for reducing maintenance overhead.
  • Tests should be abstracted away from interacting with the DOM & its elements such that they only reflect interactions
  • By modeling the application, creating tests is intuitive & element selectors are assigned one time in one place
    • Using enumerations and/or constants allow for indirect references to elements so if their selectors change, the only update needed is one constant assignment
  • When the framework is updated to reflect architectural changes in the product, updates will be contained and encapsulated
    • failing tests will show technical debt & expose possible impact to the product that may have not been anticipated.

 

Page Object Model

PHPUnit-Webdriver: 07 - ChromeDriver headless


 

 

Headless Chrome

To run Chrome browser in a headless environment, we need send an aurgument "--headless" to ChromeOptions. This option will tell Google Chrome to execute in headless mode.

PHPUnit-Webdriver: 02 - Composer Conflicts adding drupal-extension

Ran into errors trying to install drupal/drupal-extension due to symphony/process 3.4.1

  • wiped some dependencies
  • installed drupal-extension
  • then added guzzlehttp & facebook/webdriver

 

Previously Installed

phpunit 7

behat/behat

behat/mink

facebook/webdriver

 

drupal/drupal-extension throwing errors for symphony/process 3.4.1(?)

 

backed out

behat/behat

behat/mink

facebook/webdriver

guzzlehttp/guzzle

 

then installed

drupal/drupal-extension

guzzlehttp/guzzle

facebook/webdriver

 

all ok


 

 

 

Installation failed, reverting ./composer.json to its original content.

Subscribe to FacebookPHP