Merge remote branch 'upstream/master'

This commit is contained in:
Brayan Osmar Pereyra Suxo
2013-12-17 10:01:52 -04:00
6 changed files with 1036 additions and 0 deletions

6
behat.yml Normal file
View File

@@ -0,0 +1,6 @@
# behat.yml
default:
context:
parameters:
base_url: http://192.168.0.55/api/1.0/workflow/
access_token: 5e312aab4c5b9342ce9ac12861f08f020e4e359e

View File

@@ -61,5 +61,9 @@
"colosa/pmui": "dev-master",
"colosa/michelangelofe": "dev-master",
"underscore/underscore": "1.5.2"
},
"require-dev":{
"guzzle/guzzle":"~3.1.1",
"behat/behat":"2.4.*@stable"
}
}

View File

@@ -0,0 +1,54 @@
@ProcessMakerMichelangelo @RestAPI
Feature: Testing Oauth
Scenario: GET projects list
Given that I have a valid access_token
And I request "projects"
Then the response status code should be 200
And the response charset is "UTF-8"
And the content type is "application/json"
And the type is "array"
And the "prj_uid" property in row 0 equals "8061532405176da5242da84006421863"
And the "prj_name" property in row 0 equals "Sample Project"
And the "prj_description" property in row 0 equals "description"
And the "diagrams" property in row 0 equals "diagrams"
Scenario: GET project SLA Process Entire process...
Given that I have a valid access_token
And I request "project/725511159507f70b01942b3002493938"
Then the response status code should be 200
And the response charset is "UTF-8"
And the content type is "application/json"
And the type is "object"
And the response has a "diagrams" property
And the "diagrams" property type is "array"
#And the "lanesets" property in row 0 of property "diagrams" equals "xx"
And the "lanesets" property in row 0 of property "diagrams" is "array"
And the "lanes" property in row 0 of property "diagrams" is "array"
And the "activities" property in row 0 of property "diagrams" is "array"
And the "events" property in row 0 of property "diagrams" is "array"
And the "gateways" property in row 0 of property "diagrams" is "array"
And the "flows" property in row 0 of property "diagrams" is "array"
And the "artifacts" property in row 0 of property "diagrams" is "array"
Scenario: Creating new Project with API
Given that I want to make a new "Process" with:
| name | followers |
| everzet | 147 |
| avalanche123 | 142 |
| kriswallsmith | 274 |
| fabpot | 962 |
And I want to Insert a new "Process" with:
"""
{
"id" : 123,
"name" : "john",
"age" : 12
}
"""
# And "prj_name" is "my test process"
# And "prj_description" is "test for gizzle"
# And the request is sent as JSON
# When I request "project"
Then the response status code should be 201
# And the response should be JSON
# And the response has a "prj_id" property

View File

@@ -0,0 +1,66 @@
<?php
use Behat\Behat\Context\ClosuredContextInterface,
Behat\Behat\Context\TranslatedContextInterface,
Behat\Behat\Context\BehatContext,
Behat\Behat\Exception\PendingException;
use Behat\Gherkin\Node\PyStringNode,
Behat\Gherkin\Node\TableNode;
//
// Require 3rd-party libraries here:
//
// require_once 'PHPUnit/Autoload.php';
// require_once 'PHPUnit/Framework/Assert/Functions.php';
//
require_once 'config.php';
/**
* Features context.
*/
class FeatureContext extends BehatContext
{
/**
* 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
$this->useContext('RestContext', new RestContext($parameters));
}
/**
* @When /^I run "([^"]*)"$/
*/
public function iRun($command)
{
exec($command, $result);
$this->output = $result;
}
/**
* @Then /^I should see the file "([^"]*)"$/
*/
public function iShouldSeeTheFile($fileName)
{
if (!in_array($fileName, $this->output)) {
throw new Exception('File named ' . $fileName . ' not found!');
}
}
//
// Place your definition and hook methods here:
//
// /**
// * @Given /^I have done something with "([^"]*)"$/
// */
// public function iHaveDoneSomethingWith($argument)
// {
// doSomethingWith($argument);
// }
//
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,12 @@
<?php
global $config;
$config = array (
'code' => "5efe0d0fd38bffe5932cfdc2773e55b4b8bf273c",
'access_token' => "1c986015c086315e2200095afe2a20e53f71a659",
'expires_in' => 3600,
'token_type' => "bearer",
'scope' => "view_processes edit_processes",
'refresh_token' => "ade174976fe77f12ecde7c9e1d8307ac495f443e",
);