Skip to content
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
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"
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.)
Copy link
Contributor

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

Then Close the pipeline logs
Then Validate OUT record count is equal to IN record count
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 |
Loading