Skip to content

Instantly share code, notes, and snippets.

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

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 Dec 18, 2017 — forked from kethinov/walksync.js
List all files in a directory in Node.js recursively in a synchronous fashion
View walksync.js
// 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 Dec 17, 2015 — forked from gaearon/BaseModel.js
A base Backbone model that supports nested models/collections with simple syntax. See http://stackoverflow.com/a/18989596/458193
View BaseModel.js
// 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
}
});
View WfDefinition.php
<?php
require_once 'configurations.php';
class WfBuilder{
private $workflow;
private $process_steps = array();
function build_workflow(){
View testExecution.php
<?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;