gtt-project / redmine_custom_fields_groups

Redmine plugin for grouping custom fields.
GNU General Public License v3.0
12 stars 4 forks source link

Support Test and CI #26

Closed sanak closed 3 months ago

sanak commented 4 months ago

Supports #24, #22, #23, etc.

Changes proposed in this pull request:

@gtt-project/maintainer

sanak commented 4 months ago

@mopinfish 別件で、ローカルmacOS環境でのテストで、システムテストがランダムに失敗することを確認しましたので、少し調整するようにします。

% bundle exec rake redmine:plugins:test NAME=redmine_custom_fields_groups RAILS_ENV=test
PG::Coder.new(hash) is deprecated. Please use keyword arguments instead! Called from /Users/sanak/Projects/gtt-project/git/redmine-custom-fields-groups/vendor/bundle/ruby/3.2.0/gems/activerecord-6.1.7.7/lib/active_record/connection_adapters/postgresql_adapter.rb:883:in `new'
PG::Coder.new(hash) is deprecated. Please use keyword arguments instead! Called from /Users/sanak/Projects/gtt-project/git/redmine-custom-fields-groups/vendor/bundle/ruby/3.2.0/gems/activerecord-6.1.7.7/lib/active_record/connection_adapters/postgresql_adapter.rb:883:in `new'
Run options: --seed 50837

# Running:

..................Capybara starting Puma...
* Version 6.4.2, codename: The Eagle of Durango
* Min threads: 0, max threads: 4
* Listening on http://127.0.0.1:55498
[Screenshot Image]: /Users/sanak/Projects/gtt-project/git/redmine-custom-fields-groups/tmp/screenshots/failures_test_click_group_label_should_collapse-expand_fieldset_with_default_state_all_expended.png
F

Failure:
FieldsetTest#test_click_group_label_should_collapse/expand_fieldset_with_default_state_all_expended [plugins/redmine_custom_fields_groups/test/system/fieldset_test.rb:53]:
Expected false to be truthy.

rails test plugins/redmine_custom_fields_groups/test/system/fieldset_test.rb:16

......

Finished in 9.333095s, 2.6786 runs/s, 23.5720 assertions/s.
25 runs, 220 assertions, 1 failures, 0 errors, 0 skips
sanak commented 4 months ago

@mopinfish 上記のシステムテストがランダムに失敗する問題については、Issueの編集モード切り替え後の初回の操作で発生するようでしたので、編集(Edit)リンクのクリック後に編集画面の展開とコメント欄へのフォーカス設定が完了するまで待った上で、さらにスリープ(0.1秒)を追加することで対応しました。(コミット差分: https://github.com/gtt-project/redmine_custom_fields_groups/pull/26/commits/5f2b99f69304450c3727298edff735155787004e)

      # issue edit
      page.first(:link, 'Edit').click
+     page.find('#issue_notes:focus')
+     sleep 0.1

Redmine本体側のIssueの編集(Edit)リンククリック時処理:


合わせて、システムテストのテスト名とコメント箇所を少し変更しました(コミット差分:https://github.com/gtt-project/redmine_custom_fields_groups/pull/26/commits/8bc320d726cd22293adcb616044e746e18bb47db) 。 (フィールドセットのラベル箇所の名称を、 ビュー での変数名(title)に合わせています。)

お手数ですが、お手すきの際に再度確認頂けると助かります。🙇

sanak commented 3 months ago

@mopinfish 確認頂き、ありがとうございます! 一旦マージ後、README.mdの更新(#18)の方を進めていくようにします。🙇