Bug 1017496

Summary: user and group typeaheads do not work when web UI is mounted at /bkr prefix (404 for /users/+typeahead)
Product: [Retired] Beaker Reporter: Dan Callaghan <dcallagh>
Component: web UIAssignee: Dan Callaghan <dcallagh>
Status: CLOSED CURRENTRELEASE QA Contact: tools-bugs <tools-bugs>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 0.15CC: aigao, asaha, dcallagh, jingwang, llim, qwan, rmancy
Target Milestone: 0.15.1   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-10-23 06:59:47 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Dan Callaghan 2013-10-10 03:34:20 UTC
Description of problem:
The user and group typeaheads use hardcoded URLs of /users/+typeahead and /groups/+typeahead respectively, ignoring any server.webpath prefix for the web UI (by default this is /bkr).

Version-Release number of selected component (if applicable):
0.15.0

How reproducible:
on new installs and in dogfood jobs

Steps to Reproduce:
1. Install Beaker at the default prefix of /bkr
2. Go to the Access Policy tab for a system, type a username or group name

Actual results:
No typeahead suggestions appear, user/group cannot be added to the policy.

Expected results:
Typeaheads appear, user/group can be added to the policy.

Additional info:
This has been failing in the dogfood jobs the entire time but for some reason I had written the failure off as a timing issue:

======================================================================
ERROR: test_add_rule_for_new_user (bkr.inttest.server.selenium.test_system_access_policies.SystemAccessPolicyWebUITest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/bkr/inttest/server/selenium/test_system_access_policies.py", line 152, in test_add_rule_for_new_user
    self.find_checkbox('marple', 'Edit this policy').click()
  File "/usr/lib/python2.6/site-packages/bkr/inttest/server/selenium/test_system_access_policies.py", line 59, in find_checkbox
    row_elem = pane.find_element_by_xpath('.//table/tbody/tr[./*[1]/text()="%s"]' % row)
  File "/usr/lib64/python2.6/site-packages/selenium/webdriver/remote/webelement.py", line 120, in find_element_by_xpath
    return self.find_element(by=By.XPATH, value=xpath)
  File "/usr/lib64/python2.6/site-packages/selenium/webdriver/remote/webelement.py", line 235, in find_element
    {"using": by, "value": value})['value']
  File "/usr/lib64/python2.6/site-packages/selenium/webdriver/remote/webelement.py", line 228, in _execute
    return self._parent.execute(command, params)
  File "/usr/lib64/python2.6/site-packages/selenium/webdriver/remote/webdriver.py", line 165, in execute
    self.error_handler.check_response(response)
  File "/usr/lib64/python2.6/site-packages/selenium/webdriver/remote/errorhandler.py", line 164, in check_response
    raise exception_class(message, screen, stacktrace)
NoSuchElementException: Message: u'Unable to locate element: {"method":"xpath","selector":".//table/tbody/tr[./*[1]/text()=\\"marple\\"]"}' ; Stacktrace: 
    at <anonymous> (file:///tmp/tmpheUZxO/extensions/fxdriver/components/driver_component.js:8880)
    at <anonymous> (file:///tmp/tmpheUZxO/extensions/fxdriver/components/driver_component.js:396)

Comment 1 Dan Callaghan 2013-10-10 04:30:04 UTC
On Gerrit: http://gerrit.beaker-project.org/2344

Comment 6 wangjing 2013-10-15 07:30:28 UTC
verified on beaker-qe env(beaker-server-0.15.0-1.git.23.4a69b21.el6eng)-->pass

Steps:
1. Install Beaker at the default prefix of /bkr
2. Go to the Access Policy tab for a system, type a username or group name

Actual results:
same as expected results.

Expected results:
Typeaheads appear, user/group can be added to the policy.

Comment 7 Raymond Mancy 2013-10-23 06:59:47 UTC
beaker 0.15.1 has been released.