bucky-core 0.9.0

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 (100) hide show
  1. checksums.yaml +7 -0
  2. data/.circleci/config.yml +66 -0
  3. data/.codeclimate.yml +48 -0
  4. data/.dockerignore +11 -0
  5. data/.gitignore +40 -0
  6. data/.rspec +3 -0
  7. data/.rubocop.yml +76 -0
  8. data/.rubocop_todo.yml +51 -0
  9. data/Dockerfile +38 -0
  10. data/Dockerfile.system-test +44 -0
  11. data/Gemfile +4 -0
  12. data/Gemfile.lock +115 -0
  13. data/LICENSE +201 -0
  14. data/README.md +246 -0
  15. data/Rakefile +8 -0
  16. data/bin/console +15 -0
  17. data/bin/setup +8 -0
  18. data/bucky-core.gemspec +47 -0
  19. data/docker-compose.dev-with-bm.yml +28 -0
  20. data/docker-compose.dev.yml +18 -0
  21. data/docker-compose.system-test.yml +21 -0
  22. data/docker/nginx/Dockerfile +7 -0
  23. data/docker/nginx/nginx.conf +22 -0
  24. data/docker/nginx/public/index.html +19 -0
  25. data/docker/nginx/public/test_page.html +12 -0
  26. data/exe/bucky +214 -0
  27. data/lib/bucky.rb +3 -0
  28. data/lib/bucky/core/database/db_connector.rb +29 -0
  29. data/lib/bucky/core/database/test_data_operator.rb +195 -0
  30. data/lib/bucky/core/exception/bucky_exception.rb +39 -0
  31. data/lib/bucky/core/report/screen_shot_generator.rb +24 -0
  32. data/lib/bucky/core/test_core/test_case_loader.rb +162 -0
  33. data/lib/bucky/core/test_core/test_class_generator.rb +129 -0
  34. data/lib/bucky/core/test_core/test_manager.rb +70 -0
  35. data/lib/bucky/core/test_core/test_result.rb +92 -0
  36. data/lib/bucky/test_equipment/evidence/evidence_generator.rb +36 -0
  37. data/lib/bucky/test_equipment/pageobject/base_pageobject.rb +55 -0
  38. data/lib/bucky/test_equipment/pageobject/pages.rb +61 -0
  39. data/lib/bucky/test_equipment/selenium_handler/webdriver_handler.rb +66 -0
  40. data/lib/bucky/test_equipment/test_case/abst_test_case.rb +49 -0
  41. data/lib/bucky/test_equipment/test_case/e2e_test_case.rb +70 -0
  42. data/lib/bucky/test_equipment/test_case/linkstatus_test_case.rb +28 -0
  43. data/lib/bucky/test_equipment/user_operation/user_operation_helper.rb +97 -0
  44. data/lib/bucky/test_equipment/user_operation/user_operation_logger.rb +15 -0
  45. data/lib/bucky/test_equipment/user_operation/user_operator.rb +61 -0
  46. data/lib/bucky/test_equipment/verifications/abst_verification.rb +13 -0
  47. data/lib/bucky/test_equipment/verifications/e2e_verification.rb +106 -0
  48. data/lib/bucky/test_equipment/verifications/js_error_checker.rb +23 -0
  49. data/lib/bucky/test_equipment/verifications/service_verifications.rb +62 -0
  50. data/lib/bucky/test_equipment/verifications/status_checker.rb +180 -0
  51. data/lib/bucky/tools/lint.rb +69 -0
  52. data/lib/bucky/utils/bucky_logger.rb +25 -0
  53. data/lib/bucky/utils/bucky_output.rb +23 -0
  54. data/lib/bucky/utils/config.rb +55 -0
  55. data/lib/bucky/utils/requests.rb +33 -0
  56. data/lib/bucky/utils/yaml_load.rb +24 -0
  57. data/lib/bucky/version.rb +7 -0
  58. data/system_testing/test_bucky_project/.bucky_home +2 -0
  59. data/system_testing/test_bucky_project/config/bucky_config.yml +6 -0
  60. data/system_testing/test_bucky_project/config/e2e_config.yml +15 -0
  61. data/system_testing/test_bucky_project/config/linkstatus_config.yml +3 -0
  62. data/system_testing/test_bucky_project/config/test_db_config.yml +8 -0
  63. data/system_testing/test_bucky_project/services/README.md +1 -0
  64. data/system_testing/test_bucky_project/services/service_a/pc/pageobject/index.rb +13 -0
  65. data/system_testing/test_bucky_project/services/service_a/pc/parts/index.yml +6 -0
  66. data/system_testing/test_bucky_project/services/service_a/pc/scenarios/e2e/pc_e2e.yml +68 -0
  67. data/system_testing/test_bucky_project/services/service_a/pc/scenarios/e2e/setup_each_pc_e2e.yml +20 -0
  68. data/system_testing/test_bucky_project/services/service_a/pc/scenarios/e2e/setup_teardown_each_pc_e2e.yml +35 -0
  69. data/system_testing/test_bucky_project/services/service_a/pc/scenarios/e2e/teardown_each_pc_e2e.yml +20 -0
  70. data/system_testing/test_bucky_project/services/service_a/pc/scenarios/linkstatus/pc_link.yml +10 -0
  71. data/system_testing/test_bucky_project/services/service_a/sp/pageobject/index.rb +14 -0
  72. data/system_testing/test_bucky_project/services/service_a/sp/parts/index.yml +6 -0
  73. data/system_testing/test_bucky_project/services/service_a/sp/scenarios/e2e/sp_e2e_test.yml +26 -0
  74. data/system_testing/test_bucky_project/services/service_a/sp/scenarios/linkstatus/sp_link.yml +10 -0
  75. data/system_testing/test_bucky_project/services/service_a/tablet/pageobject/index.rb +14 -0
  76. data/system_testing/test_bucky_project/services/service_a/tablet/parts/index.yml +6 -0
  77. data/system_testing/test_bucky_project/services/service_a/tablet/scenarios/e2e/tablet_e2e_test.yml +26 -0
  78. data/system_testing/test_bucky_project/system/evidences/README.md +1 -0
  79. data/system_testing/test_bucky_project/system/evidences/screen_shots/README.md +1 -0
  80. data/system_testing/test_bucky_project/system/logs/README.md +1 -0
  81. data/system_testing/test_specification.md +38 -0
  82. data/system_testing/testing_code/command.bats +42 -0
  83. data/system_testing/testing_code/e2e.bats +75 -0
  84. data/system_testing/testing_code/linkstatus.bats +24 -0
  85. data/template/make_page/pc/pageobject/sample_page.rb +23 -0
  86. data/template/make_page/pc/parts/sample_page.yml +9 -0
  87. data/template/make_page/sp/pageobject/sample_page.rb +24 -0
  88. data/template/make_page/sp/parts/sample_page.yml +9 -0
  89. data/template/make_page/tablet/pageobject/sample_page.rb +24 -0
  90. data/template/make_page/tablet/parts/sample_page.yml +9 -0
  91. data/template/new/.bucky_home +2 -0
  92. data/template/new/config/bucky_config.yml +6 -0
  93. data/template/new/config/e2e_config.yml +15 -0
  94. data/template/new/config/linkstatus_config.yml +3 -0
  95. data/template/new/config/test_db_config.yml +8 -0
  96. data/template/new/services/README.md +1 -0
  97. data/template/new/system/evidences/README.md +1 -0
  98. data/template/new/system/evidences/screen_shots/README.md +1 -0
  99. data/template/new/system/logs/README.md +1 -0
  100. metadata +415 -0
@@ -0,0 +1,20 @@
1
+ desc: teardown each pc e2e suits
2
+ device: pc
3
+ service: service_a
4
+ priority: high
5
+ test_category: e2e
6
+ teardown_each:
7
+ procs:
8
+ - proc: open test_page.html
9
+ exec:
10
+ operate: go
11
+ url: http://bucky.net/test_page.html
12
+ cases:
13
+ - case_name: teardown_each_pc_e2e_1
14
+ func: teardown each pc e2e 1 func
15
+ desc: teardown each pc e2e 1 func
16
+ procs:
17
+ - proc: open page
18
+ exec:
19
+ operate: go
20
+ url: http://bucky.net
@@ -0,0 +1,10 @@
1
+ desc: pc linkstatus test suites
2
+ device: pc
3
+ service: service_a
4
+ priority: high
5
+ test_category: linkstatus
6
+ cases:
7
+ - case_name: pc_link_1
8
+ desc: pc linkstatus test 1
9
+ urls:
10
+ - http://bucky.net
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'bucky/test_equipment/pageobject/base_pageobject'
4
+
5
+ module Services
6
+ module ServiceA
7
+ module Sp
8
+ module PageObject
9
+ class Index < Bucky::TestEquipment::PageObject::BasePageObject
10
+ end
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,6 @@
1
+ link:
2
+ - xpath
3
+ - "//*[@id='test_link']"
4
+ ua:
5
+ - xpath
6
+ - "//*[@id='user_agent']"
@@ -0,0 +1,26 @@
1
+ desc: sp e2e suits
2
+ device: sp
3
+ service: service_a
4
+ priority: high
5
+ test_category: e2e
6
+ cases:
7
+ - case_name: sp_e2e_1
8
+ func: sp e2e 1 func UserAgent
9
+ desc: sp e2e 1 func UserAgent
10
+ procs:
11
+ - proc: open index
12
+ exec:
13
+ operate: go
14
+ url: http://bucky.net
15
+ - proc: check UserAgent(DeviceName)
16
+ exec:
17
+ verify: assert_contained_text
18
+ expect: iPhone
19
+ page: index
20
+ part: ua
21
+ - proc: check UserAgent(Browser)
22
+ exec:
23
+ verify: assert_contained_text
24
+ expect: Safari
25
+ page: index
26
+ part: ua
@@ -0,0 +1,10 @@
1
+ desc: sp linkstatus test suites
2
+ device: sp
3
+ service: service_a
4
+ priority: high
5
+ test_category: linkstatus
6
+ cases:
7
+ - case_name: sp_link_1
8
+ desc: sp linkstatus test 1
9
+ urls:
10
+ - http://bucky.net
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'bucky/test_equipment/pageobject/base_pageobject'
4
+
5
+ module Services
6
+ module ServiceA
7
+ module Tablet
8
+ module PageObject
9
+ class Index < Bucky::TestEquipment::PageObject::BasePageObject
10
+ end
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,6 @@
1
+ link:
2
+ - xpath
3
+ - "//*[@id='test_link']"
4
+ ua:
5
+ - xpath
6
+ - "//*[@id='user_agent']"
@@ -0,0 +1,26 @@
1
+ desc: tablet e2e suits
2
+ device: tablet
3
+ service: service_a
4
+ priority: high
5
+ test_category: e2e
6
+ cases:
7
+ - case_name: tablet_e2e_1
8
+ func: tablet e2e 1 func UserAgent
9
+ desc: tablet e2e 1 func UserAgent
10
+ procs:
11
+ - proc: open index
12
+ exec:
13
+ operate: go
14
+ url: http://bucky.net
15
+ - proc: check UserAgent(DeviceName)
16
+ exec:
17
+ verify: assert_contained_text
18
+ expect: iPad
19
+ page: index
20
+ part: ua
21
+ - proc: check UserAgent(Browser)
22
+ exec:
23
+ verify: assert_contained_text
24
+ expect: Safari
25
+ page: index
26
+ part: ua
@@ -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.
@@ -0,0 +1,38 @@
1
+ # Procedures of test execution
2
+
3
+ ```bash
4
+ docker-compose -f docker-compose.system-test.yml up --build -d
5
+
6
+ docker exec bucky-core bats /bucky-core/system_testing/testing_code/
7
+ # OR
8
+ docker exec bucky-core bats /bucky-core/system_testing/testing_code/command.bats
9
+
10
+ docker-compose -f docker-compose.system-test.yml down
11
+ ```
12
+
13
+ # Test case specification
14
+ ※ Only Japanese now.
15
+ ※ テストケースNo.はbatsのケース説明部分に記載し、対応づけを行う
16
+
17
+ | テスト条件 | テスト観点 | テストケース<br/>No. | テストケース | テスト手順 | 期待結果 |
18
+ |:--|:--|--:|:--|:--|:--|
19
+ | E2Eテスト実行機能 | Operateが正常に実行できるか<br/>・シナリオコードに実装されたOperateが実行できること<br/>・clickして遷移できること ※1種類のOperateができればOK<br/>ページタイトルで遷移したことを確認する | 1 | goを実行し正常に実行されること | 1. bucky run -t e2e -d -D pc -c pc_e2e_1<br/>- 以下シナリオファイル内の処理 -<br/>2. goメソッド実行 (http://bucky.net)<br/>3. assert_titleメソッド実行 | goメソッドを実行後にページ遷移されていること<br/>(assert_titleメソッドの結果がOKであることを出力される文字列で判断) |
20
+ | | Verifyが正常に実行できるか<br/>・シナリオコードに実装されたVerifyが実行できること<br/>・titleの確認ができること ※1種類のVerifyが確認できればOK | 2 | assert_titleを実行し、正常に動作すること | 1. bucky run -t e2e -d -D pc -c pc_e2e_1<br/>- 以下シナリオファイル内の処理 -<br/>2. goメソッド実行 (http://bucky.net)<br/>3. assert_titleメソッド実行 | assert_titleメソッド実行後にエラーが発生しないこと<br/>(終了後のステータスが0であること) |
21
+ | | | 3 | assert_titleを実行し、期待値と実際値が異なる場合に正常に検証NG時の動作をすること | 1. bucky run -t e2e -d -D pc -c pc_e2e_2<br/>- 以下シナリオファイル内の処理 -<br/>2. goメソッド実行 (http://bucky.net)<br/>3. assert_titleメソッド実行 | assert_titleメソッド実行後に検証NG判定されたことを表す文字列が表示されること |
22
+ | | 各デバイスのUAで正常に実行できるか | 4 | デバイスPCで実行し、正常にテストが実行されること | 1. bucky run -t e2e -d -D pc -c pc_e2e_3<br/>- 以下シナリオファイル内の処理 -<br/>2. goメソッド実行 (http://bucky.net)<br/>2. assert_textメソッド実行 | assert_textでUseragentを表す文字列をチェックした結果OKであることを出力される文字列で判断<br/><br/>Linux |
23
+ | | | 5 | デバイスSPで実行し、正常にテストが実行されること | 1. bucky run -t e2e -d -D sp -c sp_e2e_1<br/>- 以下シナリオファイル内の処理 -<br/>2. goメソッド実行 (http://bucky.net)<br/>2. assert_textメソッド実行 | assert_textでUseragentを表す文字列をチェックした結果OKであることを出力される文字列で判断<br/><br/>Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1 |
24
+ | | | 6 | デバイスTabletで実行し、正常にテストが実行されること | 1. bucky run -t e2e -d -D tablet -c tablet_e2e_1<br/>- 以下シナリオファイル内の処理 -<br/>2. goメソッド実行 (http://bucky.net)<br/>2. assert_textメソッド実行 | assert_textでUseragentを表す文字列をチェックした結果OKであることを出力される文字列で判断<br/><br/>Mozilla/5.0 (iPad; CPU OS 11_0 like Mac OS X) AppleWebKit/604.1.34 (KHTML, like Gecko) Version/11.0 Mobile/15A5341f Safari/604.1 |
25
+ | | setup/teardown_eachが正常に動作するか | 7 | setup_eachでgoを実行し正常に実行されること | 1. bucky run -t e2e -d -D pc -c setup_each_pc_e2e_1<br/>- 以下シナリオファイル内の処理 -<br/>2. setup内でgoメソッド実行 (http://bucky.net)<br/>3. testcase内でassert_titleメソッド実行 | goメソッドを実行後にページ遷移されていること<br/>(assert_titleメソッドの結果がOKであることを出力される文字列で判断) |
26
+ | | | 8 | teardown_eachでgoを実行し正常に実行されること | 1. bucky run -t e2e -d -D pc -c teardown_each_pc_e2e_1<br/>- 以下シナリオファイル内の処理 -<br/>2. teardown内でgoメソッド実行 (http://bucky.net)<br/>3. testcase内でassert_titleメソッド実行 | 例外が発生していないこと(終了後のステータスが0であること)<br/>→ 「0 failures, 0 errors」 と表示されること |
27
+ | | | 9 | setup_each/teardownを実行するケースを複数ケース続けて実行して正常に動作すること | 1. bucky run -t e2e -d -D pc -c setup_teardown_each_pc_e2e_1,setup_teardown_each_pc_e2e_2 <br/>- 以下シナリオファイル内の処理 -<br/>2. setup内でgoメソッド実行 (http://bucky.net)<br/>3. assert_titleメソッド実行<br/>4. testcase内でteardown内でgoメソッド実行 (http://bucky.net)<br/>5. setup内でgoメソッド実行 (http://bucky.net)<br/>6. testcase内でassert_titleメソッド実行<br/>7. teardown内でgoメソッド実行 (http://bucky.net) | 例外が発生していないこと(終了後のステータスが0であること)<br/>→ 「0 failures, 0 errors」 と表示されること |
28
+ | LinkStatusテスト実行機能 | 起点URLの検証が正しく実施できるか | 10 | linkstatusを実行し、起点URLが検証されること | 1. bucky run -t linkstatus -d -D pc -c pc_link_1<br/>2. http://bucky.net に対してhttpリクエストチェック実行 | 出力に http://bucky.net が含まれること |
29
+ | | ページ内のリンクの検証が正しく実施できるか | 11 | linkstatusを実行し、起点ページ内のリンクが検証されること | 1. bucky run -t linkstatus -d -D pc -c pc_link_1<br/>2. http://bucky.net に対してhttpリクエストチェック実行<br/>3. http://bucky.net/test_page.html に対してLinkチェック実行 | 出力に http://bucky.net/test_page.html が含まれること |
30
+ | | 各デバイス(PC/SP)のUAで正常に実行できるか | 12 | デバイスPCでlinkstatusを実行し、正常に動作すること | 1. bucky run -t linkstatus -d -D pc -c pc_link_1<br/>2. http://bucky.net に対してhttpリクエストチェック実行<br/>3. http://bucky.net/test_page.html に対してLinkチェック実行 | 終了後のステータスが0であること<br/>→ 「0 failures, 0 errors」 と表示されること |
31
+ | | | 13 | デバイスSPでlinkstatusを実行し、正常に動作すること | 1. bucky run -t linkstatus -d -D sp -c sp_link_1<br/>2. http://bucky.net に対してhttpリクエストチェック実行<br/>3. http://bucky.net/test_page.html チェック実行 | 終了後のステータスが0であること<br/>→ 「0 failures, 0 errors」 と表示されること |
32
+ | テスト用のプロジェクト作成機能 | 下記の構造のディレクトリ、ファイルが生成されること<br/>(./template/new 以下の内容)<br/>.<br/>├── config<br/>│ ├── bucky_config.yml<br/>│ ├── e2e_config.yml<br/>│ ├── for_spec<br/>│ │ └── test.yml<br/>│ ├── linkstatus_config.yml<br/>│ └── test_db_config.yml<br/>├── services<br/>│ └── README.md<br/>└── system<br/>├── evidences<br/>│ ├── README.md<br/>│ └── screen_shots<br/>│ └── README.md<br/>└── logs<br/>└── README.md | 14 | newコマンド実行後に期待通りのファイル、ディレクトリが作成されていること | 1. bucky new test_project | 対象ディレクトリとファイルが存在していること |
33
+ | ページオブジェクト・パーツファイル作成機能 | 指定のサービス名、デバイスのディレクトリ以下に指定のページ名で.rbファイルと.ymlファイルが生成されること | 15 | make serviceコマンド実行後に期待通りのファイルが作成されていること | 1. (事前条件) bucky new test_project<br/>2. bucky make service test_service | 対象ディレクトリとファイルが存在していること |
34
+ | | | 16 | make pageコマンド実行後に期待通りのファイルが作成されていること | 1. (事前条件) bucky new test_project<br/>2. (事前条件) bucky make service test_service<br/>3. bucky make page test_page | 対象ディレクトリとファイルが存在していること |
35
+ | 未定義コマンド実行時の動き | 出力されるメッセージに Invalid command error. が含まれるか<br/>終了ステータスが 0 以外になるか | 17 | 未定義コマンド実行後にエラー終了すること | 1. bucky hoge fuga | 終了後のステータスが0以外であること |
36
+ | whenを使用しての実行時の動き | 出力されるメッセージに click が含まれるか<br/>例外が発生していないこと(終了後のステータスが0であること)<br/>→ 「0 failures, 0 errors」 と表示されること | 18 | 条件指定をしたテスト実行で不具合なくprocが実行されること | 1. STAGE=development bucky run -d -D -pc -c pc_e2e_4<br/>- 以下シナリオファイル内の処理 -<br/>2. goメソッド実行 (http://bucky.net)<br/>2. whenを使ったclickメソッド実行 | 例外が発生していないこと(終了後のステータスが0であること)<br/>→ 「0 failures, 0 errors」 と表示されること |
37
+ | whenを使用しての実行時の動き | 出力されるメッセージに click が含まれないこと(終了後のステータスが0であること) | 19 | 条件指定をしないテスト実行で該当のprocが実行されないこと | 1. bucky run -d -D -pc -c pc_e2e_4<br/>- 以下シナリオファイル内の処理 -<br/>2. goメソッド実行 (http://bucky.net)<br/>2. whenを使ったclickメソッドは実行されない | 例外が発生していないこと(終了後のステータスが0であること)<br/>→ 「click」 が表示されないこと |
38
+ | whenを使用しての実行時の動き | 出力されるメッセージに click が含まれないこと(終了後のステータスが0であること) | 20 | 違う条件を指定したテスト実行で該当のprocが実行されないこと | 1. STAGE=staging bucky run -d -D -pc -c pc_e2e_4<br/>- 以下シナリオファイル内の処理 -<br/>2. goメソッド実行 (http://bucky.net)<br/>2. whenを使ったclickメソッドは実行されない | 例外が発生していないこと(終了後のステータスが0であること)<br/>→ 「click」 が表示されないこと |
@@ -0,0 +1,42 @@
1
+ #!/usr/bin/env bats
2
+
3
+ BUCKY_PROJECT_NAME=bats_test
4
+ TEST_SERVICE=test_service
5
+
6
+ setup() {
7
+ rm -rf /tmp/$BUCKY_PROJECT_NAME
8
+ cd /tmp/
9
+ bucky new $BUCKY_PROJECT_NAME
10
+ }
11
+
12
+ teardown() {
13
+ rm -rf /tmp/$BUCKY_PROJECT_NAME
14
+ }
15
+
16
+ @test "#14 After executing 'new' command, expected files and directories are created" {
17
+ run diff /bucky-core/template/new/ /tmp/$BUCKY_PROJECT_NAME
18
+ [ $status -eq 0 ]
19
+ }
20
+
21
+ @test "#15 After executing 'make service' command, expected directory is created" {
22
+ cd /tmp/$BUCKY_PROJECT_NAME
23
+ bucky make service $TEST_SERVICE
24
+ run ls /tmp/$BUCKY_PROJECT_NAME/services/$TEST_SERVICE
25
+ [ $status -eq 0 ]
26
+ }
27
+
28
+ @test "#16 After executing 'make page' command, expected page and parts file are created" {
29
+ cd /tmp/$BUCKY_PROJECT_NAME
30
+ bucky make service $TEST_SERVICE
31
+ bucky make page test_page --service $TEST_SERVICE --device pc
32
+ run ls /tmp/$BUCKY_PROJECT_NAME/services/$TEST_SERVICE/pc/pageobject/test_page.rb
33
+ [ $status -eq 0 ]
34
+ run ls /tmp/$BUCKY_PROJECT_NAME/services/$TEST_SERVICE/pc/parts/test_page.yml
35
+ [ $status -eq 0 ]
36
+ }
37
+
38
+ @test "#17 After executing undefined command, show error message and exit" {
39
+ cd /tmp/$BUCKY_PROJECT_NAME
40
+ run bucky hoge fuga
41
+ [ $(expr "$output" : ".*Invalid command error.*") -ne 0 ]
42
+ }
@@ -0,0 +1,75 @@
1
+ #!/usr/bin/env bats
2
+
3
+ setup() {
4
+ cd /bucky-core/system_testing/test_bucky_project
5
+ }
6
+
7
+ @test "#01 After executing e2e operate go, results have no failures nor errors" {
8
+ run bucky run -t e2e -d -D pc -c pc_e2e_1
9
+ [ $(expr "$output" : ".*0 failures, 0 errors,.*") -ne 0 ]
10
+ }
11
+
12
+ @test "#02 After executing e2e verify assert_title, results contain verify words and no failures/errors" {
13
+ run bucky run -t e2e -d -D pc -c pc_e2e_1
14
+ [ $(expr "$output" : ".*:verify.*assert_title.*") -ne 0 ]
15
+ [ $(expr "$output" : ".*0 failures, 0 errors,.*") -ne 0 ]
16
+ }
17
+
18
+ @test "#03 After executing e2e verify assert_title, results contain verify words and 1 failure" {
19
+ run bucky run -t e2e -d -D pc -c pc_e2e_2
20
+ [ $(expr "$output" : ".*:verify.*assert_title.*") -ne 0 ]
21
+ [ $(expr "$output" : ".*1 failures.*") -ne 0 ]
22
+ }
23
+
24
+ @test "#04 After executing e2e on pc , results contain 'Linux' and no failures/errors." {
25
+ run bucky run -t e2e -d -D pc -c pc_e2e_3
26
+ [ $(expr "$output" : ".*Linux.*") -ne 0 ]
27
+ [ $(expr "$output" : ".*0 failures, 0 errors,.*") -ne 0 ]
28
+ }
29
+
30
+ @test "#05 After executing e2e on sp , results contain 'iPhone' and no failures/errors." {
31
+ run bucky run -t e2e -d -D sp -c sp_e2e_1
32
+ [ $(expr "$output" : ".*iPhone.*") -ne 0 ]
33
+ [ $(expr "$output" : ".*0 failures, 0 errors,.*") -ne 0 ]
34
+ }
35
+
36
+ @test "#06 After executing e2e on tablet , results contain 'iPad' and no failures/errors." {
37
+ run bucky run -t e2e -d -D tablet -c tablet_e2e_1
38
+ [ $(expr "$output" : ".*iPad.*") -ne 0 ]
39
+ [ $(expr "$output" : ".*0 failures, 0 errors,.*") -ne 0 ]
40
+ }
41
+
42
+ @test "#07 After executing e2e operate go with setup each, results have no failures nor errors" {
43
+ run bucky run -d -c setup_each_pc_e2e_1
44
+ [ $(expr "$output" : ".*0 failures, 0 errors,.*") -ne 0 ]
45
+ }
46
+
47
+ @test "#08 After executing e2e operate go with teardown each, results have no failures nor errors" {
48
+ run bucky run -d -c teardown_each_pc_e2e_1
49
+ [ $(expr "$output" : ".*0 failures, 0 errors,.*") -ne 0 ]
50
+ }
51
+
52
+ @test "#09 When setup and teardown is added, multiple test cases execute normally, results have no failures nor errors" {
53
+ run bucky run -d -s setup_teardown_each_pc_e2e
54
+ [ $(expr "$output" : ".*0 failures, 0 errors,.*") -ne 0 ]
55
+ }
56
+
57
+ @test "#18 When 'when condition' is added, results have no failures nor errors" {
58
+ export STAGE=development
59
+ run bucky run -t e2e -d -D pc -c pc_e2e_4
60
+ [ $(expr "$output" : ".*click.*") -ne 0 ]
61
+ [ $(expr "$output" : ".*0 failures, 0 errors,.*") -ne 0 ]
62
+ }
63
+
64
+ @test "#19 When 'when condition' is not added, results have no click procedure" {
65
+ run bucky run -t e2e -d -D pc -c pc_e2e_4
66
+ [ $(expr "$output" : ".*click.*") -eq 0 ]
67
+ [ $(expr "$output" : ".*0 failures, 0 errors,.*") -ne 0 ]
68
+ }
69
+
70
+ @test "#20 When 'different when condition' is added, results have no click procedure" {
71
+ export STAGE=staging
72
+ run bucky run -t e2e -d -D pc -c pc_e2e_4
73
+ [ $(expr "$output" : ".*click.*") -eq 0 ]
74
+ [ $(expr "$output" : ".*0 failures, 0 errors,.*") -ne 0 ]
75
+ }
@@ -0,0 +1,24 @@
1
+ #!/usr/bin/env bats
2
+
3
+ setup() {
4
+ cd /bucky-core/system_testing/test_bucky_project
5
+ }
6
+
7
+ teardown() {
8
+ # No failures and errors
9
+ [ $(expr "$output" : ".*0 failures, 0 errors,.*") -ne 0 ]
10
+ }
11
+
12
+ @test "#10,#12 After executing linkstatus on pc , results contain target base url and no failures/errors." {
13
+ run bucky run -t linkstatus -d -D pc -c pc_link_1
14
+ [ $(expr "$output" : ".*http://bucky\.net.*") -ne 0 ]
15
+ }
16
+
17
+ @test "#11 After executing linkstatus on pc , results contain target link url and no failures/errors." {
18
+ run bucky run -t linkstatus -d -D pc -c pc_link_1
19
+ [ $(expr "$output" : ".*http://bucky\.net/test_page.html.*") -ne 0 ]
20
+ }
21
+
22
+ @test "#13 After executing linkstatus on sp , results have no failures nor errors" {
23
+ run bucky run -t linkstatus -d -D sp -c sp_link_1
24
+ }
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'bucky/test_equipment/pageobject/base_pageobject'
4
+ module Services
5
+ module {SampleService}
6
+ module Pc
7
+ module PageObject
8
+ class {SamplePage} < Bucky::TestEquipment::PageObject::BasePageObject
9
+
10
+ protected
11
+
12
+ # Add some user operations for this page
13
+ # Sample ====================
14
+ # @param [Hash] args
15
+ # def search_freeword(**args)
16
+ # freeword_form.send_keys(args[:word])
17
+ # freeword_form.submit
18
+ # end
19
+ end
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,9 @@
1
+ # Add some parts for this page
2
+
3
+ # Sample ====================
4
+ # freewod_form:
5
+ # - xpath
6
+ # - "//*[@id='freeword']"
7
+ # photos:
8
+ # - xpaths
9
+ # - "//*[@class='photo']"
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'bucky/test_equipment/pageobject/base_pageobject'
4
+
5
+ module Services
6
+ module {SampleService}
7
+ module Sp
8
+ module PageObject
9
+ class {SamplePage} < Bucky::TestEquipment::PageObject::BasePageObject
10
+
11
+ protected
12
+
13
+ # Add some user operations for this page
14
+ # Sample ====================
15
+ # @param [Hash] args
16
+ # def search_freeword(**args)
17
+ # freeword_form.send_keys(args[:word])
18
+ # freeword_form.submit
19
+ # end
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,9 @@
1
+ # add some parts for this page
2
+
3
+ # sample ====================
4
+ # freewod_form:
5
+ # - xpath
6
+ # - "//*[@id='freeword']"
7
+ # photos:
8
+ # - xpaths
9
+ # - "//*[@class='photo']"
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'bucky/test_equipment/pageobject/base_pageobject'
4
+
5
+ module Services
6
+ module {SampleService}
7
+ module Tablet
8
+ module PageObject
9
+ class {SamplePage} < Bucky::TestEquipment::PageObject::BasePageObject
10
+
11
+ protected
12
+
13
+ # Add some user operations for this page
14
+ # Sample ====================
15
+ # @param [Hash] args
16
+ # def search_freeword(**args)
17
+ # freeword_form.send_keys(args[:word])
18
+ # freeword_form.submit
19
+ # end
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end