conjur-asset-ui 1.3.2 → 1.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +3 -1
- data/.jshintrc +41 -0
- data/CHANGELOG.md +7 -0
- data/Gemfile +3 -1
- data/README.md +38 -4
- data/Rakefile +69 -1
- data/TODO.md +31 -0
- data/bower.json +98 -0
- data/conjur-asset-ui.gemspec +3 -3
- data/features/navigation_bar.feature +31 -0
- data/features/step_definitions/custom_step.rb +32 -0
- data/features/support/env.rb +38 -0
- data/features/support/hooks.rb +30 -0
- data/features/support/world.rb +17 -0
- data/gulpfile.js +139 -0
- data/lib/conjur/command/ui.rb +1 -1
- data/lib/conjur/webserver/server.rb +14 -8
- data/lib/conjur-asset-ui-version.rb +1 -1
- data/package.json +47 -0
- data/preprocessor.js +7 -0
- data/public/_client_libs.html +1 -16
- data/public/build/css/styles.css +87 -0
- data/public/build/css/vendor.css +5 -0
- data/public/build/fonts/glyphicons-halflings-regular.eot +0 -0
- data/public/{fonts → build/fonts}/glyphicons-halflings-regular.svg +47 -47
- data/public/{fonts → build/fonts}/glyphicons-halflings-regular.ttf +0 -0
- data/public/build/fonts/glyphicons-halflings-regular.woff +0 -0
- data/public/build/js/app.min.js +4 -0
- data/public/build/js/vendor.min.js +23 -0
- data/public/build/maps/app.min.js.map +1 -0
- data/public/build/maps/vendor.min.js.map +1 -0
- data/public/css/styles.less +246 -17
- data/public/index.html.erb +11 -10
- data/public/js/init.js +186 -97
- data/public/js/lib/sorted-set.no-require.js +3 -28
- data/public/js/models/groupRecord.js +14 -12
- data/public/js/models/hostRecord.js +13 -8
- data/public/js/models/layerRecord.js +14 -12
- data/public/js/models/namespace.js +2 -0
- data/public/js/models/policyList.js +3 -1
- data/public/js/models/policyRecord.js +8 -8
- data/public/js/models/record.js +59 -27
- data/public/js/models/resourceList.js +28 -10
- data/public/js/models/userList.js +7 -2
- data/public/js/models/userRecord.js +14 -9
- data/public/js/models/variableList.js +18 -7
- data/public/js/models/variableRecord.js +18 -14
- data/public/js/routers.js +74 -37
- data/public/js/views/annotations.js +39 -28
- data/public/js/views/audit.js +31 -25
- data/public/js/views/breadcrumbs.js +62 -0
- data/public/js/views/chart.js +617 -0
- data/public/js/views/dashboard.js +144 -65
- data/public/js/views/generic.js +16 -9
- data/public/js/views/group.js +103 -55
- data/public/js/views/groups.js +3 -7
- data/public/js/views/host.js +192 -56
- data/public/js/views/hosts.js +2 -6
- data/public/js/views/layer.js +136 -82
- data/public/js/views/layers.js +2 -6
- data/public/js/views/mixins/search.js +12 -5
- data/public/js/views/mixins/tabs.js +95 -55
- data/public/js/views/navSearch.js +16 -5
- data/public/js/views/owned.js +14 -8
- data/public/js/views/permissions.js +244 -178
- data/public/js/views/policies.js +2 -4
- data/public/js/views/policy.js +65 -38
- data/public/js/views/resource.js +54 -34
- data/public/js/views/role.js +59 -37
- data/public/js/views/searchResults.js +205 -138
- data/public/js/views/sections.js +226 -0
- data/public/js/views/time.js +38 -13
- data/public/js/views/user.js +288 -59
- data/public/js/views/users.js +2 -7
- data/public/js/views/variable.js +293 -53
- data/public/js/views/variables.js +4 -8
- metadata +34 -56
- data/.git-hooks/pre_commit/ensure_livescript_compiled.rb +0 -31
- data/.overcommit.yml +0 -5
- data/compile_ls +0 -6
- data/livescript/views/audit.ls +0 -136
- data/public/_client_code.html +0 -42
- data/public/css/bootstrap.css +0 -7
- data/public/fonts/glyphicons-halflings-regular.eot +0 -0
- data/public/fonts/glyphicons-halflings-regular.woff +0 -0
- data/public/js/lib/JSXTransformer.js +0 -10862
- data/public/js/lib/async.js +0 -958
- data/public/js/lib/backbone.js +0 -2
- data/public/js/lib/bootstrap.js +0 -6
- data/public/js/lib/date.extensions.js +0 -141
- data/public/js/lib/less.js +0 -16
- data/public/js/lib/moment.js +0 -7768
- data/public/js/lib/prelude-browser-min.js +0 -1
- data/public/js/lib/react-bootstrap.js +0 -5346
- data/public/js/lib/react-bootstrap.min.js +0 -4
- data/public/js/lib/underscore-min.js +0 -6
- data/public/js/lib/underscore.string.min.js +0 -1
- data/public/js/main.js +0 -57
- data/vendor/prelude-ls/.gitignore +0 -2
- data/vendor/prelude-ls/.travis.yml +0 -3
- data/vendor/prelude-ls/CHANGELOG.md +0 -81
- data/vendor/prelude-ls/LICENSE +0 -22
- data/vendor/prelude-ls/Makefile +0 -50
- data/vendor/prelude-ls/README.md +0 -15
- data/vendor/prelude-ls/browser/prelude-browser-min.js +0 -1
- data/vendor/prelude-ls/browser/prelude-browser.js +0 -1172
- data/vendor/prelude-ls/lib/Func.js +0 -40
- data/vendor/prelude-ls/lib/List.js +0 -602
- data/vendor/prelude-ls/lib/Num.js +0 -129
- data/vendor/prelude-ls/lib/Obj.js +0 -153
- data/vendor/prelude-ls/lib/Str.js +0 -68
- data/vendor/prelude-ls/lib/index.js +0 -164
- data/vendor/prelude-ls/package.json +0 -50
- data/vendor/prelude-ls/package.ls +0 -46
- data/vendor/prelude-ls/src/Func.ls +0 -17
- data/vendor/prelude-ls/src/List.ls +0 -299
- data/vendor/prelude-ls/src/Num.ls +0 -83
- data/vendor/prelude-ls/src/Obj.ls +0 -61
- data/vendor/prelude-ls/src/Str.ls +0 -32
- data/vendor/prelude-ls/src/index.ls +0 -56
- data/vendor/prelude-ls/test/Func.ls +0 -36
- data/vendor/prelude-ls/test/List.ls +0 -751
- data/vendor/prelude-ls/test/Num.ls +0 -258
- data/vendor/prelude-ls/test/Obj.ls +0 -145
- data/vendor/prelude-ls/test/Prelude.ls +0 -49
- data/vendor/prelude-ls/test/Str.ls +0 -208
- data/vendor/prelude-ls/test/browser.html +0 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e84b34bd073f6957e24c4681011fc2a76e885910
|
4
|
+
data.tar.gz: fa39fd6270a10f8574a6b5b3b9e23bfd4f6700b0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d0b428ca78cdafe84e6bc7b32c0adfd46ee67b9a150ee409a35a1699aca87e849ba51fffe9d7a0434fad28e51c45721681ea28bc947383dcca4b80ab3721bdbe
|
7
|
+
data.tar.gz: 9fe20dd4f9f496533bbcd8edb561ac34171602268052a4ec60167c3c861755fceb08b8926f33980b1aaa24c724fc8d90a5c9fb4e32b4de987b0bfc17dcd85490
|
data/.gitignore
CHANGED
data/.jshintrc
ADDED
@@ -0,0 +1,41 @@
|
|
1
|
+
{
|
2
|
+
"bitwise": true,
|
3
|
+
"camelcase": true,
|
4
|
+
"curly": true,
|
5
|
+
"eqeqeq": true,
|
6
|
+
"es3": true,
|
7
|
+
"forin": true,
|
8
|
+
"freeze": true,
|
9
|
+
"immed": false,
|
10
|
+
"indent": 4,
|
11
|
+
"latedef": true,
|
12
|
+
"newcap": false,
|
13
|
+
"noarg": true,
|
14
|
+
"noempty": true,
|
15
|
+
"nonbsp": true,
|
16
|
+
"nonew": true,
|
17
|
+
"plusplus": false,
|
18
|
+
// "quotmark": "single",
|
19
|
+
"undef": true,
|
20
|
+
"unused": true,
|
21
|
+
"strict": true,
|
22
|
+
"maxparams": 8,
|
23
|
+
"maxdepth": 4,
|
24
|
+
"maxstatements": 20,
|
25
|
+
"maxcomplexity": 20,
|
26
|
+
"maxlen": 100,
|
27
|
+
"browser": true,
|
28
|
+
"couch": false,
|
29
|
+
"devel": true,
|
30
|
+
"dojo": false,
|
31
|
+
"jquery": true,
|
32
|
+
"mootools": false,
|
33
|
+
"node": false,
|
34
|
+
"nonstandard": true,
|
35
|
+
"phantom": false,
|
36
|
+
"prototypejs": false,
|
37
|
+
"rhino": false,
|
38
|
+
"worker": false,
|
39
|
+
"wsh": false,
|
40
|
+
"yui": false
|
41
|
+
}
|
data/CHANGELOG.md
CHANGED
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -6,16 +6,16 @@ This Gem is a Conjur plugin providing UI features.
|
|
6
6
|
Usage
|
7
7
|
-----
|
8
8
|
|
9
|
-
First install the gem, with the rather clumsy name `conjur-asset-ui
|
9
|
+
First install the gem, with the rather clumsy name `conjur-asset-ui`.
|
10
10
|
|
11
11
|
```
|
12
|
-
gem install conjur-asset-ui
|
12
|
+
gem install conjur-asset-ui
|
13
13
|
```
|
14
14
|
|
15
15
|
Or add the following line to your `Gemfile`:
|
16
16
|
|
17
17
|
```
|
18
|
-
gem 'conjur-asset-
|
18
|
+
gem 'conjur-asset-ui'
|
19
19
|
```
|
20
20
|
|
21
21
|
Next, edit your `.conjurrc` file to add the `"ui"` plugin, for example:
|
@@ -31,7 +31,7 @@ plugins:
|
|
31
31
|
Make sure you are logged into conjur:
|
32
32
|
|
33
33
|
```
|
34
|
-
conjur authn
|
34
|
+
conjur authn login
|
35
35
|
```
|
36
36
|
|
37
37
|
And run the UI:
|
@@ -39,3 +39,37 @@ And run the UI:
|
|
39
39
|
```
|
40
40
|
conjur ui
|
41
41
|
```
|
42
|
+
|
43
|
+
## Development
|
44
|
+
|
45
|
+
### System Dependencies
|
46
|
+
|
47
|
+
* rvm with installed Ruby
|
48
|
+
* npm
|
49
|
+
|
50
|
+
### Setup
|
51
|
+
|
52
|
+
Create a gemset with [rvm](http://rvm.io):
|
53
|
+
|
54
|
+
```sh-session
|
55
|
+
$ rvm gemset use conjur-asset-ui --create
|
56
|
+
$ bundle install
|
57
|
+
```
|
58
|
+
|
59
|
+
Run `rake deps:install`, and `rake assets:build` to build js and css assets.
|
60
|
+
|
61
|
+
### Running the project
|
62
|
+
|
63
|
+
Open 2 terminal tabs.
|
64
|
+
|
65
|
+
In one, run `rake assets:watch`. In the other run `conjur ui`.
|
66
|
+
|
67
|
+
gulp will rebuild assets as needed when files change.
|
68
|
+
|
69
|
+
### Testing
|
70
|
+
|
71
|
+
```sh-session
|
72
|
+
$ rake features
|
73
|
+
# or run only features marked with wip tag
|
74
|
+
$ rake features:wip
|
75
|
+
```
|
data/Rakefile
CHANGED
@@ -1,3 +1,71 @@
|
|
1
|
-
require
|
1
|
+
require 'bundler/gem_tasks'
|
2
|
+
|
2
3
|
require 'jasmine'
|
3
4
|
load 'jasmine/tasks/jasmine.rake'
|
5
|
+
|
6
|
+
begin
|
7
|
+
require 'cucumber'
|
8
|
+
require 'cucumber/rake/task'
|
9
|
+
|
10
|
+
Cucumber::Rake::Task.new(:features) do |t|
|
11
|
+
t.cucumber_opts = '--format pretty'
|
12
|
+
end
|
13
|
+
|
14
|
+
Cucumber::Rake::Task.new('features:wip') do |t|
|
15
|
+
t.cucumber_opts = '--format pretty --tags @wip'
|
16
|
+
end
|
17
|
+
|
18
|
+
rescue LoadError
|
19
|
+
desc 'Cucumber rake task not available'
|
20
|
+
|
21
|
+
task :features do
|
22
|
+
abort 'Cucumber rake task is not available. Be sure to install cucumber as a gem or plugin'
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
namespace :deps do
|
27
|
+
desc 'Installs non-ruby dependencies like gulp, bower and nodejs packages'
|
28
|
+
task :install do
|
29
|
+
sh 'sudo npm install -g gulp bower'
|
30
|
+
sh 'npm install'
|
31
|
+
sh 'bower install'
|
32
|
+
end
|
33
|
+
|
34
|
+
desc 'Updates npm and bower packages'
|
35
|
+
task :update do
|
36
|
+
sh 'npm update'
|
37
|
+
sh 'bower update'
|
38
|
+
end
|
39
|
+
|
40
|
+
desc 'Removes npm and bower packages from filesystem'
|
41
|
+
task :clean do
|
42
|
+
sh 'rm -rf node_modules'
|
43
|
+
sh 'rm -rf bower_components'
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
namespace :assets do
|
48
|
+
desc 'Build js and css'
|
49
|
+
task :build do
|
50
|
+
sh 'gulp build'
|
51
|
+
end
|
52
|
+
|
53
|
+
desc 'Watch the assets files and rebuild when one of them changes'
|
54
|
+
task :watch => :build do
|
55
|
+
sh 'gulp watch'
|
56
|
+
end
|
57
|
+
|
58
|
+
desc 'Clean builded assets'
|
59
|
+
task :clean do
|
60
|
+
sh 'gulp clean'
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
task :build => %w(deps:install assets:build)
|
65
|
+
|
66
|
+
namespace :git do
|
67
|
+
desc 'Executes git clean'
|
68
|
+
task :clean do
|
69
|
+
sh 'git clean -dfX'
|
70
|
+
end
|
71
|
+
end
|
data/TODO.md
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
# General
|
2
|
+
|
3
|
+
1. Flux?
|
4
|
+
2. Reflux?
|
5
|
+
3. Astarisx?
|
6
|
+
|
7
|
+
# JS
|
8
|
+
|
9
|
+
1. Make audit.js readable
|
10
|
+
2. Extract from audit.js common components and refactor it
|
11
|
+
3. Better models
|
12
|
+
4. Create navigation menu component
|
13
|
+
|
14
|
+
|
15
|
+
# General JS
|
16
|
+
|
17
|
+
1. Drop backbone
|
18
|
+
2. Think how to replace backbone history
|
19
|
+
3. Drop prelude-ls
|
20
|
+
4. Drop jquery everywhere
|
21
|
+
5. Find nice library for ajax requests
|
22
|
+
6. Move from underscore to lo-dash
|
23
|
+
7. Drop underscore.string
|
24
|
+
8. Drop underscore-deep-extend
|
25
|
+
9. Drop react-bootstrap and bootstrap.js
|
26
|
+
|
27
|
+
# CSS
|
28
|
+
|
29
|
+
1. Move to SASS
|
30
|
+
2. Break monolite file in to modules
|
31
|
+
3. More BEM everywhere
|
data/bower.json
ADDED
@@ -0,0 +1,98 @@
|
|
1
|
+
{
|
2
|
+
"name": "conjur-asset-ui",
|
3
|
+
"private": true,
|
4
|
+
"version": "1.2.0",
|
5
|
+
"homepage": "https://github.com/conjurinc/conjur-asset-ui",
|
6
|
+
"authors": [
|
7
|
+
"Nikolai Sevostjanov <nikolai.sevostjanov@gmail.com>"
|
8
|
+
],
|
9
|
+
"license": "MIT",
|
10
|
+
"ignore": [
|
11
|
+
"**/.*",
|
12
|
+
"node_modules",
|
13
|
+
"bower_components",
|
14
|
+
"test",
|
15
|
+
"tests"
|
16
|
+
],
|
17
|
+
"dependencies": {
|
18
|
+
"jquery": "~2.1.1",
|
19
|
+
"async": "~0.9.0",
|
20
|
+
"backbone": "~1.1.2",
|
21
|
+
"moment": "~2.8.3",
|
22
|
+
"underscore": "~1.7.0",
|
23
|
+
"underscore.string": "~2.3.3",
|
24
|
+
"react": "~0.11.2",
|
25
|
+
"bootstrap": "~3.2.0",
|
26
|
+
"react-bootstrap": "~0.12.0",
|
27
|
+
"d3": "~3.4.13",
|
28
|
+
"underscore-deep-extend": "~0.0.5",
|
29
|
+
"prelude-ls": "~1.1.1"
|
30
|
+
},
|
31
|
+
"overrides": {
|
32
|
+
"jquery": {
|
33
|
+
"main": [
|
34
|
+
"dist/jquery.js"
|
35
|
+
]
|
36
|
+
},
|
37
|
+
"async": {
|
38
|
+
"main": [
|
39
|
+
"lib/async.js"
|
40
|
+
]
|
41
|
+
},
|
42
|
+
"backbone": {
|
43
|
+
"main": [
|
44
|
+
"backbone.js"
|
45
|
+
]
|
46
|
+
},
|
47
|
+
"moment": {
|
48
|
+
"main": [
|
49
|
+
"min/moment-with-locales.js"
|
50
|
+
]
|
51
|
+
},
|
52
|
+
"underscore": {
|
53
|
+
"main": [
|
54
|
+
"underscore.js"
|
55
|
+
]
|
56
|
+
},
|
57
|
+
"underscore.string": {
|
58
|
+
"main": [
|
59
|
+
"lib/underscore.string.js"
|
60
|
+
]
|
61
|
+
},
|
62
|
+
"react": {
|
63
|
+
"main": [
|
64
|
+
"react-with-addons.js"
|
65
|
+
]
|
66
|
+
},
|
67
|
+
"react-bootstrap": {
|
68
|
+
"main": [
|
69
|
+
"react-bootstrap.js"
|
70
|
+
]
|
71
|
+
},
|
72
|
+
"bootstrap": {
|
73
|
+
"main": [
|
74
|
+
"dist/js/bootstrap.js",
|
75
|
+
"dist/css/bootstrap.min.css",
|
76
|
+
"dist/fonts/*.eot",
|
77
|
+
"dist/fonts/*.svg",
|
78
|
+
"dist/fonts/*.ttf",
|
79
|
+
"dist/fonts/*.woff"
|
80
|
+
]
|
81
|
+
},
|
82
|
+
"d3": {
|
83
|
+
"main": [
|
84
|
+
"d3.js"
|
85
|
+
]
|
86
|
+
},
|
87
|
+
"underscore-deep-extend": {
|
88
|
+
"main": [
|
89
|
+
"index.js"
|
90
|
+
]
|
91
|
+
},
|
92
|
+
"prelude-ls": {
|
93
|
+
"main": [
|
94
|
+
"browser/prelude-browser-min.js"
|
95
|
+
]
|
96
|
+
}
|
97
|
+
}
|
98
|
+
}
|
data/conjur-asset-ui.gemspec
CHANGED
@@ -6,14 +6,14 @@ require 'conjur-asset-ui-version'
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
7
|
spec.name = "conjur-asset-ui"
|
8
8
|
spec.version = Conjur::Asset::UI::VERSION
|
9
|
-
spec.authors = ["Jon Mason", "Kevin Gilpin", "Rafa\305\202 Rzepecki", "Hleb Rubanau"]
|
10
|
-
spec.email = ["jon@conjur.net", "kgilpin@conjur.net", "rafal@conjur.net", "hleb@conjur.net"]
|
9
|
+
spec.authors = ["Jon Mason", "Kevin Gilpin", "Rafa\305\202 Rzepecki", "Hleb Rubanau", "Mikalai Sevastsyanau"]
|
10
|
+
spec.email = ["jon@conjur.net", "kgilpin@conjur.net", "rafal@conjur.net", "hleb@conjur.net", "mikalai@conjur.net"]
|
11
11
|
spec.homepage = "http://conjur.net"
|
12
12
|
spec.summary = "Conjur User Interface Plugin"
|
13
13
|
spec.homepage = ""
|
14
14
|
spec.license = "MIT"
|
15
15
|
|
16
|
-
spec.files = `git ls-files`.split($/)
|
16
|
+
spec.files = `git ls-files`.split($/) + `find public/build`.split($/)
|
17
17
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
19
|
spec.require_paths = ["lib"]
|
@@ -0,0 +1,31 @@
|
|
1
|
+
Feature: Navigation menu
|
2
|
+
Scenario: Open Dashboard page
|
3
|
+
Given I should logged in
|
4
|
+
When I click on the button Dashboard of the navigation menu
|
5
|
+
Then element having css "#content .dashboard" should be present
|
6
|
+
|
7
|
+
Scenario Outline: Open page using navigation bar
|
8
|
+
Given I should logged in
|
9
|
+
When I click on the button <btn> of the navigation menu
|
10
|
+
Then the <box> list should be present
|
11
|
+
And the <btn> button of the navigation menu should be active
|
12
|
+
And other button except the <btn> button of the navigation menu should be not active
|
13
|
+
|
14
|
+
Examples:
|
15
|
+
| btn | box |
|
16
|
+
| Users | User |
|
17
|
+
| Groups | Group |
|
18
|
+
| Hosts | Host |
|
19
|
+
| Layers | Layer |
|
20
|
+
| Variables | Variable |
|
21
|
+
| Policies | Policy |
|
22
|
+
|
23
|
+
Scenario: Open Audit page
|
24
|
+
Given I should logged in
|
25
|
+
When I click on the button Audit of the navigation menu
|
26
|
+
Then element having css "#content .audit h3" should be present
|
27
|
+
And the Audit button of the navigation menu should be active
|
28
|
+
And other button except the Audit button of the navigation menu should be not active
|
29
|
+
|
30
|
+
Scenario: Close the browser
|
31
|
+
Then I close browser
|
@@ -0,0 +1,32 @@
|
|
1
|
+
require 'selenium-cucumber'
|
2
|
+
|
3
|
+
Given(/^I should logged in$/) do
|
4
|
+
step %[I navigate to "#{login_url}"]
|
5
|
+
end
|
6
|
+
|
7
|
+
When(/^I click on the button (.*) of the navigation menu$/) do |btn|
|
8
|
+
id = navigation_btn_to_id(btn)
|
9
|
+
|
10
|
+
step %[I click on element having css ".navbar .dropdown a"]
|
11
|
+
step %[element having css "#{id} a" should be present]
|
12
|
+
step %[I click on element having css "#{id} a"]
|
13
|
+
end
|
14
|
+
|
15
|
+
Then(/^the (.*) button of the navigation menu should be active$/) do |btn|
|
16
|
+
id = navigation_btn_to_id(btn)
|
17
|
+
|
18
|
+
step %[I click on element having css ".navbar .dropdown a"]
|
19
|
+
step %[element having css "#{id}.active a" should be present]
|
20
|
+
end
|
21
|
+
|
22
|
+
Then(/^the (.*) list should be present$/) do |btn|
|
23
|
+
btn = btn.downcase
|
24
|
+
|
25
|
+
step %[element having css "#content .#{btn}Box .#{btn}List h2" should be present]
|
26
|
+
end
|
27
|
+
|
28
|
+
Then(/^other button except the (.*) button of the navigation menu should be not active$/) do |btn|
|
29
|
+
id = navigation_btn_to_id(btn)
|
30
|
+
|
31
|
+
WAIT.until { $driver.find_elements(:css => '.navbar li.active').count } == 1
|
32
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'selenium-webdriver'
|
3
|
+
|
4
|
+
def print_error
|
5
|
+
puts "\nInappropraite browser \"#{ENV['BROWSER']}\""
|
6
|
+
puts "\nUsage : cucumber BROWSER=browser_name"
|
7
|
+
puts "\nbrowser_name can be one of following :"
|
8
|
+
puts "1.ie\n2.chrome\n3.ff\n4.safari\n5.opera"
|
9
|
+
puts "\nNow using default browser \"Firefox\""
|
10
|
+
end
|
11
|
+
|
12
|
+
case ENV['BROWSER']
|
13
|
+
when 'ie'
|
14
|
+
browser_type = :ie
|
15
|
+
when 'ff'
|
16
|
+
browser_type = :ff
|
17
|
+
when 'chrome'
|
18
|
+
browser_type = :chrome
|
19
|
+
when 'opera'
|
20
|
+
browser_type = :opera
|
21
|
+
when 'safari'
|
22
|
+
browser_type = :safari
|
23
|
+
else
|
24
|
+
if ENV['BROWSER']
|
25
|
+
print_error
|
26
|
+
end
|
27
|
+
|
28
|
+
browser_type = :ff
|
29
|
+
end
|
30
|
+
|
31
|
+
|
32
|
+
begin
|
33
|
+
$driver = Selenium::WebDriver.for(browser_type)
|
34
|
+
$driver.manage().window().maximize()
|
35
|
+
|
36
|
+
rescue Exception => e
|
37
|
+
puts e.message
|
38
|
+
end
|