[QA] License check/setting in EE Review Apps is failing when Review App doesn't start properly
As can be seen here in https://gitlab.com/gitlab-org/gitlab-ee/-/jobs/127889498, there is an ambiguous match when trying to sign-out after setting/checking the license:
D, [2018-11-30T12:53:47.857829 #25] DEBUG -- : with wait: max 500; time 0.1; reload true
D, [2018-11-30T12:53:47.888709 #25] DEBUG -- : ended wait after 0.03061556 seconds
D, [2018-11-30T12:53:48.040850 #25] DEBUG -- : has_element? :sign_in_tab returned true
D, [2018-11-30T12:53:48.040941 #25] DEBUG -- : clicking :sign_in_tab
D, [2018-11-30T12:53:48.040974 #25] DEBUG -- : finding :sign_in_tab
D, [2018-11-30T12:53:48.059651 #25] DEBUG -- : found :sign_in_tab
D, [2018-11-30T12:53:48.128016 #25] DEBUG -- : has_element? :standard_tab returned false
D, [2018-11-30T12:53:48.128095 #25] DEBUG -- : filling :login_field with "root"
D, [2018-11-30T12:53:48.128124 #25] DEBUG -- : finding :login_field
D, [2018-11-30T12:53:48.160879 #25] DEBUG -- : found :login_field
D, [2018-11-30T12:53:48.228771 #25] DEBUG -- : filling :password_field with "*****"
D, [2018-11-30T12:53:48.228843 #25] DEBUG -- : finding :password_field
D, [2018-11-30T12:53:48.263898 #25] DEBUG -- : found :password_field
D, [2018-11-30T12:53:48.396063 #25] DEBUG -- : clicking :sign_in_button
D, [2018-11-30T12:53:48.396448 #25] DEBUG -- : finding :sign_in_button
D, [2018-11-30T12:53:48.429711 #25] DEBUG -- : found :sign_in_button
D, [2018-11-30T12:53:54.145691 #25] DEBUG -- : clicking :admin_area_link
D, [2018-11-30T12:53:54.145763 #25] DEBUG -- : finding :admin_area_link
D, [2018-11-30T12:53:54.176794 #25] DEBUG -- : found :admin_area_link
D, [2018-11-30T12:53:55.748222 #25] DEBUG -- : clicking :link_license_menu
D, [2018-11-30T12:53:55.750766 #25] DEBUG -- : finding :link_license_menu
D, [2018-11-30T12:53:55.788593 #25] DEBUG -- : found :link_license_menu
D, [2018-11-30T12:53:57.774527 #25] DEBUG -- : has_element? :remove_license_link returned true
D, [2018-11-30T12:53:57.802045 #25] DEBUG -- : clicking :user_avatar
D, [2018-11-30T12:53:57.802119 #25] DEBUG -- : finding :user_avatar
D, [2018-11-30T12:53:57.833058 #25] DEBUG -- : found :user_avatar
bundler: failed to load command: bin/qa (bin/qa)
Capybara::Ambiguous: Ambiguous match, found 7 elements matching visible css ".dropdown-menu" within #<Capybara::Node::Element tag="header" path="/html/body/header">
/usr/local/bundle/gems/capybara-2.16.1/lib/capybara/node/finders.rb:311:in `block in synced_resolve'
/usr/local/bundle/gems/capybara-2.16.1/lib/capybara/node/base.rb:85:in `synchronize'
/usr/local/bundle/gems/capybara-2.16.1/lib/capybara/node/finders.rb:302:in `synced_resolve'
/usr/local/bundle/gems/capybara-2.16.1/lib/capybara/node/finders.rb:37:in `find'
/usr/local/bundle/gems/capybara-2.16.1/lib/capybara/session.rb:810:in `block (2 levels) in <class:Session>'
/usr/local/bundle/gems/capybara-2.16.1/lib/capybara/session.rb:340:in `within'
/home/qa/qa/page/main/menu.rb:89:in `block in within_user_menu'
/home/qa/qa/page/main/menu.rb:81:in `block in within_top_menu'
/usr/local/bundle/gems/capybara-2.16.1/lib/capybara/session.rb:343:in `within'
/home/qa/qa/page/main/menu.rb:80:in `within_top_menu'
/home/qa/qa/page/main/menu.rb:86:in `within_user_menu'
/home/qa/qa/page/main/menu.rb:54:in `sign_out'
/home/qa/qa/scenario/actable.rb:14:in `perform'
/home/qa/qa/ee/resource/license.rb:16:in `fabricate!'
/home/qa/qa/resource/base.rb:66:in `block (2 levels) in fabricate_via_browser_ui!'
/home/qa/qa/resource/base.rb:106:in `log_fabrication'
/home/qa/qa/resource/base.rb:66:in `block in fabricate_via_browser_ui!'
/home/qa/qa/resource/base.rb:89:in `do_fabricate!'
/home/qa/qa/resource/base.rb:65:in `fabricate_via_browser_ui!'
/home/qa/qa/resource/base.rb:57:in `rescue in fabricate!'
/home/qa/qa/resource/base.rb:54:in `fabricate!'
/home/qa/qa/ee/strategy.rb:14:in `block in perform_before_hooks'
/home/qa/qa/runtime/browser.rb:130:in `perform'
/home/qa/qa/runtime/browser.rb:28:in `visit'
/home/qa/qa/runtime/browser.rb:32:in `visit'
/home/qa/qa/ee/strategy.rb:13:in `perform_before_hooks'
/home/qa/qa/runtime/release.rb:24:in `public_send'
/home/qa/qa/runtime/release.rb:24:in `method_missing'
/home/qa/qa/scenario/template.rb:27:in `perform'
/home/qa/qa/scenario/template.rb:8:in `block in perform'
/home/qa/qa/scenario/template.rb:6:in `tap'
/home/qa/qa/scenario/template.rb:6:in `perform'
/home/qa/qa/scenario/bootable.rb:14:in `launch!'
bin/qa:7:in `<top (required)>'
And indeed, by inspecting any page on GitLab.com, there are 7 elements matching .dropdown-menu
under the .qa-navbar
element.
That said Capybara is only matching visible elements, and that's why it's usually working fine since only the user dropdown is visible.
That means the Review App doesn't properly start and the CSS is broken somehow. Unfortunately we only configure Capybara/RSpec after this hook, so we don't have any screenshots taken...