Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'remotes/dev/master'
- Loading branch information
Showing
3 changed files
with
132 additions
and
1 deletion.
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
65 changes: 65 additions & 0 deletions
65
src/Oro/Bundle/SalesBundle/Tests/Behat/Features/Fixtures/opportunity_send_email_action.yml
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,65 @@ | ||
Oro\Bundle\ContactBundle\Entity\ContactEmail: | ||
contact-email-1: | ||
email: contactEmail1@example.com | ||
primary: true | ||
contact-email-2: | ||
email: contactEmail2@example.com | ||
primary: true | ||
|
||
Oro\Bundle\ContactBundle\Entity\Contact: | ||
contact-w-name-email: | ||
firstName: 'test Contact' | ||
lastName: 'with Email' | ||
emails: ['@contact-email-1'] | ||
owner: '@admin' | ||
organization: '@organization' | ||
createdAt: <dateTimeBetween('now', 'now')> | ||
contact-wo-name: | ||
emails: ['@contact-email-2'] | ||
owner: '@admin' | ||
organization: '@organization' | ||
createdAt: <dateTimeBetween('now', 'now')> | ||
contact-wo-email: | ||
firstName: 'test Contact' | ||
lastName: 'without Email' | ||
owner: '@admin' | ||
organization: '@organization' | ||
createdAt: <dateTimeBetween('now', 'now')> | ||
|
||
Oro\Bundle\AccountBundle\Entity\Account: | ||
account-1: | ||
name: 'test Account' | ||
owner: '@admin' | ||
organization: '@organization' | ||
|
||
Oro\Bundle\SalesBundle\Entity\Customer: | ||
customer-1: | ||
account: '@account-1' | ||
|
||
Oro\Bundle\SalesBundle\Entity\Opportunity: | ||
opportunity-wo-contact: | ||
name: 'opportunity wo contact' | ||
customerAssociation: '@customer-1' | ||
organization: '@organization' | ||
owner: '@admin' | ||
|
||
opportunity-w-contact: | ||
name: 'opportunity w contact name and email' | ||
customerAssociation: '@customer-1' | ||
contact: '@contact-w-name-email' | ||
organization: '@organization' | ||
owner: '@admin' | ||
|
||
opportunity-w-contact-no-name: | ||
name: 'opportunity w contact no name' | ||
customerAssociation: '@customer-1' | ||
contact: '@contact-wo-name' | ||
organization: '@organization' | ||
owner: '@admin' | ||
|
||
opportunity-w-contact-no-email: | ||
name: 'opportunity w contact no email' | ||
customerAssociation: '@customer-1' | ||
contact: '@contact-wo-email' | ||
organization: '@organization' | ||
owner: '@admin' |
61 changes: 61 additions & 0 deletions
61
src/Oro/Bundle/SalesBundle/Tests/Behat/Features/opportunity_send_email_action.feature
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,61 @@ | ||
@ticket-CRM-8723 | ||
@fixture-OroSalesBundle:opportunity_send_email_action.yml | ||
|
||
Feature: Opportunity send email action | ||
As administrator | ||
I need to have ability to send email to contact assigned to opportunity | ||
Customer email address title should be taken from contact | ||
In case contact do not has `NamePrefix` && `FirstName` && `MiddleName` && `LastName` && `NameSuffix` title should be | ||
created from opportunity record | ||
|
||
Scenario: Checks opportunities grid | ||
Given I login as administrator | ||
And I go to Sales/ Opportunities | ||
And I should see following grid: | ||
| Opportunity name | | ||
| opportunity w contact no email | | ||
| opportunity w contact no name | | ||
| opportunity w contact name and email | | ||
| opportunity wo contact | | ||
|
||
Scenario: Check opportunity contact that has only name, "Send Email" dialog should have empty field "To" | ||
Given I click view opportunity w contact no email in grid | ||
And I follow "More actions" | ||
And press "Send email" | ||
Then "Email Form" must contains values: | ||
| From | "John Doe" <admin@example.com> | | ||
When I press "Send" | ||
Then I should see "Email Form" validation errors: | ||
| ToField | This value contains not valid email address. | | ||
| Subject | This value should not be blank. | | ||
And I close ui dialog | ||
|
||
Scenario: Check opportunity contact that has only email address, "Send Email" dialog should have field "To" containing opportunity title and contact email | ||
And I click view opportunity w contact no name in grid | ||
And I follow "More actions" | ||
And press "Send email" | ||
Then "Email Form" must contains values: | ||
| From | "John Doe" <admin@example.com> | | ||
| ToField | ["opportunity w contact no name" <contactEmail2@example.com> (Contact)] | | ||
And I close ui dialog | ||
|
||
Scenario: Check opportunity contact that has name and email, "Send Email" dialog should have field "To" containing contacts title and email | ||
And I click view opportunity w contact name and email in grid | ||
And I follow "More actions" | ||
And press "Send email" | ||
Then "Email Form" must contains values: | ||
| From | "John Doe" <admin@example.com> | | ||
| ToField | ["test Contact with Email" <contactEmail1@example.com> (Contact)] | | ||
And I close ui dialog | ||
|
||
Scenario: Check opportunity that do NOT has contact, "Send Email" dialog should have empty field "To" | ||
Given I click view opportunity wo contact in grid | ||
And I follow "More actions" | ||
And press "Send email" | ||
Then "Email Form" must contains values: | ||
| From | "John Doe" <admin@example.com> | | ||
When I press "Send" | ||
Then I should see "Email Form" validation errors: | ||
| ToField | This value contains not valid email address. | | ||
| Subject | This value should not be blank. | | ||
And I close ui dialog |