Skip to content

Commit 411a48b

Browse files
author
Dave
committed
cukes!
1 parent 60b37b9 commit 411a48b

File tree

18 files changed

+217
-5
lines changed

18 files changed

+217
-5
lines changed

RPSNew.iml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,26 @@
55
<content url="file://$MODULE_DIR$" />
66
<orderEntry type="jdk" jdkName="RVM: ruby-1.9.3-p327 (1)" jdkType="RUBY_SDK" />
77
<orderEntry type="sourceFolder" forTests="false" />
8+
<orderEntry type="library" scope="PROVIDED" name="addressable (v2.3.2, RVM: ruby-1.9.3-p327 (1)) [gem]" level="application" />
9+
<orderEntry type="library" scope="PROVIDED" name="builder (v3.0.4, RVM: ruby-1.9.3-p327 (1)) [gem]" level="application" />
10+
<orderEntry type="library" scope="PROVIDED" name="capybara (v2.0.1, RVM: ruby-1.9.3-p327 (1)) [gem]" level="application" />
11+
<orderEntry type="library" scope="PROVIDED" name="childprocess (v0.3.6, RVM: ruby-1.9.3-p327 (1)) [gem]" level="application" />
12+
<orderEntry type="library" scope="PROVIDED" name="cucumber (v1.2.1, RVM: ruby-1.9.3-p327 (1)) [gem]" level="application" />
13+
<orderEntry type="library" scope="PROVIDED" name="diff-lcs (v1.1.3, RVM: ruby-1.9.3-p327 (1)) [gem]" level="application" />
14+
<orderEntry type="library" scope="PROVIDED" name="ffi (v1.2.0, RVM: ruby-1.9.3-p327 (1)) [gem]" level="application" />
15+
<orderEntry type="library" scope="PROVIDED" name="gherkin (v2.11.5, RVM: ruby-1.9.3-p327 (1)) [gem]" level="application" />
16+
<orderEntry type="library" scope="PROVIDED" name="json (v1.7.5, RVM: ruby-1.9.3-p327 (1)) [gem]" level="application" />
17+
<orderEntry type="library" scope="PROVIDED" name="libwebsocket (v0.1.7.1, RVM: ruby-1.9.3-p327 (1)) [gem]" level="application" />
18+
<orderEntry type="library" scope="PROVIDED" name="mime-types (v1.19, RVM: ruby-1.9.3-p327 (1)) [gem]" level="application" />
19+
<orderEntry type="library" scope="PROVIDED" name="multi_json (v1.5.0, RVM: ruby-1.9.3-p327 (1)) [gem]" level="application" />
20+
<orderEntry type="library" scope="PROVIDED" name="nokogiri (v1.5.5, RVM: ruby-1.9.3-p327 (1)) [gem]" level="application" />
21+
<orderEntry type="library" scope="PROVIDED" name="rack (v1.4.1, RVM: ruby-1.9.3-p327 (1)) [gem]" level="application" />
22+
<orderEntry type="library" scope="PROVIDED" name="rack-test (v0.6.2, RVM: ruby-1.9.3-p327 (1)) [gem]" level="application" />
23+
<orderEntry type="library" scope="PROVIDED" name="rake (v10.0.3, RVM: ruby-1.9.3-p327 (1)) [gem]" level="application" />
24+
<orderEntry type="library" scope="PROVIDED" name="rubyzip (v0.9.9, RVM: ruby-1.9.3-p327 (1)) [gem]" level="application" />
25+
<orderEntry type="library" scope="PROVIDED" name="selenium-webdriver (v2.27.2, RVM: ruby-1.9.3-p327 (1)) [gem]" level="application" />
26+
<orderEntry type="library" scope="PROVIDED" name="websocket (v1.0.4, RVM: ruby-1.9.3-p327 (1)) [gem]" level="application" />
27+
<orderEntry type="library" scope="PROVIDED" name="xpath (v1.0.0, RVM: ruby-1.9.3-p327 (1)) [gem]" level="application" />
828
</component>
929
</module>
1030

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<?php
2+
3+
cukeCiExecutor::execute();
4+
5+
class cukeCiExecutor {
6+
7+
public static function execute(){
8+
self::setWorkingDirectory();
9+
self::performTests();
10+
}
11+
12+
private function setWorkingDirectory(){
13+
$basePath = str_replace('build/config/cucumber', "", dirname(__FILE__));
14+
$scriptLocation = $basePath.'build/tests/';
15+
$command = "cd $scriptLocation";
16+
self::executeAndOutput($command); }
17+
18+
private function performTests(){
19+
$basePath = str_replace('build/config/cucumber', "", dirname(__FILE__));
20+
$scriptLocation = $basePath.'build/reports/cucumber/json/cucumber.json';
21+
$command = 'cucumber --format json -o '.$scriptLocation;
22+
self::executeAndOutput($command); }
23+
24+
private static function executeAndOutput($command) {
25+
$outputArray = array();
26+
exec($command, $outputArray);
27+
echo "\nOutput for Command $command:\n";
28+
foreach ($outputArray as $outputValue) {
29+
echo "$outputValue\n"; } }
30+
31+
}
32+
33+
?>
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<?php
2+
3+
cukeConsoleExecutor::execute();
4+
5+
class cukeConsoleExecutor {
6+
7+
public static function execute(){
8+
self::setWorkingDirectory();
9+
self::performTests();
10+
}
11+
12+
private function setWorkingDirectory(){
13+
$basePath = str_replace('build/config/cucumber', "", dirname(__FILE__));
14+
$scriptLocation = $basePath.'build/tests/';
15+
$command = "cd $scriptLocation";
16+
self::executeAndOutput($command); }
17+
18+
private function performTests(){
19+
$command = 'cucumber';
20+
self::executeAndOutput($command); }
21+
22+
private static function executeAndOutput($command) {
23+
$outputArray = array();
24+
exec($command, $outputArray);
25+
echo "\nOutput for Command $command:\n";
26+
foreach ($outputArray as $outputValue) {
27+
echo "$outputValue\n"; } }
28+
29+
}
30+
31+
?>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[{"keyword":"Feature","name":"Reaching the Full CV Page","line":1,"description":"","id":"reaching-the-full-cv-page","uri":"features/FullCVPage.feature","elements":[{"keyword":"Scenario","name":"I can load the Full CV page","line":3,"description":"","id":"reaching-the-full-cv-page;i-can-load-the-full-cv-page","type":"scenario","steps":[{"keyword":"Given ","name":"I visit the Full CV page","line":4,"match":{"location":"features/step_definitions/FullCV.rb:1"},"result":{"status":"passed"}},{"keyword":"Then ","name":"I should see \"Full CV\"","line":5,"match":{"arguments":[{"offset":14,"val":"Full CV"}],"location":"features/step_definitions/basic_steps.rb:5"},"result":{"status":"passed"}}]}]},{"keyword":"Feature","name":"Reaching the Hi Page","line":1,"description":"","id":"reaching-the-hi-page","uri":"features/HiPage.feature","elements":[{"keyword":"Scenario","name":"I can load the hi page","line":3,"description":"","id":"reaching-the-hi-page;i-can-load-the-hi-page","type":"scenario","steps":[{"keyword":"Given ","name":"I visit the hi page","line":4,"match":{"location":"features/step_definitions/HiPage.rb:1"},"result":{"status":"passed"}},{"keyword":"Then ","name":"I should see \"Hi eBay\"","line":5,"match":{"arguments":[{"offset":14,"val":"Hi eBay"}],"location":"features/step_definitions/basic_steps.rb:5"},"result":{"status":"passed"}}]}]},{"keyword":"Feature","name":"Reaching the website","line":1,"description":"","id":"reaching-the-website","uri":"features/Homepage.feature","elements":[{"keyword":"Scenario","name":"I can load the homepage","line":3,"description":"","id":"reaching-the-website;i-can-load-the-homepage","type":"scenario","steps":[{"keyword":"Given ","name":"I visit the homepage","line":4,"match":{"location":"features/step_definitions/basic_steps.rb:1"},"result":{"status":"passed"}},{"keyword":"Then ","name":"I should see game Start Button","line":5,"match":{"location":"features/step_definitions/basic_steps.rb:17"},"result":{"status":"passed"}}]}]},{"keyword":"Feature","name":"Reaching the Juicy Bits Page","line":1,"description":"","id":"reaching-the-juicy-bits-page","uri":"features/JuicyBitsPage.feature","elements":[{"keyword":"Scenario","name":"I can load the Juicy Bits page","line":3,"description":"","id":"reaching-the-juicy-bits-page;i-can-load-the-juicy-bits-page","type":"scenario","steps":[{"keyword":"Given ","name":"I visit the Juicy Bits page","line":4,"match":{"location":"features/step_definitions/JuicyBits.rb:1"},"result":{"status":"passed"}},{"keyword":"Then ","name":"I should see \"juicy\"","line":5,"match":{"arguments":[{"offset":14,"val":"juicy"}],"location":"features/step_definitions/basic_steps.rb:5"},"result":{"status":"passed"}}]}]}]
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Feature: Reaching the Full CV Page
2+
3+
Scenario: I can load the Full CV page
4+
Given I visit the Full CV page
5+
Then I should see "Full CV"
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Feature: Reaching the Hi Page
2+
3+
Scenario: I can load the hi page
4+
Given I visit the hi page
5+
Then I should see "Hi eBay"
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Feature: Reaching the website
2+
3+
Scenario: I can load the homepage
4+
Given I visit the homepage
5+
Then I should see game Start Button
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Feature: Reaching the Juicy Bits Page
2+
3+
Scenario: I can load the Juicy Bits page
4+
Given I visit the Juicy Bits page
5+
Then I should see "juicy"
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Given /^I visit the Full CV page$/ do
2+
visit "/index.php?control=page&action=full-cv"
3+
end
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Given /^I visit the hi page$/ do
2+
visit "/index.php?control=page&action=hi"
3+
end

0 commit comments

Comments
 (0)