Skip to content

Latest commit

 

History

History
130 lines (86 loc) · 4.37 KB

data-query-test.md

File metadata and controls

130 lines (86 loc) · 4.37 KB

Tests: Data query

Data query defines which data should be extracted from the data source. For databases, that would typically be the SQL query; for Excel file, that would be sheet name, etc. The system allows you to create parameterized and non-parameterized queries.

Testing scenarios

  1. Create a new non-parameterized query with name = "Test" (example query: select * from Products)

  2. Open "Data Queries" from "Admin" menu

  • "Data Queries" is open.
  • You can change the view, use sort and search.
  1. Use search in "Data Queries" to find the "Test" query
  • Query "Test" will find.
  1. Call context menu for data query. Test the functionality of the context menu items.
  • Context menu is open.
  • All its elements work correctly
  1. Open "Query view" for "Test" query, edit it and run without saving
  • Query completed.
  1. Enter an incorrect query and run it
  • Warning about errors in the query is shown
  1. Open "Data Query Runs" from "Admin" menu
  • "Data Queries Runs" is open
  • You can change the view, use sort and search
  • The list shows the status of run and start time
  1. Run query from different places (context menu, Context Panel, by double-clicking)

  2. Find in the list queries from the previous paragraphs

  • Queries are present in the list
  • The runtime is correct
  • Queries with errors are marked with color coding
  1. Open the "Details" tab in Context Panel
  • "Details" tab is open
  • The correct information for all fields is displayed (Author, Created, Updated, Connection, Tags, Params – for parameterized queries)
  1. Open the "Query" tab in Context Panel
  • "Query" tab is open
  • Display current text of query
  1. Open the "Activity" tab in Context Panel
  • "Activity" tab is open
  • Display information about tables that were created after the query was executed.
  1. Run the "Test" query
  • Look on "Activity" tab
  • New record about actually query is added here
  1. Open the "Usage" tab in Context Panel
  • "Usage" tab is open. Display query runs statistics.
  1. Delete "Test" query
  • "Test" query deleted successfully
  • No any errors and exceptions
  1. Create a new parameterized query with name = "Test_param"
  • New parameterized query created
  • Check this in "Data Queries" in menu "Admin"
  1. Open the "Run" tab in Context Panel for " Test_param" query
  • "Run" tab is open, there are fields for entering parameters
  1. Run parameterized query with correct parameters
  • Parameterized query is run
  • Check this in "Data Query Runs" in menu "Admin"
  1. Run parameterized query with not-correct parameters (nulls, incorrect types of input data, incomplete data for strings, negative values for numbers, error datetime, etc.
  • Warning about incorrect input parameters is shown to user.

The scenarios listed in clauses 2-17 must also be performed for parameterized queries

example parameterized query:

--input: int employeeId = 5
--input: string shipVia = = 3 {pattern: int}
--input: double freight = 10.0
--input: string shipCountry = "France" {choices: ["France", "Germany", "USA", "Finland"]}
--input: string shipCity = "starts with r" {pattern: string}
--input: bool freightLess1000 = true
--input: datetime requiredDate = "1/1/1995"
--input: string orderDate = "after 1/1/1995" {pattern: datetime}
SELECT * FROM Orders WHERE (employeeId = @employeeId)
   AND (freight >= @freight)
   AND @shipVia(shipVia)
   AND ((freight < 1000) OR NOT @freightLess1000)
   AND (shipCountry = @shipCountry)
   AND @shipCity(shipCity)
   AND @orderDate(orderDate)
   AND (requiredDate >= @requiredDate)*

See also: