bucky-core 0.9.2 → 0.9.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +30 -9
  3. data/.circleci/deploy_to_rubygems.sh +14 -0
  4. data/.circleci/setup_rubygems.sh +3 -0
  5. data/.codeclimate.yml +4 -4
  6. data/.rubocop.yml +5 -1
  7. data/Dockerfile +1 -1
  8. data/Dockerfile.system-test +1 -1
  9. data/Gemfile.lock +8 -10
  10. data/README.md +2 -1
  11. data/bucky-core.gemspec +1 -1
  12. data/example/README.md +2 -1
  13. data/example/bucky-management/.bucky_home +2 -0
  14. data/example/bucky-management/README.md +55 -0
  15. data/example/bucky-management/config/bucky_config.yml +6 -0
  16. data/example/bucky-management/config/e2e_config.yml +14 -0
  17. data/example/bucky-management/config/linkstatus_config.yml +3 -0
  18. data/example/bucky-management/config/test_db_config.yml +8 -0
  19. data/example/bucky-management/services/README.md +1 -0
  20. data/example/bucky-management/services/bucky_example/pc/pageobject/github_search_list.rb +22 -0
  21. data/example/bucky-management/services/bucky_example/pc/pageobject/github_top.rb +22 -0
  22. data/example/bucky-management/services/bucky_example/pc/parts/github_search_list.yml +3 -0
  23. data/example/bucky-management/services/bucky_example/pc/parts/github_top.yml +6 -0
  24. data/example/bucky-management/services/bucky_example/pc/scenarios/e2e/search_and_assert.yml +39 -0
  25. data/example/bucky-management/services/bucky_example/pc/scenarios/linkstatus/github_top.yml +16 -0
  26. data/example/bucky-management/system/evidences/README.md +1 -0
  27. data/example/bucky-management/system/evidences/screen_shots/README.md +1 -0
  28. data/example/bucky-management/system/logs/README.md +1 -0
  29. data/example/hands-on/README.md +2 -2
  30. data/example/hands-on/config/e2e_config.yml +1 -2
  31. data/example/hands-on/services/bucky_hands_on/pc/pageobject/github_search_list.rb +0 -1
  32. data/example/hands-on/services/bucky_hands_on/pc/pageobject/github_top.rb +0 -1
  33. data/example/hands-on/services/bucky_hands_on/pc/scenarios/e2e/search_and_asseret.yml +1 -1
  34. data/lib/bucky/core/test_core/test_case_loader.rb +2 -2
  35. data/lib/bucky/core/test_core/test_class_generator.rb +0 -1
  36. data/lib/bucky/test_equipment/selenium_handler/webdriver_handler.rb +4 -4
  37. data/lib/bucky/test_equipment/test_case/e2e_test_case.rb +0 -7
  38. data/lib/bucky/tools/lint.rb +6 -5
  39. data/lib/bucky/utils/config.rb +10 -10
  40. data/lib/bucky/version.rb +1 -1
  41. data/system_testing/test_bucky_project/config/e2e_config.yml +1 -2
  42. data/template/make_page/pc/pageobject/sample_page.rb +0 -1
  43. data/template/make_page/sp/pageobject/sample_page.rb +0 -1
  44. data/template/make_page/tablet/pageobject/sample_page.rb +0 -1
  45. data/template/new/config/e2e_config.yml +1 -2
  46. metadata +23 -6
  47. data/lib/bucky/test_equipment/verifications/js_error_checker.rb +0 -23
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 443694a083786ca91bc07ddc002b577692709aa8
4
- data.tar.gz: 1c5bc3ce225a7f5a37ab79556e5c89c0f893b042
3
+ metadata.gz: b538925ad0af273023e4bf5cec8ebdc5ea4b6cb3
4
+ data.tar.gz: 60b32a3055197e1e94f4d2c327d3ebee6f5d9570
5
5
  SHA512:
6
- metadata.gz: 2224a4c78c13862281ef56ebc827b24e77188d8e50be2c41e06e55e86806f73687748da0bc011983018ec9d88f651dc7710a63b89c7228c7dfa6326e4236b8a9
7
- data.tar.gz: 1ec76e01714c278d023b033fb79d5197f408eabf9fe80274bbe4fe4941cc045c9d0e41c5ea19eb4d5d0b0cce6eee079cf8f5a609b23910d1963a9d33c61f459f
6
+ metadata.gz: 88839d270a89265a649b8d1d5b51963cc03bc93456b5a532107e914a00e2116202f4cb65e7c9e15f87d9bcd1cb535f2e413587aabe6af855d3f18c598128f7a9
7
+ data.tar.gz: 61396fa09407f2e94ef6b0bd62245840ee450a0535c298cd51f8f8aa9d7cf380e1487551d8f04b783adc9f00dd360822348b23c9904717d2a98bb10c15e94740
data/.circleci/config.yml CHANGED
@@ -16,19 +16,19 @@ jobs:
16
16
  unit_test:
17
17
  working_directory: ~/bucky-core
18
18
  docker:
19
- - image: circleci/ruby:2.4.1-node
19
+ - image: circleci/ruby:2.4.2-node
20
20
  environment:
21
- CC_TEST_REPORTER_ID: 502b34fc3185ccc1230423dc8727976a66ad79be8faafa14cdb81af83dd69ab9
21
+ CC_TEST_REPORTER_ID: fd7bd9d517bdf8953c4d4803ca4ad7539d12d5c760048b8daf80cbc7d54fb262
22
22
  steps:
23
23
  - checkout
24
24
  - type: cache-restore
25
- key: rails-demo-{{ checksum "Gemfile.lock" }}
25
+ key: unit-test-{{ checksum "Gemfile.lock" }}
26
26
  - run: bundle install --path vendor/bundle
27
27
  - type: cache-save
28
- key: rails-demo-{{ checksum "Gemfile.lock" }}
28
+ key: unit-test-{{ checksum "Gemfile.lock" }}
29
29
  paths:
30
30
  - vendor/bundle
31
- # Download test-reporter
31
+ # Download test-reporter
32
32
  - run:
33
33
  name: Setup Code Climate test-reporter
34
34
  command: |
@@ -41,20 +41,33 @@ jobs:
41
41
  ./cc-test-reporter after-build --coverage-input-type simplecov --exit-code $?
42
42
  syntax_check:
43
43
  docker:
44
- - image: circleci/ruby:2.4.1-node
44
+ - image: circleci/ruby:2.4.2-node
45
45
  steps:
46
46
  - checkout
47
47
  - type: cache-restore
48
- key: rails-demo-{{ checksum "Gemfile.lock" }}
48
+ key: syntax-check-{{ checksum "Gemfile.lock" }}
49
49
  - run: bundle install --path vendor/bundle
50
50
  - type: cache-save
51
- key: rails-demo-{{ checksum "Gemfile.lock" }}
51
+ key: syntax-check-{{ checksum "Gemfile.lock" }}
52
52
  paths:
53
53
  - vendor/bundle
54
54
  - run: bundle exec rubocop -f html --out report.html
55
55
  - store_artifacts:
56
56
  path: report.html
57
-
57
+ publish:
58
+ docker:
59
+ - image: circleci/ruby:2.4.1
60
+ steps:
61
+ - add_ssh_keys:
62
+ finerprints:
63
+ - "6a:f3:d3:b5:a5:da:ce:e0:9f:22:f8:4a:2f:51:67:2b"
64
+ - checkout
65
+ - run:
66
+ name: Setup Rubygems
67
+ command: bash .circleci/setup_rubygems.sh
68
+ - run:
69
+ name: Update vresion.rb and publish on RubyGems
70
+ command: bash .circleci/deploy_to_rubygems.sh
58
71
  workflows:
59
72
  version: 2
60
73
  test:
@@ -64,3 +77,11 @@ workflows:
64
77
  lint:
65
78
  jobs:
66
79
  - syntax_check
80
+ deploy:
81
+ jobs:
82
+ - publish:
83
+ filters:
84
+ tags:
85
+ only: /^v[0-9]{1,}(\.[0-9]{1,}){2}$/
86
+ branches:
87
+ ignore: /.*/
@@ -0,0 +1,14 @@
1
+ VERSION=$(git describe --tags | sed -e 's/^v//')
2
+ git config user.email "bucky-operator@users.noreply.github.com"
3
+ git config user.name "bucky-operator"
4
+ # Update version.rb
5
+ sed -i '' -e "s/VERSION = '[0-9]\{1,\}.[0-9]\{1,\}.[0-9]\{1,\}'/VERSION = '$VERSION'/" lib/bucky/version.rb
6
+ git diff
7
+ git checkout master
8
+ git add lib/bucky/version.rb
9
+ git commit -m "Version $VERSION"
10
+ # Build and release gem
11
+ gem build bucky-core.gemspec
12
+ gem push "bucky-core-$VERSION.gem"
13
+ # Push to master
14
+ git push origin master
@@ -0,0 +1,3 @@
1
+ mkdir ~/.gem
2
+ echo -e "---\r\n:rubygems_api_key: $RUBYGEMS_API_KEY" > ~/.gem/credentials
3
+ chmod 0600 /home/circleci/.gem/credentials
data/.codeclimate.yml CHANGED
@@ -40,9 +40,9 @@ checks:
40
40
  enabled: true
41
41
  config:
42
42
  threshold: #language-specific defaults. overrides affect all languages.
43
- plugins:
44
- rubocop:
45
- enabled: true
46
- channel: rubocop-0-58
43
+ # plugins:
44
+ # rubocop: # run by CircleCI
45
+ # enabled: true
46
+ # channel: rubocop-0-58
47
47
  exclude_patterns:
48
48
  - "spec/"
data/.rubocop.yml CHANGED
@@ -8,7 +8,7 @@ AllCops:
8
8
  - 'template/**/*'
9
9
  - 'tmp/**/*'
10
10
  - 'vendor/**/*'
11
- TargetRubyVersion: 2.5
11
+ TargetRubyVersion: 2.4
12
12
 
13
13
  AbcSize:
14
14
  Enabled: false
@@ -74,3 +74,7 @@ UselessAssignment:
74
74
 
75
75
  ClassLength:
76
76
  Max: 110
77
+
78
+ Lint/UselessAccessModifier:
79
+ Exclude:
80
+ - 'example/**/*'
data/Dockerfile CHANGED
@@ -1,4 +1,4 @@
1
- FROM ruby:2.4.1-alpine
1
+ FROM ruby:2.4.2-alpine
2
2
  ENV LANG ja_JP.UTF-8
3
3
  ENV PAGER busybox less
4
4
 
@@ -1,4 +1,4 @@
1
- FROM ruby:2.4.1-alpine
1
+ FROM ruby:2.4.2-alpine
2
2
  ENV LANG ja_JP.UTF-8
3
3
  ENV PAGER busybox less
4
4
 
data/Gemfile.lock CHANGED
@@ -29,17 +29,16 @@ GEM
29
29
  docile (1.1.5)
30
30
  ffi (1.10.0)
31
31
  hirb (0.7.3)
32
- jaro_winkler (1.5.1)
32
+ jaro_winkler (1.5.2)
33
33
  json (2.1.0)
34
34
  method_source (0.9.0)
35
35
  mini_portile2 (2.4.0)
36
36
  nokogiri (1.10.1)
37
37
  mini_portile2 (~> 2.4.0)
38
38
  parallel (1.12.1)
39
- parser (2.5.1.2)
39
+ parser (2.6.3.0)
40
40
  ast (~> 2.4.0)
41
41
  power_assert (1.1.3)
42
- powerpack (0.1.2)
43
42
  pry (0.11.3)
44
43
  coderay (~> 1.1.0)
45
44
  method_source (~> 0.9.0)
@@ -66,16 +65,15 @@ GEM
66
65
  rspec-support (3.7.0)
67
66
  rspec_junit_formatter (0.3.0)
68
67
  rspec-core (>= 2, < 4, != 2.12.0)
69
- rubocop (0.58.2)
68
+ rubocop (0.68.1)
70
69
  jaro_winkler (~> 1.5.1)
71
70
  parallel (~> 1.10)
72
71
  parser (>= 2.5, != 2.5.1.1)
73
- powerpack (~> 0.1)
74
72
  rainbow (>= 2.2.2, < 4.0)
75
73
  ruby-progressbar (~> 1.7)
76
- unicode-display_width (~> 1.0, >= 1.0.1)
74
+ unicode-display_width (>= 1.4.0, < 1.6)
77
75
  ruby-mysql (2.9.14)
78
- ruby-progressbar (1.9.0)
76
+ ruby-progressbar (1.10.0)
79
77
  rubyzip (1.2.2)
80
78
  selenium-webdriver (3.141.0)
81
79
  childprocess (~> 0.5)
@@ -92,7 +90,7 @@ GEM
92
90
  simplecov-html (0.10.2)
93
91
  test-unit (3.3.0)
94
92
  power_assert
95
- unicode-display_width (1.4.0)
93
+ unicode-display_width (1.5.0)
96
94
 
97
95
  PLATFORMS
98
96
  ruby
@@ -108,8 +106,8 @@ DEPENDENCIES
108
106
  rake (~> 12)
109
107
  rspec (~> 3.6)
110
108
  rspec_junit_formatter (~> 0.3)
111
- rubocop (~> 0.54)
109
+ rubocop (~> 0.63)
112
110
  simplecov-console (~> 0.4.2)
113
111
 
114
112
  BUNDLED WITH
115
- 1.17.1
113
+ 1.17.3
data/README.md CHANGED
@@ -1,4 +1,5 @@
1
1
  # Bucky-Core
2
+ [![CircleCI](https://circleci.com/gh/lifull-dev/bucky-core/tree/master.svg?style=svg)](https://circleci.com/gh/lifull-dev/bucky-core/tree/master) [![Maintainability](https://api.codeclimate.com/v1/badges/adf9599d98a55ac87a2e/maintainability)](https://codeclimate.com/github/lifull-dev/bucky-core/maintainability) [![Test Coverage](https://api.codeclimate.com/v1/badges/adf9599d98a55ac87a2e/test_coverage)](https://codeclimate.com/github/lifull-dev/bucky-core/test_coverage)
2
3
 
3
4
  ## Overview
4
5
  Bucky-core can run test code which is written in YAML. End-to-End test (working with Selenium) and Linkstatus test (HTTP status check) are supported in default. Page object model pattern and page based element management is the main concept in Bucky-core. You can create scenarios and execute it easily by using Bucky-core.
@@ -12,7 +13,7 @@ When working with [Bucky-management](https://github.com/lifull-dev/bucky-managem
12
13
  * Support test code in YAML
13
14
  * Multiple browser supported (currently only Chrome is supported)
14
15
  * Customizable test categories
15
- * [Default] E2E: E2E (End to End) tests including JavaScript error check
16
+ * [Default] E2E: E2E (End to End) tests
16
17
  * [Default] Linkstatus: http status code check in web page
17
18
  * Making test report with [Bucky-management](https://github.com/lifull-dev/bucky-management)
18
19
 
data/bucky-core.gemspec CHANGED
@@ -36,7 +36,7 @@ Gem::Specification.new do |spec|
36
36
  spec.add_development_dependency 'rake', '~> 12'
37
37
  spec.add_development_dependency 'rspec', '~> 3.6'
38
38
  spec.add_development_dependency 'rspec_junit_formatter', '~> 0.3'
39
- spec.add_development_dependency 'rubocop', '~> 0.54'
39
+ spec.add_development_dependency 'rubocop', '~> 0.63'
40
40
  spec.add_development_dependency 'simplecov-console', '~> 0.4.2'
41
41
 
42
42
  spec.add_runtime_dependency 'color_echo', '~> 3.1'
data/example/README.md CHANGED
@@ -1,2 +1,3 @@
1
1
  ## You can check the example code in each directory
2
- * [hands-on](https://github.com/lifull-dev/bucky-core/blob/master/example/hands-on)
2
+ * [hands-on](https://github.com/lifull-dev/bucky-core/blob/master/example/hands-on)
3
+ * [bcuky-management](https://github.com/lifull-dev/bucky-core/blob/master/example/bucky-management)
@@ -0,0 +1,2 @@
1
+ # Bucky home directory.
2
+ # Do not delete this file.
@@ -0,0 +1,55 @@
1
+ # Bucky-management
2
+
3
+ ## What is this example doing
4
+ This example will show you how to connect to Bucky-management and how to get test report automatically.
5
+
6
+ ## Before starting
7
+ Start Bucky-management with docker-compose.yml.
8
+ See [READEME](https://github.com/lifull-dev/bucky-management) in Bucky-management if you start it at first time.
9
+ ```bash
10
+ # Execute this command in Bucky-management directory
11
+ docker-compose -f docker-compose.yml up --build -d
12
+ ```
13
+ ## 1. Move to you test project directory
14
+ - You can see how to make test project in [example/hands-on](https://github.com/lifull-dev/bucky-core/tree/master/example/hands-on)
15
+ ```bash
16
+ # In this example, you can just stay in example/bucky-management
17
+ cd {test project name}
18
+ ```
19
+
20
+ ## 2. Sets connect information to DB
21
+ - Use default value as following if you didn't change anything in Bucky-management's docker-compose.yml
22
+ - Database name is according to what you set in RAILS_ENV when startup Bcuky-management
23
+ ```
24
+ ## config/test_db_config.yml ##
25
+
26
+ :test_db:
27
+ :bucky_test:
28
+ :username: root
29
+ :password: password
30
+ :database: bucky_test # When $RAILS_ENV=test
31
+ :host: 127.0.0.1
32
+ :port: 3306
33
+ :adapter: :mysql
34
+ ```
35
+
36
+ ## 3. Execute test case without -d option
37
+ It will save test result into DB executing without debug option.
38
+ ```bash
39
+ # These test case is already made. You can just execute them in example/bucky-management
40
+ bucky run -t e2e -D pc -c search_and_assert_1
41
+ bucky run -t linkstatus -D pc -c github_top_1
42
+ ```
43
+
44
+ ## 4. Check your test report
45
+ Open your browser http://localhost
46
+
47
+ You will see two result shown in top page.
48
+
49
+ ## At last
50
+ Congratulations!! You have just made your test report.
51
+
52
+ There are lots of information shown in reports.
53
+ It shows more information in each report's detail, e.g. pass rate, NG cases name, NG error message and so on.
54
+
55
+ Enjoy your test with Bucky!!
@@ -0,0 +1,6 @@
1
+ :parallel_num: 4
2
+ :test_result_path: './system/test_results/'
3
+ :log_path: './system/logs/'
4
+ :screen_shot_path: './system/evidences/screen_shots/'
5
+ :bucky_error: 'bucky_error'
6
+ :test_code_repo: 'https://github.com/hogehoge/fugafuga/'
@@ -0,0 +1,14 @@
1
+ :selenium_ip: localhost # Default selenium ip. please set ip or 'docker_host_ip'. ip route | awk 'NR==1 {print $3}'
2
+ :selenium_port: '4444' # Default selenium port
3
+ :browser: :chrome # Only chrome
4
+ :headless: false
5
+ :sp_device_name: :iphone
6
+ :tablet_device_name: :ipad
7
+ :device_name_on_chrome:
8
+ :iphone: 'iPhone X'
9
+ :android: 'Galaxy S5'
10
+ :ipad: 'iPad'
11
+ :user_agent: 'E2ETest (X11; Linux x86_64)'
12
+ :driver_read_timeout: 60 # sec
13
+ :driver_open_timeout: 60 # sec
14
+ :find_element_timeout: 10 # sec
@@ -0,0 +1,3 @@
1
+ :linkstatus_parallel_num: 8
2
+ :linkstatus_open_timeout: 60
3
+ :linkstatus_read_timeout: 60
@@ -0,0 +1,8 @@
1
+ :test_db:
2
+ :bucky_test:
3
+ :username: root
4
+ :password: password
5
+ :database: bucky_test
6
+ :host: 127.0.0.1
7
+ :port: 3306
8
+ :adapter: :mysql
@@ -0,0 +1 @@
1
+ for services page and parts objects.
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'bucky/test_equipment/pageobject/base_pageobject'
4
+ module Services
5
+ module BuckyExample
6
+ module Pc
7
+ module PageObject
8
+ class GithubSearchList < Bucky::TestEquipment::PageObject::BasePageObject
9
+ protected
10
+
11
+ # Add some user operations for this page
12
+ # Sample ====================
13
+ # @param [Hash] args
14
+ # def search_freeword(**args)
15
+ # freeword_form.send_keys(args[:word])
16
+ # freeword_form.submit
17
+ # end
18
+ end
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'bucky/test_equipment/pageobject/base_pageobject'
4
+ module Services
5
+ module BuckyExample
6
+ module Pc
7
+ module PageObject
8
+ class GithubTop < Bucky::TestEquipment::PageObject::BasePageObject
9
+ protected
10
+
11
+ # Add some user operations for this page
12
+ # Sample ====================
13
+ # @param [Hash] args
14
+ # def search_freeword(**args)
15
+ # freeword_form.send_keys(args[:word])
16
+ # freeword_form.submit
17
+ # end
18
+ end
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,3 @@
1
+ bucky_core_a_tag:
2
+ - xpath
3
+ - //a[contains(text(),'lifull-dev')]
@@ -0,0 +1,6 @@
1
+ search_bar:
2
+ - xpath
3
+ - //input[contains(@class,'header-search-input')]
4
+ search_resault:
5
+ - xpath
6
+ - //div[contains(@class,'jump-to-suggestions')]
@@ -0,0 +1,39 @@
1
+ # Describe for this test suite
2
+ desc: search in github and check page transition
3
+ device: pc
4
+ service: bucky_example
5
+ priority: high
6
+ test_category: e2e
7
+ labels:
8
+ - example
9
+ cases:
10
+ # You should create test case name as {test suite name + _ + number}
11
+ - case_name: search_and_assert_1
12
+ func: transition
13
+ desc: Should able to search bucky-core in github, and move to bucky-core page.
14
+ # Procedures to do in this case
15
+ procs:
16
+ - proc: Open github top page
17
+ exec:
18
+ operate: go
19
+ url: https://github.com/
20
+ - proc: Input 'bucky-core' in search bar
21
+ exec:
22
+ operate: input
23
+ page: github_top
24
+ part: search_bar
25
+ word: 'bucky-core'
26
+ - proc: Click search result
27
+ exec:
28
+ operate: click
29
+ page: github_top
30
+ part: search_resault
31
+ - proc: Click target result
32
+ exec:
33
+ operate: click
34
+ page: github_search_list
35
+ part: bucky_core_a_tag
36
+ - proc: assert_text
37
+ exec:
38
+ verify: assert_title
39
+ expect: 'GitHub - lifull-dev/bucky-core: System testing framework for web application.'
@@ -0,0 +1,16 @@
1
+ # Describe for this test suite
2
+ desc: Check all a tag in githib top
3
+ device: pc
4
+ service: bucky_example
5
+ priority: high
6
+ test_category: linkstatus
7
+ labels:
8
+ - example
9
+ # You can exclude url that you don't want to check
10
+ exclude_urls:
11
+ - https://github.com/customer-stories/*
12
+ cases:
13
+ - case_name: github_top_1
14
+ desc: Check github top
15
+ urls:
16
+ - https://github.com/
@@ -0,0 +1 @@
1
+ for save evidence directory.
@@ -0,0 +1 @@
1
+ for save screen shots directory.
@@ -0,0 +1 @@
1
+ for save logs directory.
@@ -1,6 +1,6 @@
1
1
  # Hands-on
2
2
 
3
- # What is this example doing
3
+ ## What is this example doing
4
4
  It will show you how to create a project, service, page and some test code using Bucky command.
5
5
  And will show you how to execute these test code.
6
6
 
@@ -148,7 +148,7 @@ cases:
148
148
  - proc: assert_text
149
149
  exec:
150
150
  verify: assert_title
151
- expect: 'GitHub - lifull-dev/bucky-core: Bucky is a testing framework that supports Web System Testing Life Cycle.'
151
+ expect: 'GitHub - lifull-dev/bucky-core: System testing framework for web application.'
152
152
  ```
153
153
  ## 6. Create test code in Linkstatus category
154
154
  * This step can't be done by Bucky command
@@ -1,6 +1,7 @@
1
1
  :selenium_ip: localhost # default selenium ip. please set ip or 'docker_host_ip'. ip route | awk 'NR==1 {print $3}'
2
2
  :selenium_port: '4444' # default selenium port
3
3
  :browser: :chrome # Only chrome
4
+ :headless: false
4
5
  :sp_device_name: :iphone
5
6
  :tablet_device_name: :ipad
6
7
  :device_name_on_chrome:
@@ -8,8 +9,6 @@
8
9
  :android: 'Galaxy S5'
9
10
  :ipad: 'iPad'
10
11
  :user_agent: 'E2ETest (X11; Linux x86_64)'
11
- :js_error_check: true
12
- :js_error_collector_path: '/var/lib/selenium/ChromeJSErrorCollector-master/extension' # https://github.com/dharrya/ChromeJSErrorCollector
13
12
  :driver_read_timeout: 60 # sec
14
13
  :driver_open_timeout: 60 # sec
15
14
  :find_element_timeout: 10 # sec
@@ -6,7 +6,6 @@ module Services
6
6
  module Pc
7
7
  module PageObject
8
8
  class GithubSearchList < Bucky::TestEquipment::PageObject::BasePageObject
9
-
10
9
  protected
11
10
 
12
11
  # add some user operations for this page
@@ -6,7 +6,6 @@ module Services
6
6
  module Pc
7
7
  module PageObject
8
8
  class GithubTop < Bucky::TestEquipment::PageObject::BasePageObject
9
-
10
9
  protected
11
10
 
12
11
  # add some user operations for this page
@@ -8,7 +8,7 @@ labels:
8
8
  - example
9
9
  cases:
10
10
  # You should create test case name as {test suite name + _ + number}
11
- - case_name: search_and_asseret_1
11
+ - case_name: search_and_assert_1
12
12
  func: transition
13
13
  desc: Should able to search bucky-core in github, and move to bucky-core page.
14
14
  # Procedures to do in this case
@@ -87,8 +87,8 @@ module Bucky
87
87
  end
88
88
  end
89
89
  test_suite
90
- rescue StandardError => ex
91
- raise ex, "loading #{file}, #{ex.message}"
90
+ rescue StandardError => e
91
+ raise e, "loading #{file}, #{e.message}"
92
92
  end
93
93
 
94
94
  def when_match?(proc)
@@ -18,7 +18,6 @@ module Bucky
18
18
  puts " #{index}:#{procedure[:proc]}" if procedure.key?(:proc)
19
19
  method = procedure[:exec].key?(:operate) ? :operate : :verify
20
20
  send(method, procedure[:exec])
21
- check_js_error
22
21
  end
23
22
  end
24
23
 
@@ -49,14 +49,14 @@ module Bucky
49
49
  end
50
50
 
51
51
  def set_chrome_option(device_type)
52
- chrome_options = { 'goog:chromeOptions' => {} }
52
+ chrome_options = { 'chromeOptions' => { args: [] } }
53
53
  unless device_type == 'pc'
54
54
  device_type = "#{device_type}_device_name".to_sym
55
55
  mobile_emulation = { 'deviceName' => @@config[:device_name_on_chrome][@@config[device_type]] }
56
- chrome_options['goog:chromeOptions']['mobileEmulation'] = mobile_emulation
56
+ chrome_options['chromeOptions']['mobileEmulation'] = mobile_emulation
57
57
  end
58
- chrome_options['goog:chromeOptions'][:args] = ["--load-extension=#{@@config[:js_error_collector_path]}"] if @@config[:js_error_check]
59
- chrome_options['goog:chromeOptions'][:args] = ["--user-agent=#{@@config[:user_agent]}"] if @@config[:user_agent]
58
+ chrome_options['chromeOptions'][:args] << "--user-agent=#{@@config[:user_agent]}" if @@config[:user_agent]
59
+ chrome_options['chromeOptions'][:args] << '--headless' if @@config[:headless]
60
60
 
61
61
  Selenium::WebDriver::Remote::Capabilities.chrome(chrome_options)
62
62
  end
@@ -5,7 +5,6 @@ require_relative './abst_test_case'
5
5
  require_relative '../user_operation/user_operator'
6
6
  require_relative '../pageobject/pages'
7
7
  require_relative '../selenium_handler/webdriver_handler'
8
- require_relative '../verifications/js_error_checker'
9
8
  require_relative '../verifications/service_verifications'
10
9
 
11
10
  module Bucky
@@ -13,7 +12,6 @@ module Bucky
13
12
  module TestCase
14
13
  class E2eTestCase < Bucky::TestEquipment::TestCase::AbstTestCase
15
14
  include Bucky::TestEquipment::SeleniumHandler::WebdriverHandler
16
- include Bucky::TestEquipment::Verifications::JsErrorChecker
17
15
 
18
16
  TEST_CATEGORY = 'e2e'
19
17
 
@@ -50,11 +48,6 @@ module Bucky
50
48
  @user_operator.send(op_args[:operate], method_name, op_args)
51
49
  end
52
50
 
53
- # Check javascript error
54
- def check_js_error
55
- assert_no_js_error(@driver) if @@config[:js_error_check]
56
- end
57
-
58
51
  def setup
59
52
  super
60
53
  t_equip_setup
@@ -8,7 +8,7 @@ module Bucky
8
8
  class << self
9
9
  include Bucky::Utils::YamlLoad
10
10
  @@config_dir = "#{$bucky_home_dir}/config/**/*yml"
11
- @@rule_config_dir = "#{$bucky_home_dir}/.bucky-core/template/new/config/*yml"
11
+ @@rule_config_dir = File.expand_path('../../../template/new/config', __dir__) + '/*yml'
12
12
 
13
13
  def check(category)
14
14
  method = "check_#{category}".to_sym
@@ -18,9 +18,9 @@ module Bucky
18
18
  # If you want to add new category, please make new method
19
19
  def check_config
20
20
  data = merge_yaml_data(@@config_dir)
21
- rule_data = merge_yaml_data(@@rule_config_dir)
21
+ @rule_data = merge_yaml_data(@@rule_config_dir)
22
22
  actual = make_key_chain(data)
23
- expect = make_key_chain(rule_data)
23
+ expect = make_key_chain(@rule_data)
24
24
  diff = diff_arr(expect, actual)
25
25
  make_message(diff)
26
26
  end
@@ -41,9 +41,10 @@ module Bucky
41
41
  if diff.empty?
42
42
  puts "\e[32mok\e[0m"
43
43
  else
44
- puts "\e[31m[ERROR] The following configures are undefined."
44
+ puts "\e[31m[ERROR] The following configures are undefined. Tests can still be executed with default value automatically."
45
45
  diff.each do |key|
46
- puts "- #{key}\e[0m"
46
+ puts "- #{key}"
47
+ puts "{#{key}: #{@rule_data[:"#{key}"]}}\e[0m"
47
48
  end
48
49
  end
49
50
  end
@@ -10,31 +10,31 @@ module Bucky
10
10
  include Singleton
11
11
  @@dir = "#{$bucky_home_dir}/config/**/*yml"
12
12
 
13
+ attr_reader :data
13
14
  # @param [String] *.yml or hoge/fuga.yml
14
15
  def initialize
15
16
  @data = {}
16
17
  @resources = []
18
+ @default_config_dir = File.expand_path('../../../template/new/config', __dir__)
17
19
 
18
20
  # Read from a file of shallow hierarchy, then overwrite it if there is same key in deep hierarchy
19
21
  file_sort_hierarchy(@@dir).each do |file|
22
+ file_name = file.split('/').last
20
23
  data = load_yaml(file)
21
- unless data.empty?
22
- @data = @data.merge(data)
23
- @resources << file
24
- end
24
+ default_config_data = load_yaml(@default_config_dir + '/' + file_name)
25
+ next if data.empty?
26
+
27
+ data = default_config_data.merge(data)
28
+ @data = @data.merge(data)
29
+ @resources << file
25
30
  end
26
31
 
27
32
  set_selenium_ip
28
33
  end
29
34
 
30
- # @return [Hash] loaded data
31
- def data
32
- @data || {}
33
- end
34
-
35
35
  # Get data by []
36
36
  def [](column)
37
- return data[column] if data.key?(column)
37
+ return @data[column] if @data.key?(column)
38
38
 
39
39
  # If there is no key, raise exeption
40
40
  raise "Undefined Config : #{column}\nKey doesn't match in config file. Please check config file in config/*"
data/lib/bucky/version.rb CHANGED
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Bucky
4
4
  module Version
5
- VERSION = '0.9.2'
5
+ VERSION = '0.9.4'
6
6
  end
7
7
  end
@@ -1,6 +1,7 @@
1
1
  :selenium_ip: 'docker_host_ip' # Default selenium ip. please set ip or 'docker_host_ip'. ip route | awk 'NR==1 {print $3}'
2
2
  :selenium_port: '4444' # Default selenium port
3
3
  :browser: :chrome # Only chrome
4
+ :headless: false
4
5
  :sp_device_name: :iphone
5
6
  :tablet_device_name: :ipad
6
7
  :device_name_on_chrome:
@@ -8,8 +9,6 @@
8
9
  :android: 'Galaxy S5'
9
10
  :ipad: 'iPad'
10
11
  :user_agent: 'E2ETest (X11; Linux x86_64)'
11
- :js_error_check: true
12
- :js_error_collector_path: '/var/lib/selenium/ChromeJSErrorCollector-master/extension' # https://github.com/dharrya/ChromeJSErrorCollector
13
12
  :driver_read_timeout: 60 # sec
14
13
  :driver_open_timeout: 60 # sec
15
14
  :find_element_timeout: 10 # sec
@@ -6,7 +6,6 @@ module Services
6
6
  module Pc
7
7
  module PageObject
8
8
  class {SamplePage} < Bucky::TestEquipment::PageObject::BasePageObject
9
-
10
9
  protected
11
10
 
12
11
  # Add some user operations for this page
@@ -7,7 +7,6 @@ module Services
7
7
  module Sp
8
8
  module PageObject
9
9
  class {SamplePage} < Bucky::TestEquipment::PageObject::BasePageObject
10
-
11
10
  protected
12
11
 
13
12
  # Add some user operations for this page
@@ -7,7 +7,6 @@ module Services
7
7
  module Tablet
8
8
  module PageObject
9
9
  class {SamplePage} < Bucky::TestEquipment::PageObject::BasePageObject
10
-
11
10
  protected
12
11
 
13
12
  # Add some user operations for this page
@@ -1,6 +1,7 @@
1
1
  :selenium_ip: 'docker_host_ip' # Default selenium ip. please set ip or 'docker_host_ip'. ip route | awk 'NR==1 {print $3}'
2
2
  :selenium_port: '4444' # Default selenium port
3
3
  :browser: :chrome # Only chrome
4
+ :headless: false
4
5
  :sp_device_name: :iphone
5
6
  :tablet_device_name: :ipad
6
7
  :device_name_on_chrome:
@@ -8,8 +9,6 @@
8
9
  :android: 'Galaxy S5'
9
10
  :ipad: 'iPad'
10
11
  :user_agent: 'E2ETest (X11; Linux x86_64)'
11
- :js_error_check: true
12
- :js_error_collector_path: '/var/lib/selenium/ChromeJSErrorCollector-master/extension' # https://github.com/dharrya/ChromeJSErrorCollector
13
12
  :driver_read_timeout: 60 # sec
14
13
  :driver_open_timeout: 60 # sec
15
14
  :find_element_timeout: 10 # sec
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bucky-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.2
4
+ version: 0.9.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - NaotoKishino
@@ -13,7 +13,7 @@ authors:
13
13
  autorequire:
14
14
  bindir: exe
15
15
  cert_chain: []
16
- date: 2019-04-16 00:00:00.000000000 Z
16
+ date: 2019-05-15 00:00:00.000000000 Z
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency
19
19
  name: awesome_print
@@ -147,14 +147,14 @@ dependencies:
147
147
  requirements:
148
148
  - - "~>"
149
149
  - !ruby/object:Gem::Version
150
- version: '0.54'
150
+ version: '0.63'
151
151
  type: :development
152
152
  prerelease: false
153
153
  version_requirements: !ruby/object:Gem::Requirement
154
154
  requirements:
155
155
  - - "~>"
156
156
  - !ruby/object:Gem::Version
157
- version: '0.54'
157
+ version: '0.63'
158
158
  - !ruby/object:Gem::Dependency
159
159
  name: simplecov-console
160
160
  requirement: !ruby/object:Gem::Requirement
@@ -293,6 +293,8 @@ extensions: []
293
293
  extra_rdoc_files: []
294
294
  files:
295
295
  - ".circleci/config.yml"
296
+ - ".circleci/deploy_to_rubygems.sh"
297
+ - ".circleci/setup_rubygems.sh"
296
298
  - ".codeclimate.yml"
297
299
  - ".dockerignore"
298
300
  - ".gitignore"
@@ -317,6 +319,22 @@ files:
317
319
  - docker/nginx/public/index.html
318
320
  - docker/nginx/public/test_page.html
319
321
  - example/README.md
322
+ - example/bucky-management/.bucky_home
323
+ - example/bucky-management/README.md
324
+ - example/bucky-management/config/bucky_config.yml
325
+ - example/bucky-management/config/e2e_config.yml
326
+ - example/bucky-management/config/linkstatus_config.yml
327
+ - example/bucky-management/config/test_db_config.yml
328
+ - example/bucky-management/services/README.md
329
+ - example/bucky-management/services/bucky_example/pc/pageobject/github_search_list.rb
330
+ - example/bucky-management/services/bucky_example/pc/pageobject/github_top.rb
331
+ - example/bucky-management/services/bucky_example/pc/parts/github_search_list.yml
332
+ - example/bucky-management/services/bucky_example/pc/parts/github_top.yml
333
+ - example/bucky-management/services/bucky_example/pc/scenarios/e2e/search_and_assert.yml
334
+ - example/bucky-management/services/bucky_example/pc/scenarios/linkstatus/github_top.yml
335
+ - example/bucky-management/system/evidences/README.md
336
+ - example/bucky-management/system/evidences/screen_shots/README.md
337
+ - example/bucky-management/system/logs/README.md
320
338
  - example/hands-on/.bucky_home
321
339
  - example/hands-on/README.md
322
340
  - example/hands-on/config/bucky_config.yml
@@ -355,7 +373,6 @@ files:
355
373
  - lib/bucky/test_equipment/user_operation/user_operator.rb
356
374
  - lib/bucky/test_equipment/verifications/abst_verification.rb
357
375
  - lib/bucky/test_equipment/verifications/e2e_verification.rb
358
- - lib/bucky/test_equipment/verifications/js_error_checker.rb
359
376
  - lib/bucky/test_equipment/verifications/service_verifications.rb
360
377
  - lib/bucky/test_equipment/verifications/status_checker.rb
361
378
  - lib/bucky/tools/lint.rb
@@ -427,7 +444,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
427
444
  version: '0'
428
445
  requirements: []
429
446
  rubyforge_project:
430
- rubygems_version: 2.5.2.3
447
+ rubygems_version: 2.6.13
431
448
  signing_key:
432
449
  specification_version: 4
433
450
  summary: System testing framework for web application.
@@ -1,23 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'test/unit'
4
-
5
- module Bucky
6
- module TestEquipment
7
- module Verifications
8
- module JsErrorChecker
9
- include Test::Unit::Assertions
10
-
11
- # Check Javascript Error in page
12
- # @param [Webdriver] driver
13
- def assert_no_js_error(driver)
14
- js_errors = driver.execute_script(
15
- 'return window.JSErrorCollector_errors ? window.JSErrorCollector_errors.pump() : []'
16
- )
17
- # Empty is ok
18
- assert_empty(js_errors, '[JS Error]')
19
- end
20
- end
21
- end
22
- end
23
- end