Skip to content

Commit

Permalink
protractor cucumber
Browse files Browse the repository at this point in the history
  • Loading branch information
duck1123 committed Mar 12, 2016
1 parent 1de174c commit 47d1f9a
Show file tree
Hide file tree
Showing 7 changed files with 52 additions and 12 deletions.
1 change: 1 addition & 0 deletions Gemfile
Expand Up @@ -6,4 +6,5 @@ source "https://rubygems.org"
group :development do
gem 'guard'
gem 'guard-livereload', '~> 2.4', require: false
gem 'guard-shell'
end
5 changes: 5 additions & 0 deletions Gemfile.lock
Expand Up @@ -17,10 +17,14 @@ GEM
pry (>= 0.9.12)
shellany (~> 0.0)
thor (>= 0.18.1)
guard-compat (1.2.1)
guard-livereload (2.4.0)
em-websocket (~> 0.5)
guard (~> 2.8)
multi_json (~> 1.8)
guard-shell (0.7.1)
guard (>= 2.0.0)
guard-compat (~> 1.0)
http_parser.rb (0.6.0)
listen (3.0.3)
rb-fsevent (>= 0.9.3)
Expand Down Expand Up @@ -49,6 +53,7 @@ PLATFORMS
DEPENDENCIES
guard
guard-livereload (~> 2.4)
guard-shell

BUNDLED WITH
1.10.6
15 changes: 15 additions & 0 deletions Guardfile
Expand Up @@ -26,3 +26,18 @@ guard 'livereload' do
# Rails Assets Pipeline
# watch(%r{(app|vendor)(/assets/\w+/(.+\.(css|js|html|png|jpg))).*}) { |m| "/assets/#{m[3]}" }
end

def run_protractor
`lein protractor`
end

guard :shell do
watch(%r{specs/.+\.cljs}) do
`lein with-profile e2e cljsbuild once`
end
end

guard :shell do
watch(%r{target/protractor-tests.js}) {run_protractor}
watch(%r{features/.+\.feature}) {run_protractor}
end
2 changes: 2 additions & 0 deletions package.json
Expand Up @@ -3,6 +3,7 @@
"angular": "1.4.7",
"angular-mocks": "1.4.7",
"bower": "1.7.7",
"cucumber": "0.9.5",
"es6-promise": "3.0.2",
"karma-angular": "0.0.6",
"karma-coverage": "0.5.2",
Expand All @@ -13,6 +14,7 @@
"karma-phantomjs-launcher": "0.2.1",
"moment" : "2.11.1",
"protractor" : "3.1.1",
"protractor-cucumber-framework": "0.3.4",
"wscat": "1.0.1"
}
}
1 change: 1 addition & 0 deletions project.clj
Expand Up @@ -145,6 +145,7 @@
:notify-command ["notify-send"]
:compiler {:output-to "target/protractor-tests.js"
:optimizations :simple
:target :nodejs
:pretty-print true}}}}}
:production {:aot :all
:hooks [leiningen.cljsbuild leiningen.less]
Expand Down
18 changes: 16 additions & 2 deletions protractor.config.js
@@ -1,7 +1,21 @@
exports.config = {
// Uncomment this line if running with a separate webdriver server
// seleniumAddress: "http://localhost:4444/wd/hub",
// capabilities: {
// browserName: 'phantomjs',
// version: '',
// platform: 'ANY'
// },

framework: 'custom',
frameworkPath: require.resolve('protractor-cucumber-framework'),

specs: [
"target/protractor-tests.js"
]
'features/*.feature'
],

cucumberOpts: {
require: 'target/protractor-tests.js',
format: 'pretty'
}
};
22 changes: 12 additions & 10 deletions specs/jiksnu/core_spec.cljs
@@ -1,17 +1,19 @@
(ns jiksnu.core-spec
(:require purnam.test)
(:use-macros [purnam.test :only [beforeEach describe it is is-not]]))
(:require [cljs.nodejs :as nodejs]))

(nodejs/enable-util-print!)
(def -main (fn [] nil))
(set! *main-cli-fn* -main) ;; this is required

(def base-domain "localhost")
(def base-port 8080)
(def base-path (str "http://" base-domain ":" base-port))

(js/describe "foo"
(fn []
(js/it "FIX THIS: One Plus One Equals... "
(set! (.-exports js/module)
(fn []
(let [page (.get js/browser (str base-path "/"))]
(-> (js/expect (.getTitle js/browser))
(.toBe "Jiksnu"))
(is (+ 1 1) 2)
(is (+ 2 2) 4))))))
(this-as this
(.Given this #"^I am logged in$"
(fn [callback]
(.pending callback)))

(js/console.log this))))

0 comments on commit 47d1f9a

Please sign in to comment.