-
Notifications
You must be signed in to change notification settings - Fork 100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
e2e send-email test scenarios #1637
Open
muminmmd
wants to merge
3
commits into
cdapio:develop
Choose a base branch
from
muminmmd:e2e-send-email
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
46 changes: 46 additions & 0 deletions
46
e2e-test/src/test/features/sendemail/source/ErrorScenariosSendEmailAlert.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,46 @@ | ||
@Send_Email | ||
Feature: Send Email Alert - Verify error scenarios | ||
|
||
@SEND_EMAIL-01 | ||
Scenario: Verify send email alert validation errors for mandatory fields | ||
Given Open Datafusion Project to configure pipeline | ||
And Click plugin property: "configureTab" | ||
And Click plugin property: "pipelineAlertTab" | ||
And Click plugin property: "createAlertButton" | ||
And Select send email alert plugin | ||
And Click on the Validate button | ||
And Verify mandatory property error for below listed properties: | ||
| sender | | ||
| recipients | | ||
| subject | | ||
| message | | ||
|
||
@SEND_EMAIL @PLUGIN-1253 | ||
Scenario: Validate proper format for sender field in send email plugin | ||
Given Open Datafusion Project to configure pipeline | ||
And Click plugin property: "configureTab" | ||
And Click plugin property: "pipelineAlertTab" | ||
And Click plugin property: "createAlertButton" | ||
And Select send email alert plugin | ||
And Select dropdown plugin property: "emailRunCondition" with option value: "sendEmailCompletion" | ||
And Enter input plugin property: "emailSender" with value: "sendEmailInvalidSender" | ||
And Enter send email plugin property email recipient with value: "sendEmailRecipients" | ||
And Enter input plugin property: "emailSubject" with value: "sendEmailSubject" | ||
And Enter textarea plugin property: "emailMessage" with value: "sendEmailMessage" | ||
And Click on the Validate button | ||
And Verify that the Plugin Property: "sender" is displaying an in-line error message: "errorMessageInvalidSenderField" | ||
|
||
@SEND_EMAIL @PLUGIN-1253 | ||
Scenario: Verify proper format for recipient field in send email plugin | ||
Given Open Datafusion Project to configure pipeline | ||
And Click plugin property: "configureTab" | ||
And Click plugin property: "pipelineAlertTab" | ||
And Click plugin property: "createAlertButton" | ||
And Select send email alert plugin | ||
And Select dropdown plugin property: "emailRunCondition" with option value: "sendEmailCompletion" | ||
And Enter input plugin property: "emailSender" with value: "sendEmailSender" | ||
And Enter send email plugin property email recipient with value: "sendEmailInvalidRecipients" | ||
And Enter input plugin property: "emailSubject" with value: "sendEmailSubject" | ||
And Enter textarea plugin property: "emailMessage" with value: "sendEmailMessage" | ||
And Click on the Validate button | ||
And Verify that the Plugin Property: "sender" is displaying an in-line error message: "errorMessageInvalidRecipientField" |
67 changes: 67 additions & 0 deletions
67
e2e-test/src/test/features/sendemail/source/MacrosSendEmailAlert.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,67 @@ | ||
@Send_Email | ||
Feature: Send Email Alert - Verify macro scenarios | ||
|
||
@SEND_EMAIL @FILE_SOURCE_TEST @BQ_SINK_TEST | ||
Scenario: Verify send email functionality with macro arguments using File to BigQuery pipeline | ||
Given Open Datafusion Project to configure pipeline | ||
And Select plugin: "File" from the plugins list as: "Source" | ||
And Expand Plugin group in the LHS plugins list: "Sink" | ||
And Select plugin: "BigQuery" from the plugins list as: "Sink" | ||
And Connect plugins: "File" and "BigQuery" to establish connection | ||
And Navigate to the properties page of plugin: "File" | ||
And Enter input plugin property: "referenceName" with value: "FileReferenceName" | ||
And Enter input plugin property: "path" with value: "csvAllDataTypeFile" | ||
And Select dropdown plugin property: "format" with option value: "csv" | ||
And Click plugin property: "skipHeader" | ||
And Click on the Get Schema button | ||
And Verify the Output Schema matches the Expected Schema: "csvAllDataTypeFileSchema" | ||
And Validate "File" plugin properties | ||
And Close the Plugin Properties page | ||
And Navigate to the properties page of plugin: "BigQuery" | ||
And Replace input plugin property: "projectId" with value: "projectId" | ||
And Enter input plugin property: "datasetProjectId" with value: "projectId" | ||
And Enter input plugin property: "referenceName" with value: "BQReferenceName" | ||
And Enter input plugin property: "dataset" with value: "dataset" | ||
And Enter input plugin property: "table" with value: "bqTargetTable" | ||
And Click plugin property: "truncateTable" | ||
And Click plugin property: "updateTableSchema" | ||
And Validate "BigQuery" plugin properties | ||
And Close the Plugin Properties page | ||
And Click plugin property: "configureTab" | ||
And Click plugin property: "pipelineAlertTab" | ||
And Click plugin property: "createAlertButton" | ||
And Select send email alert plugin | ||
And Select dropdown plugin property: "emailRunCondition" with option value: "sendEmailCompletion" | ||
And Click on the Macro button of Property: "emailSender" and set the value to: "sender" | ||
And Click on the Macro button of Property: "emailRecipient" and set the value to: "recipients" | ||
And Click on the Macro button of Property: "emailSubject" and set the value to: "subject" | ||
And Click on the Macro button of Property: "emailMessage" and set the value in textarea: "message" | ||
And Click on the Macro button of Property: "emailUsername" and set the value to: "username" | ||
And Click on the Macro button of Property: "emailPassword" and set the value to: "password" | ||
And Click on the Macro button of Property: "emailProtocol" and set the value to: "protocol" | ||
And Click on the Macro button of Property: "emailHost" and set the value to: "host" | ||
And Click on the Macro button of Property: "emailPort" and set the value to: "port" | ||
And Click on the Macro button of Property: "emailIncludeWorkflowToken" and set the value to: "token" | ||
And Validate send email plugin properties | ||
And Click plugin property: "emailNextButton" | ||
And Click plugin property: "emailConfirmButton" | ||
And Click Pipeline Alert Save Button | ||
And Save and Deploy Pipeline | ||
And Run the Pipeline in Runtime | ||
And Enter runtime argument value "sendEmailSender" for key "sender" | ||
And Enter runtime argument value "sendEmailRecipients" for key "recipients" | ||
And Enter runtime argument value "emailSubject" for key "subject" | ||
And Enter runtime argument value "sendEmailMessage" for key "message" | ||
And Enter runtime argument value "sendEmailUsername" for key "username" | ||
And Enter runtime argument value "sendEmailPassword" for key "password" | ||
And Enter runtime argument value "sendEmailProtocol" for key "protocol" | ||
And Enter runtime argument value "sendEmailHost" for key "host" | ||
And Enter runtime argument value "sendEmailPort" for key "port" | ||
And Enter runtime argument value "sendEmailIncludeWorkflowToken" for key "token" | ||
And Run the Pipeline in Runtime with runtime arguments | ||
And Wait till pipeline is in running state | ||
And Open and capture logs | ||
And Verify the pipeline status is "Succeeded" | ||
#And Verify email sent message in logs (Implement this step once PLUGIN-1255 is fixed.) | ||
Then Close the pipeline logs | ||
Then Validate OUT record count is equal to IN record count |
111 changes: 111 additions & 0 deletions
111
e2e-test/src/test/features/sendemail/source/RunTimeScenariosSendEmailAlert.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,111 @@ | ||
@Send_Email | ||
Feature: Send Email Alert - Run time scenarios | ||
|
||
@SEND_EMAIL @BQ_SINK_TEST @FILE_SOURCE_TEST | ||
Scenario Outline: Verify send email alert functionality using File to BigQuery pipeline for different run conditions | ||
Given Open Datafusion Project to configure pipeline | ||
And Select plugin: "File" from the plugins list as: "Source" | ||
And Expand Plugin group in the LHS plugins list: "Sink" | ||
And Select plugin: "BigQuery" from the plugins list as: "Sink" | ||
And Connect plugins: "File" and "BigQuery" to establish connection | ||
And Navigate to the properties page of plugin: "File" | ||
And Enter input plugin property: "referenceName" with value: "FileReferenceName" | ||
And Enter input plugin property: "path" with value: "<filepath>" | ||
And Select dropdown plugin property: "format" with option value: "csv" | ||
And Click plugin property: "skipHeader" | ||
And Click on the Get Schema button | ||
And Validate "File" plugin properties | ||
And Close the Plugin Properties page | ||
And Navigate to the properties page of plugin: "BigQuery" | ||
And Replace input plugin property: "projectId" with value: "projectId" | ||
And Enter input plugin property: "datasetProjectId" with value: "projectId" | ||
And Enter input plugin property: "referenceName" with value: "BQReferenceName" | ||
And Enter input plugin property: "dataset" with value: "dataset" | ||
And Enter input plugin property: "table" with value: "bqTargetTable" | ||
And Click plugin property: "truncateTable" | ||
And Click plugin property: "updateTableSchema" | ||
And Validate "BigQuery" plugin properties | ||
And Close the Plugin Properties page | ||
And Click plugin property: "configureTab" | ||
And Click plugin property: "pipelineAlertTab" | ||
And Click plugin property: "createAlertButton" | ||
And Select send email alert plugin | ||
And Select dropdown plugin property: "emailRunCondition" with option value: "<RunCondition>" | ||
And Enter input plugin property: "emailSender" with value: "sendEmailSender" | ||
And Enter send email plugin property email recipient with value: "sendEmailRecipients" | ||
And Enter input plugin property: "emailSubject" with value: "sendEmailSubject" | ||
And Enter textarea plugin property: "emailMessage" with value: "sendEmailMessage" | ||
And Enter input plugin property: "emailUsername" with value: "sendEmailUsername" | ||
And Enter input plugin property: "emailPassword" with value: "sendEmailPassword" | ||
And Enter input plugin property: "emailProtocol" with value: "sendEmailProtocol" | ||
And Enter input plugin property: "emailHost" with value: "sendEmailHost" | ||
And Enter input plugin property: "emailPort" with value: "sendEmailPort" | ||
And Validate send email plugin properties | ||
And Click plugin property: "emailNextButton" | ||
And Click plugin property: "emailConfirmButton" | ||
And Click Pipeline Alert Save Button | ||
And Save and Deploy Pipeline | ||
And Run the Pipeline in Runtime | ||
And Wait till pipeline is in running state | ||
And Open and capture logs | ||
And Verify the pipeline status is "<status>" | ||
#And Verify email sent message in logs (Implement this step once PLUGIN-1255 is fixed.) | ||
Examples: | ||
| RunCondition | filepath | status | | ||
| sendEmailCompletion | csvAllDataTypeFile | Succeeded | | ||
| sendEmailSuccess | csvAllDataTypeFile | Succeeded | | ||
| sendEmailFailure | sendEmailCsvInvalidFormatFile | Failed | | ||
| sendEmailCompletion | sendEmailCsvInvalidFormatFile | Failed | | ||
|
||
@SEND_EMAIL @BQ_SINK_TEST @FILE_SOURCE_TEST | ||
Scenario: Verify email sent failure text message in logs when the pipeline is successful | ||
Given Open Datafusion Project to configure pipeline | ||
And Select plugin: "File" from the plugins list as: "Source" | ||
And Expand Plugin group in the LHS plugins list: "Sink" | ||
And Select plugin: "BigQuery" from the plugins list as: "Sink" | ||
And Connect plugins: "File" and "BigQuery" to establish connection | ||
And Navigate to the properties page of plugin: "File" | ||
And Enter input plugin property: "referenceName" with value: "FileReferenceName" | ||
And Enter input plugin property: "path" with value: "csvAllDataTypeFile" | ||
And Select dropdown plugin property: "format" with option value: "csv" | ||
And Click plugin property: "skipHeader" | ||
And Click on the Get Schema button | ||
And Validate "File" plugin properties | ||
And Close the Plugin Properties page | ||
And Navigate to the properties page of plugin: "BigQuery" | ||
And Replace input plugin property: "projectId" with value: "projectId" | ||
And Enter input plugin property: "datasetProjectId" with value: "projectId" | ||
And Enter input plugin property: "referenceName" with value: "BQReferenceName" | ||
And Enter input plugin property: "dataset" with value: "dataset" | ||
And Enter input plugin property: "table" with value: "bqTargetTable" | ||
And Click plugin property: "truncateTable" | ||
And Click plugin property: "updateTableSchema" | ||
And Validate "BigQuery" plugin properties | ||
And Close the Plugin Properties page | ||
And Click plugin property: "configureTab" | ||
And Click plugin property: "pipelineAlertTab" | ||
And Click plugin property: "createAlertButton" | ||
And Select send email alert plugin | ||
And Select dropdown plugin property: "emailRunCondition" with option value: "sendEmailCompletion" | ||
And Enter input plugin property: "emailSender" with value: "sendEmailSender" | ||
And Enter send email plugin property email recipient with value: "sendEmailRecipients" | ||
And Enter input plugin property: "emailSubject" with value: "sendEmailSubject" | ||
And Enter textarea plugin property: "emailMessage" with value: "sendEmailMessage" | ||
And Enter input plugin property: "emailUsername" with value: "sendEmailUsername" | ||
And Enter input plugin property: "emailPassword" with value: "sendInvalidEmailPassword" | ||
And Enter input plugin property: "emailProtocol" with value: "sendEmailProtocol" | ||
And Enter input plugin property: "emailHost" with value: "sendEmailHost" | ||
And Enter input plugin property: "emailPort" with value: "sendEmailPort" | ||
And Validate send email plugin properties | ||
And Click plugin property: "emailNextButton" | ||
And Click plugin property: "emailConfirmButton" | ||
And Click Pipeline Alert Save Button | ||
And Save and Deploy Pipeline | ||
And Run the Pipeline in Runtime | ||
And Wait till pipeline is in running state | ||
And Open and capture logs | ||
And Verify the pipeline status is "Succeeded" | ||
And Close the pipeline logs | ||
And Open Pipeline logs and verify Log entries having below listed Level and Message: | ||
| Level | Message | | ||
| ERROR | errorMessageSentEmailFailure | |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it's expected that we would log a message when email is sent successfully.
A RuntimeException is thrown in the failure case - does this show up in the pipeline logs when there is an error in sending email? https://github.com/cdapio/hydrator-plugins/blob/develop/core-plugins/src/main/java/io/cdap/plugin/batch/action/EmailAction.java#L154