Skip to content

Instantly share code, notes, and snippets.

@s001dxp
s001dxp / selenium-php-webdriver-cheatsheet.md
Created March 11, 2018 14:52 — forked from aczietlow/selenium-php-webdriver-cheatsheet.md
Cheat sheet for using php webdriver (facebook/webdriver).

Webdriver PHP API workthough

  • Open a browser

    # start an instance of firefox with selenium-webdriver
    
    $browser_type = 'firefox'
    $host = 'http://localhost:4444/wd/hub'
    

$capabilities = array(\WebDriverCapabilityType::BROWSER_NAME => $browser_type);

@s001dxp
s001dxp / walksync.js
Created December 18, 2017 16:48 — forked from kethinov/walksync.js
List all files in a directory in Node.js recursively in a synchronous fashion
// List all files in a directory in Node.js recursively in a synchronous fashion
var walkSync = function(dir, filelist) {
var fs = fs || require('fs'),
files = fs.readdirSync(dir);
filelist = filelist || [];
files.forEach(function(file) {
if (fs.statSync(dir + file).isDirectory()) {
filelist = walkSync(dir + file + '/', filelist);
}
else {
@s001dxp
s001dxp / BaseModel.js
Created December 17, 2015 20:20 — forked from gaearon/BaseModel.js
A base Backbone model that supports nested models/collections with simple syntax. See http://stackoverflow.com/a/18989596/458193
// First, define `nestedTypes` in your model.
// Each nested type may be a Model or Collection subtype.
window.app.viewer.Model.GallerySection = window.app.Model.BaseModel.extend({
nestedTypes: {
background: window.app.viewer.Model.Image,
images: window.app.viewer.Collection.MediaCollection
}
});
<?php
require_once 'configurations.php';
class WfBuilder{
private $workflow;
private $process_steps = array();
function build_workflow(){
<?php
require_once 'WorkflowDefinition.php';
require_once 'Execution.php';
$wbuilder = new WfBuilder();
$workflow_definition = $wbuilder->build_workflow();
$execution = new ezcWorkflowTestExecution(1);
$execution->workflow = $workflow_definition;