|
| 1 | +# Copyright © 2024 Cask Data, Inc. |
| 2 | +# |
| 3 | +# Licensed under the Apache License, Version 2.0 (the "License"); you may not |
| 4 | +# use this file except in compliance with the License. You may obtain a copy of |
| 5 | +# the License at |
| 6 | +# |
| 7 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +# |
| 9 | +# Unless required by applicable law or agreed to in writing, software |
| 10 | +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 11 | +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| 12 | +# License for the specific language governing permissions and limitations under |
| 13 | +# the License. |
| 14 | + |
| 15 | +@Wrangler |
| 16 | +Feature: Runtime Scenarios for datatype parsers |
| 17 | + |
| 18 | + @BQ_SOURCE_TS_TEST @BQ_SOURCE_TEST @BQ_SINK_TEST |
| 19 | + Scenario: To verify User is able to run a pipeline using parse timestamp directive |
| 20 | + Given Open Wrangler connections page |
| 21 | + Then Click plugin property: "addConnection" button |
| 22 | + Then Click plugin property: "bqConnectionRow" |
| 23 | + Then Enter input plugin property: "name" with value: "bqConnectionName" |
| 24 | + Then Replace input plugin property: "projectId" with value: "projectId" |
| 25 | + Then Enter input plugin property: "datasetProjectId" with value: "projectId" |
| 26 | + Then Override Service account details in Wrangler connection page if set in environment variables |
| 27 | + Then Click plugin property: "testConnection" button |
| 28 | + Then Verify the test connection is successful |
| 29 | + Then Click plugin property: "connectionCreate" button |
| 30 | + Then Verify the connection with name: "bqConnectionName" is created successfully |
| 31 | + Then Select connection data row with name: "dataset" |
| 32 | + Then Select connection data row with name: "bqSourceTable" |
| 33 | + Then Verify connection datatable is displayed for the data: "bqSourceTable" |
| 34 | + Then Expand dropdown column: "update_date" and apply directive: "Parse" as "SIMPLEDATE" with: "yyyy-MM-dd" option |
| 35 | + Then Expand dropdown column: "create_date" and apply directive: "Parse" as "SIMPLEDATE" with: "yyyy-MM-dd" option |
| 36 | + Then Enter directive from CLI "parse-timestamp :time" |
| 37 | + Then Enter directive from CLI "parse-as-currency :price :newprice" |
| 38 | + Then Enter directive from CLI "format-as-currency :newprice :format_price" |
| 39 | + Then Enter directive from CLI "diff-date :create_date :update_date :diff_date" |
| 40 | + Then Enter directive from CLI "timestamp-to-datetime :update_date" |
| 41 | + Then Enter directive from CLI "rename :newprice :id" |
| 42 | + Then Click Create Pipeline button and choose the type of pipeline as: "Batch pipeline" |
| 43 | + Then Verify plugin: "BigQueryTable" node is displayed on the canvas with a timeout of 120 seconds |
| 44 | + Then Expand Plugin group in the LHS plugins list: "Sink" |
| 45 | + Then Select plugin: "BigQuery" from the plugins list as: "Sink" |
| 46 | + Then Navigate to the properties page of plugin: "BigQuery2" |
| 47 | + Then Click plugin property: "useConnection" |
| 48 | + Then Click on the Browse Connections button |
| 49 | + Then Select connection: "bqConnectionName" |
| 50 | + Then Enter input plugin property: "referenceName" with value: "BQSinkReferenceName" |
| 51 | + Then Enter input plugin property: "dataset" with value: "dataset" |
| 52 | + Then Enter input plugin property: "table" with value: "bqTargetTable" |
| 53 | + Then Validate "BigQuery" plugin properties |
| 54 | + Then Close the Plugin Properties page |
| 55 | + Then Connect plugins: "Wrangler" and "BigQuery2" to establish connection |
| 56 | + Then Save the pipeline |
| 57 | + Then Deploy the pipeline |
| 58 | + Then Run the Pipeline in Runtime |
| 59 | + Then Wait till pipeline is in running state |
| 60 | + Then Open and capture logs |
| 61 | + Then Verify the pipeline status is "Succeeded" |
| 62 | + Then Close the pipeline logs |
| 63 | + Then Validate The Data From BQ To BQ With Actual And Expected File for: "ExpectedDirective_parse_Timestamp" |
| 64 | + Given Open Wrangler connections page |
| 65 | + Then Expand connections of type: "BigQuery" |
| 66 | + Then Open action menu for connection: "bqConnectionName" of type: "BigQuery" |
| 67 | + Then Select action: "Delete" for connection: "bqConnectionName" of type: "BigQuery" |
| 68 | + Then Click plugin property: "Delete" button |
| 69 | + Then Verify connection: "bqConnectionName" of type: "BigQuery" is deleted successfully |
| 70 | + |
| 71 | + |
| 72 | + @BQ_SOURCE_DATETIME_TEST @BQ_SOURCE_TEST @BQ_SINK_TEST |
| 73 | + Scenario: To verify User is able to run a pipeline using parse datetime directive |
| 74 | + Given Open Wrangler connections page |
| 75 | + Then Click plugin property: "addConnection" button |
| 76 | + Then Click plugin property: "bqConnectionRow" |
| 77 | + Then Enter input plugin property: "name" with value: "bqConnectionName" |
| 78 | + Then Replace input plugin property: "projectId" with value: "projectId" |
| 79 | + Then Enter input plugin property: "datasetProjectId" with value: "projectId" |
| 80 | + Then Override Service account details in Wrangler connection page if set in environment variables |
| 81 | + Then Click plugin property: "testConnection" button |
| 82 | + Then Verify the test connection is successful |
| 83 | + Then Click plugin property: "connectionCreate" button |
| 84 | + Then Verify the connection with name: "bqConnectionName" is created successfully |
| 85 | + Then Select connection data row with name: "dataset" |
| 86 | + Then Select connection data row with name: "bqSourceTable" |
| 87 | + Then Verify connection datatable is displayed for the data: "bqSourceTable" |
| 88 | + Then Expand dropdown column: "timestamp" and apply directive: "Parse" with directive type: "DATETIME" and select: "Custom_Format" and enter: "yyyy-MM-dd'T'HH:mm:ssX'['z']'" |
| 89 | + Then Enter directive from CLI "current-datetime :create_date" |
| 90 | + Then Enter directive from CLI "datetime-to-timestamp :timestamp" |
| 91 | + Then Enter directive from CLI "format-datetime :create_date 'y'" |
| 92 | + Then Enter directive from CLI "format-date :timestamp yyyy-mm-dd" |
| 93 | + Then Enter directive from CLI "rename timestamp timecolumn" |
| 94 | + Then Click Create Pipeline button and choose the type of pipeline as: "Batch pipeline" |
| 95 | + Then Verify plugin: "BigQueryTable" node is displayed on the canvas with a timeout of 120 seconds |
| 96 | + Then Expand Plugin group in the LHS plugins list: "Sink" |
| 97 | + Then Select plugin: "BigQuery" from the plugins list as: "Sink" |
| 98 | + Then Navigate to the properties page of plugin: "BigQuery2" |
| 99 | + Then Click plugin property: "useConnection" |
| 100 | + Then Click on the Browse Connections button |
| 101 | + Then Select connection: "bqConnectionName" |
| 102 | + Then Enter input plugin property: "referenceName" with value: "BQSinkReferenceName" |
| 103 | + Then Enter input plugin property: "dataset" with value: "dataset" |
| 104 | + Then Enter input plugin property: "table" with value: "bqTargetTable" |
| 105 | + Then Validate "BigQuery" plugin properties |
| 106 | + Then Close the Plugin Properties page |
| 107 | + Then Connect plugins: "Wrangler" and "BigQuery2" to establish connection |
| 108 | + Then Save the pipeline |
| 109 | + Then Deploy the pipeline |
| 110 | + Then Run the Pipeline in Runtime |
| 111 | + Then Wait till pipeline is in running state |
| 112 | + Then Open and capture logs |
| 113 | + Then Verify the pipeline status is "Succeeded" |
| 114 | + Then Close the pipeline logs |
| 115 | + Then Validate The Data From BQ To BQ With Actual And Expected File for: "ExpectedDirective_parse_DatetimeNew" |
| 116 | + Given Open Wrangler connections page |
| 117 | + Then Expand connections of type: "BigQuery" |
| 118 | + Then Open action menu for connection: "bqConnectionName" of type: "BigQuery" |
| 119 | + Then Select action: "Delete" for connection: "bqConnectionName" of type: "BigQuery" |
| 120 | + Then Click plugin property: "Delete" button |
| 121 | + Then Verify connection: "bqConnectionName" of type: "BigQuery" is deleted successfully |
0 commit comments