joomla-projects / gsoc16_browser-automated-tests

Joomla GSoC16: Project VIII: Browser Automated Tests for Joomla! CMS(covering Users and Content features)
https://summerofcode.withgoogle.com/projects/#5724182314745856
GNU General Public License v2.0
9 stars 28 forks source link

creating custom fields #125

Closed astridx closed 7 years ago

astridx commented 7 years ago

Summary of Changes

I created tests for testing custom fields I would be happy if some of you would give me a feedback.

This tests are working with the current joomla-cms version (Joomla! 3.7.0-beta2). I changed the url in my acceptance.suite.yml to a installation of the current joomla-cms staging branch. Older version are not possible, because custom fields have many changes in the last weeks.

Please have a look to the feature file. You can create one field or you can create many fields in one step.

Next you see as an example creating the calendar field with all possible options. You do not need to fill all options. You only need to fill the mandatory options.

  ###
  ### CALENDAR with all options
  ###
  Scenario: Create Calendar field
    Given There is a add field link
    And I click toolbar button "New"
    ##Title
    And I fill field title with "NewCalendarField"
    ##Type
    And I select field type "Calendar (calendar)"
    ##Label
    And I fill field label  with "Label for NewCalendarField"
    ##Description
    And I fill field description  with "Decription for NewCalendarField"
    ##Required
    And I check option required "Yes"
    And I check option required "No"
    ##Default #invalide default breaks the article view
    And I fill field default_value  with "2017-01-01"
    ##State
    And I select field state "Trashed"
    And I select field state "Published"
    And I select field state "Unpublished"
    And I select field state "Archived"
    ##FieldGroup
    And I select field group "NewFieldGroup"
    ##Categorie
    And I select field cat "Category_FieldGroupTest_2"
    And I unselect field cat "All"
    ##Access
    And I select field access "Public"
    And I select field access "Registered"
    And I select field access "Special"
    And I select field access "Super Users"
    ##Language
    And I select field language "English (en-GB)"
    ##Note
    And I fill field note with "My personal note"
    And I click toolbar button "Save"
    ##Placeholder
    And I fill field placeholder with "placeholder"
    ##Renderclass
    And I fill field renderclass with "renderclass"
    ##Editclass
    And I fill field editclass with "editclass"
    ##Disabled
    And I check option disabled "Yes"
    And I check option disabled "No"
    ##Readonly
    And I check option readonly "Yes"
    And I check option readonly "No"
    ##Showon
    And I check option showon "Site"
    And I check option showon "Administrator"
    And I check option showon "Both"
    ##Automaticdisplay
    And I select field automaticdisplay with "After Title"
    And I select field automaticdisplay with "Before Display"
    And I select field automaticdisplay with "After Display"
    And I select field automaticdisplay with "No"
    ##Extras for calendar field
    ##Showtime
    And I check option showtime "Yes"
    And I check option showtime "No"
    ##Save the field
    And I save and close custom field

Please see the feature file for an example to create many fields in one step. You can set all options for a field into one line. But you do not need to fill all options. You can leave all optional option empty.

@Niels Braczek Is this similar how you want to build your library?

zero-24 commented 7 years ago

:+1: @astridx

astridx commented 7 years ago

Closed, because there are many changes. I will renew it.