forked from silverstripe/silverstripe-admin
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MNT Add behat test for form validation
- Loading branch information
1 parent
cbccd37
commit c61ddbd
Showing
1 changed file
with
26 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
Feature: Form validation | ||
As a content author | ||
I want form validation to work in the CMS | ||
So that I know my data is sane | ||
|
||
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 I am logged in as a member of "EDITOR" group | ||
And I go to "/admin/test/SilverStripe-FrameworkTest-Model-Employee" | ||
And I press the "Add Employee" button | ||
|
||
@gsat | ||
Scenario: Field validation works as expected even if no validator is explicitly declared | ||
When I fill in "Name" with "any name" | ||
And I fill in "Email" with "invalid email" | ||
And I press the "Create" button | ||
Then I should not see "Saved Employee" | ||
And I should see "Please enter an email address" | ||
|
||
And I fill in "Email" with "email@example.com" | ||
And I press the "Create" button | ||
Then I should see "Saved Employee" | ||
And I should not see "Please enter an email address" |