Skip to content

Commit bcb347e

Browse files
author
Sabina Talipova
committed
MNT New Behat tests for toast messages
1 parent 8e6ffcf commit bcb347e

File tree

1 file changed

+60
-0
lines changed

1 file changed

+60
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
Feature: Show toast messages
2+
As an author
3+
I want to see toast message in the CMS when I create, edit, delete, publish, unpublish, archive a record
4+
5+
Background:
6+
Given the "Company" "Company A" with "Category"="Other"
7+
And the "Company" "Company B" with "Category"="Other"
8+
And the "Company" "Company C" with "Category"="Other"
9+
And the "Employee" "Employee A" with "Company"="1"
10+
And the "Employee" "Employee B" with "Company"="1"
11+
And the "Employee" "Employee C" with "Company"="1"
12+
And the "group" "EDITOR" has permissions "Access to 'Pages' section" and "Access to 'Test ModelAdmin' section" and "TEST_DATAOBJECT_EDIT"
13+
And I am logged in as a member of "EDITOR" group
14+
And I go to "/admin/test"
15+
16+
Scenario: I can see toast message when I successfully create or publish a record
17+
When I press the "Add Company" button
18+
And I fill in "Name" with "My Company"
19+
And I press the "Create" button
20+
Then I should see a "Saved Company My Company successfully" success toast
21+
And I fill in "Name" with "My New Company"
22+
And I press the "Publish" button
23+
Then I should see a "Published Company My New Company" success toast
24+
25+
Scenario: I can see toast message when I successfully unpublish and archive a record
26+
When I click "Company B" in the "#Form_EditForm" element
27+
And I click "More options" in the "#ActionMenus" element
28+
And I press the "Unpublish" button, confirming the dialog
29+
Then I should see a "Unpublished Company Company B" success toast
30+
And I click "More options" in the "#ActionMenus" element
31+
And I press the "Archive" button, confirming the dialog
32+
And I should not see "Validation Error"
33+
And I should not see "Company B" in the "#Form_EditForm" element
34+
And I should see a "Archived Company Company B" success toast
35+
36+
Scenario: I can see toast message when I successfully delete a record
37+
When I click "Company A" in the "#Form_EditForm" element
38+
And I click "Employees" in the ".ui-tabs-nav" element
39+
Then I should see "Employee A" in the "#Form_ItemEditForm_Employees" element
40+
And I click "Employee A" in the "#Form_ItemEditForm_Employees" element
41+
And I press the "Delete" button, confirming the dialog
42+
Then I should see a "Deleted Employee Employee A" success toast
43+
Then I should not see "Employee A" in the "#Form_ItemEditForm_Employees" element
44+
45+
Scenario: I can see toast message when I have validation errors
46+
When I click "Company C" in the "#Form_EditForm" element
47+
And I fill in "Name" with ""
48+
And I press the "Save" button
49+
Then I should see "Validation Error"
50+
And I fill in "Name" with "New Company C"
51+
Then I should see a "Saved Company New Company C successfully" success toast
52+
53+
Scenario: I can see toast message when I have validation errors when I edit a nested record
54+
When I click "Company A" in the "#Form_EditForm" element
55+
And I click "Employees" in the ".ui-tabs-nav" element
56+
Then I should see "Employee B" in the "#Form_ItemEditForm_Employees" element
57+
And I click "Employee B" in the "#Form_ItemEditForm_Employees" element
58+
And I fill in "Name" with ""
59+
And I press the "Save" button
60+
Then I should see "Validation Error"

0 commit comments

Comments
 (0)