diff options
author | Eric Eastwood <contact@ericeastwood.com> | 2017-10-16 12:37:52 -0500 |
---|---|---|
committer | Eric Eastwood <contact@ericeastwood.com> | 2017-10-19 14:01:15 -0500 |
commit | 43377979c6cfee922702a5dc6324fded96b1f111 (patch) | |
tree | 8ac0061a979a611c9927e04815a1df5a71d2d505 /spec/features/boards | |
parent | 96d8c7fff114911faa7d3e1b6322c2b9e3377e9b (diff) | |
download | gitlab-ce-43377979c6cfee922702a5dc6324fded96b1f111.tar.gz |
Check for element before evaluate_script
Tip from
https://robots.thoughtbot.com/write-reliable-asynchronous-integration-tests-with-capybara#directly-interacting-with-javascript
Diffstat (limited to 'spec/features/boards')
-rw-r--r-- | spec/features/boards/boards_spec.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/spec/features/boards/boards_spec.rb b/spec/features/boards/boards_spec.rb index 91c4e5037de..60ed17c0c81 100644 --- a/spec/features/boards/boards_spec.rb +++ b/spec/features/boards/boards_spec.rb @@ -171,12 +171,14 @@ describe 'Issue Boards', :js do expect(page).to have_selector('.card', count: 20) expect(page).to have_content('Showing 20 of 58 issues') + find('.board .board-list') evaluate_script("document.querySelectorAll('.board .board-list')[1].scrollTop = document.querySelectorAll('.board .board-list')[1].scrollHeight") wait_for_requests expect(page).to have_selector('.card', count: 40) expect(page).to have_content('Showing 40 of 58 issues') + find('.board .board-list') evaluate_script("document.querySelectorAll('.board .board-list')[1].scrollTop = document.querySelectorAll('.board .board-list')[1].scrollHeight") wait_for_requests @@ -449,11 +451,13 @@ describe 'Issue Boards', :js do expect(page).to have_selector('.card', count: 20) expect(page).to have_content('Showing 20 of 51 issues') + find('.board .board-list') evaluate_script("document.querySelectorAll('.board .board-list')[1].scrollTop = document.querySelectorAll('.board .board-list')[1].scrollHeight") expect(page).to have_selector('.card', count: 40) expect(page).to have_content('Showing 40 of 51 issues') + find('.board .board-list') evaluate_script("document.querySelectorAll('.board .board-list')[1].scrollTop = document.querySelectorAll('.board .board-list')[1].scrollHeight") expect(page).to have_selector('.card', count: 51) |