Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

[2012-12-11] BEHAT: Create a feature file and script for Gridfield pagination in Asset Admin #610

Closed
silverstripe-issues opened this Issue Apr 3, 2013 · 5 comments

Comments

Projects
None yet
3 participants

created by: @jbridson (jbridson)
created at: 2012-12-11
original ticket: http://open.silverstripe.org/ticket/8087


As an Content Editor I would like to be able to page through a list of folders and files in the "Files" section in the CMS.

Acceptance Criteria:

  • I can log in as a "Content Editor" or "Administrator"
  • I can click on "Files" in the left navigation
  • I can see a list of files and folders in the root
  • I can only see files/folders that are in the current folder
  • Files/folders in subfolders are not visible unless I drill down
  • If there are more than 15 folders or files I can see the pagination
  • I can navigate to the next pages to see the remaining files/folders
  • I can navigate back to the previous pages
  • I can see how many files there are total and where I am incontext
  • Sorting should not change when paging through files/folders
  Scenario: I can view multiple pages of files/folders in the Asset Admin section
    Given I am logged into the CMS either as a "Content Editor" or as an "Administrator" 
    And I go to /admin/assets
    And I have more than 15 files or folders in my Asset Admin root folder 
    Then I should see the pagination at the bottom of the table 
    And I should be able to navigate to the next page 
    And I should be able to navigate back to the previous page 
    And I should be able to navigate to the last page 
    And I should be able to navigate back to the first page 
    And I should be able to type in what I page I want to go to and hit enter to navigate to that page

comment by: @chillu (ischommer)
created at: 2012-12-11


"I can only see files/folders that are in the current folder " - I think that's too specific,
we'll get lost in step definitions if we write them on that level. Can we change it to something like
"Then I can see 'file-in-folder1', But I can not see 'file-in-folder2'"?

"If there are more than 15 folders or files I can see the pagination" - that should be the base condition,
we need to set up at least 16 fixtures here, but for the whole scenario, not in the middle of it.
We could test for UIs with/without pagination, but that's going too far I think.

Remember, we need to maintain these tests going forward, so the trick is
to reduce them to a sensible set of smoke tests, rather than a lot of copy paste and full coverage.
Just to give you an impression of these maintenance costs: Fixing up existing preview tests (about 20 lines)
took me over four hours in order to make them work with the new side-by-side preview UI.

comment by: @jbridson (jbridson)
created at: 2012-12-12


Scenario: I can view multiple pages of files/folders in the Asset Admin section
    Given there are the following "file" records
    """
    <more than 15 files>
    <a folder containing a file>
    """
    And I am on" /admin/assets"
    Then I should see a "datagrid-pagination" element
    When I press "ss-gridfield-nextpage"
    Then the "ss-gridfield-table" table should contain "<File at root level>"
    But the "ss-gridfield-table" table should not contain "<File contained within subfolder>"

This is just a work in progress - it is not necessarily proper syntax (I was unsure how to create files and folders) Hopefully it is an improvement on the initial test

comment by: @chillu (ischommer)
created at: 2012-12-12


Thanks for aligning the steps with existing step definitions!
If the button has a title, we can use that to address it as well.
Gets us into trouble if multiple buttons have the same title (e.g. multiple paginated GridFields), but for the asset admin we're safe.

comment by: @chillu (ischommer)
created at: 2013-01-31


That'll need a whole lot more Cucumber writing until the script satisfies all the criteria.

@simonwelsh simonwelsh added the 3.1 label Mar 16, 2014

Owner

sminnee commented May 17, 2017

Obsolete.

@sminnee sminnee closed this May 17, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment