Feature #3751

Add id='new' to all buttons/links that create new objects

Added by Og Maciel almost 4 years ago. Updated over 3 years ago.

Status:Closed
Priority:Normal
Assigned To:Lukas Zapletal
Category:Web Interface
Target version:Sprint 20
Difficulty:trivial Bugzilla link:
Found in release: Pull request:
Story points-
Velocity based estimate-
Release1.5.0Release relationshipAuto

Description

QE would like to request that every button/link responsible for creating new objects (i.e. Environments, Users, Roles, OS, etc) have a id='new' attribute for easier locating UI elements during automation.


Related issues

Related to Foreman - Bug #4441: Overriden 'link_to' is protected and breaks expected use ... Closed 02/25/2014
Related to Foreman - Bug #11828: Undefined method 'split' for nil:NilClass traceback when ... Closed 09/15/2015

Associated revisions

Revision bfee97b6
Added by Lukas Zapletal over 3 years ago

fixes #3751 - new/edit submit buttons now have id

History

#1 Updated by Og Maciel almost 4 years ago

Should have also added "Delete/Edit/Cancel/Yes/No" to that list

#2 Updated by Ohad Levy almost 4 years ago

  • Status changed from New to Feedback

rails generate that ID by default to all forms, for example, a new domain would have id=new_domain, editing a domain would have id=edit_domain_<numberical_id>

#3 Updated by Ohad Levy almost 4 years ago

  • Status changed from Feedback to New

oh, i didnt read it right, you were not only talking about the form, reopening.

#4 Updated by Dominic Cleal almost 4 years ago

  • Category set to Web Interface

#5 Updated by Dominic Cleal almost 4 years ago

  • Target version set to Sprint 18

#6 Updated by Lukas Zapletal almost 4 years ago

  • Status changed from New to Assigned
  • Assigned To set to Lukas Zapletal

Taking.

#7 Updated by Dmitri Dolguikh over 3 years ago

  • Target version changed from Sprint 18 to Sprint 19

#8 Updated by Dominic Cleal over 3 years ago

  • Status changed from Assigned to New
  • Assigned To deleted (Lukas Zapletal)

#9 Updated by Lukas Zapletal over 3 years ago

  • Status changed from New to Ready For Testing
  • Assigned To set to Lukas Zapletal
  • Difficulty set to trivial

https://github.com/theforeman/foreman/pull/1146

Og please test this patch if it works for you. Should cover most cases.

#10 Updated by Og Maciel over 3 years ago

Lukas, I applied this patch and restarted foreman. Then I tried to create a new operating system via the web ui. The New Operating system button had the following markup:

<div class="btn-toolbar pull-right">
    <a class="btn btn-success" href="/operatingsystems/new"></a>
</div>

I clicked it and then looked at the source for the Cancel and Submit buttons:

<form id="new_operatingsystem" class="form-horizontal well" method="post" action="/operatingsystems" accept-charset="UTF-8">
    <div class="fr close-button"></div>
    <div style="margin:0;padding:0;display:inline"></div>
    <ul class="nav nav-tabs" data-tabs="tabs"></ul>
    <div class="tab-content"></div>
    <div class="form-actions">
        <a class="btn btn-default two-pane-close" href="/operatingsystems"></a>
        <input class="btn btn-primary" type="submit" value="Submit" name="commit"></input>
    </div>
</form>

I expected to see unique IDs for the buttons but that doesn't seem to be working for this page. To be clear then, I see that the form has a unique ID but not the buttons. Is this the intention with the patch?

#11 Updated by Og Maciel over 3 years ago

ok, so I missed one part of the patch. Once that was fixed I did get a ID for the submit buttons but after talking to Lukaz, he will also try to add IDs to more types of buttons (e.g. Cancel, Yes, No, etc)

#12 Updated by Dmitri Dolguikh over 3 years ago

  • Target version changed from Sprint 19 to Sprint 20

#13 Updated by Dominic Cleal over 3 years ago

  • Release set to 1.5.0

#14 Updated by Lukas Zapletal over 3 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

#15 Updated by Dominic Cleal over 3 years ago

  • Related to Bug #4441: Overriden 'link_to' is protected and breaks expected use pattern added

#16 Updated by Dominic Cleal about 2 years ago

  • Related to Bug #11828: Undefined method 'split' for nil:NilClass traceback when accessing /about added

Also available in: Atom PDF