Skip to content

Commit

Permalink
Merge branch '2.0' into 2
Browse files Browse the repository at this point in the history
  • Loading branch information
emteknetnz committed Jul 30, 2023
2 parents c0ed41c + 964e687 commit 177c9ad
Showing 1 changed file with 27 additions and 4 deletions.
31 changes: 27 additions & 4 deletions tests/behat/features/gridfield-search.feature
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,19 @@ Feature: Search in GridField
Background:
Given the "Company" "Walmart" with "Category"="Retail"
And the "Company" "ExxonMobil" with "Category"="Oil"
And the "Company" "Vitol" with "Category"="Other"
And the "group" "EDITOR" has permissions "Access to 'Pages' section" and "Access to 'Test ModelAdmin' section" and "TEST_DATAOBJECT_EDIT"
And the "Company" "Chevron" with "Category"="Oil"
And the "Company" "ConocoPhillips" with "Category"="Oil"
And the "Company" "Saudi Aramco" with "Category"="Oil"
And the "Company" "Eni" with "Category"="Oil"
And the "Company" "Gazprom" with "Category"="Oil"
And the "Company" "Pemex" with "Category"="Oil"
And the "Company" "Vitol" with "Category"="Other"
And the "group" "EDITOR" has permissions "Access to 'Pages' section" and "Access to 'Test ModelAdmin' section" and "Access to 'GridField Test Navigation' section" and "TEST_DATAOBJECT_EDIT"
And I am logged in as a member of "EDITOR" group
And I go to "/admin/test"

Scenario: I can search and go to item
When I press the "Open search and filter" button
When I go to "/admin/test"
And I press the "Open search and filter" button
And I press the "Advanced" button
Then I should see a "#Form_CompaniesSearchForm_Search_Name.no-change-track" element
And I fill in "Search__Name" with "Walmart"
Expand All @@ -23,3 +29,20 @@ Feature: Search in GridField
And I click "Walmart" in the "#Form_EditForm" element
Then I should see "Walmart"
And I should see "Walmart" in the ".breadcrumbs-wrapper" element

Scenario: I can see pagination after search
When I go to "/admin/gridfield-test-navigation"
And I should see "Walmart" in the "#Form_EditForm" element
And I press the "Open search and filter" button
And I press the "Advanced" button
And I fill in "Search__Category" with "Oil"
And I press the "Enter" key in the "Search__Category" field
Then I should see "ExxonMobil" in the "#Form_EditForm" element
But I should not see "Walmart" in the ".col-Name" element
And I should not see "Vitol" in the ".col-Name" element
And I should see "2" in the ".pagination-page-number" element
And I should see "View 1–5 of 7" in the ".pagination-records-number" element
Then I click on the "#action_pagination_next" element
And I should see "View 6–7 of 7" in the ".pagination-records-number" element
And I should see "Pemex" in the "#Form_EditForm" element

0 comments on commit 177c9ad

Please sign in to comment.