test: Cypress - Automated basic tests for MsSQL DS (#21446)
## Description - This PR includes basic tests for connecting to a MsSQL ds & running simple queries on it ## Type of change - New script (non-breaking change which functional tests the MsSql ds) ## How Has This Been Tested? - Cypress local & CI run ## Checklist: ### QA activity: - [X] Added Test Plan Approved label after reviewing all Cypress test
This commit is contained in:
parent
fd565e7f2f
commit
04b794fddd
|
|
@ -162,7 +162,7 @@ jobs:
|
|||
with:
|
||||
issue-number: ${{ github.event.client_payload.pull_request.number }}
|
||||
body: |
|
||||
<details><summary>The following are new failures, please fix them before merging the PR</summary> ${{ env.new_failed_spec_env }}</details>
|
||||
The following are new failures, please fix them before merging the PR: \n ${{ env.new_failed_spec_env }}
|
||||
|
||||
# Update check run called "ci-test-result"
|
||||
- name: Mark ci-test-result job as complete
|
||||
|
|
|
|||
|
|
@ -17,11 +17,11 @@
|
|||
"mysql-username": "root",
|
||||
"mysql-password": "root",
|
||||
|
||||
"mssql-host": "localhost",
|
||||
"mssql-host": "host.docker.internal",
|
||||
"mssql-port": 1433,
|
||||
"mssql-databaseName": "fakeapi",
|
||||
"mssql-username": "SA",
|
||||
"mssql-password": "Root$123",
|
||||
"mssql-password": "Root@123",
|
||||
|
||||
"arango-host": "localhost",
|
||||
"arango-port": 8529,
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
Create database fakeapi;
|
||||
USE fakeapi;
|
||||
|
||||
CREATE TABLE amazon_sales(
|
||||
uniq_id VARCHAR(32) NOT NULL PRIMARY KEY
|
||||
|
|
|
|||
|
|
@ -1,21 +1,18 @@
|
|||
import { ObjectsRegistry } from "../../../../support/Objects/Registry";
|
||||
import * as _ from "../../../../support/Objects/ObjectsCore";
|
||||
|
||||
let dsName: any;
|
||||
|
||||
const agHelper = ObjectsRegistry.AggregateHelper,
|
||||
dataSources = ObjectsRegistry.DataSources;
|
||||
|
||||
describe("Bug 19933: Authenticated API DS in case of OAuth2, should have save and authorise button enabled all the times", function () {
|
||||
it("1. Create Auth API DS, save i, now edit again and check the save and authorise button state", function () {
|
||||
dataSources.NavigateToDSCreateNew();
|
||||
agHelper.GenerateUUID();
|
||||
_.dataSources.NavigateToDSCreateNew();
|
||||
_.agHelper.GenerateUUID();
|
||||
cy.get("@guid").then((uid) => {
|
||||
dsName = "AuthAPI " + uid;
|
||||
dataSources.CreatePlugIn("Authenticated API");
|
||||
agHelper.RenameWithInPane(dsName, false);
|
||||
dataSources.FillAuthAPIUrl();
|
||||
dataSources.AssertCursorPositionForTextInput(
|
||||
dataSources._urlInputControl,
|
||||
_.dataSources.CreatePlugIn("Authenticated API");
|
||||
_.agHelper.RenameWithInPane(dsName, false);
|
||||
_.dataSources.FillAuthAPIUrl();
|
||||
_.dataSources.AssertCursorPositionForTextInput(
|
||||
_.dataSources._urlInputControl,
|
||||
"{moveToStart}",
|
||||
"he",
|
||||
2,
|
||||
|
|
|
|||
|
|
@ -170,9 +170,9 @@ describe("MaintainContext&Focus", function () {
|
|||
dataSources.ExpandSection(0);
|
||||
agHelper.GoBack();
|
||||
ee.SelectEntityByName("Github", "Datasources");
|
||||
dataSources.AssertViewMode();
|
||||
dataSources.AssertDSEditViewMode("View");
|
||||
ee.SelectEntityByName("Appsmith", "Datasources");
|
||||
dataSources.AssertEditMode();
|
||||
dataSources.AssertDSEditViewMode("Edit");
|
||||
dataSources.AssertSectionCollapseState(0, false);
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -41,10 +41,11 @@ describe("Validate JS Object Refactoring does not affect the comments & variable
|
|||
//Initialize new JSObject with custom code
|
||||
_.jsEditor.CreateJSObject(jsCode);
|
||||
//Initialize new Query entity with custom query
|
||||
_.entityExplorer.CreateNewDsQuery(dsName);
|
||||
_.agHelper.RenameWithInPane(refactorInput.query.oldName);
|
||||
_.agHelper.GetNClick(_.dataSources._templateMenu);
|
||||
_.dataSources.EnterQuery(query);
|
||||
_.dataSources.CreateQueryFromOverlay(
|
||||
dsName,
|
||||
query,
|
||||
refactorInput.query.oldName,
|
||||
); //Creating query from EE overlay
|
||||
//Initialize new API entity with custom header
|
||||
_.apiPage.CreateAndFillApi(
|
||||
datasourceFormData["mockApiUrl"],
|
||||
|
|
|
|||
|
|
@ -16,16 +16,11 @@ describe("Checkbox Group Widget Functionality", function () {
|
|||
let query2 = `SELECT * FROM public."country" LIMIT 2;`;
|
||||
|
||||
// add Query 1 with limit 10
|
||||
|
||||
_.entityExplorer.CreateNewDsQuery(dsName);
|
||||
_.agHelper.GetNClick(_.dataSources._templateMenu);
|
||||
_.dataSources.EnterQuery(query1); //Query1
|
||||
_.dataSources.CreateQueryFromOverlay(dsName, query1); //Query1
|
||||
_.dataSources.RunQuery();
|
||||
|
||||
// add Query 2 with limit 2
|
||||
_.entityExplorer.CreateNewDsQuery(dsName);
|
||||
_.agHelper.GetNClick(_.dataSources._templateMenu);
|
||||
_.dataSources.EnterQuery(query2);
|
||||
_.dataSources.CreateQueryFromOverlay(dsName, query2); //Query2
|
||||
_.dataSources.RunQuery();
|
||||
|
||||
// add checkbox group widget
|
||||
|
|
|
|||
|
|
@ -0,0 +1,130 @@
|
|||
import * as _ from "../../../../support/Objects/ObjectsCore";
|
||||
import { Widgets } from "../../../../support/Pages/DataSources";
|
||||
|
||||
let dsName: any, query: string;
|
||||
|
||||
describe("Validate MsSQL connection & basic querying with UI flows", () => {
|
||||
before("Create a new MySQL DS", () => {
|
||||
_.dataSources.CreateDataSource("MsSql");
|
||||
cy.get("@dsName").then(($dsName) => {
|
||||
dsName = $dsName;
|
||||
_.dataSources.CreateQueryAfterDSSaved(
|
||||
"Create database fakeapi;",
|
||||
"MsSQL_queries",
|
||||
);
|
||||
_.dataSources.RunQuery();
|
||||
|
||||
query = "USE fakeapi;";
|
||||
_.dataSources.EnterQuery(query);
|
||||
_.dataSources.RunQuery();
|
||||
|
||||
query = `CREATE TABLE amazon_sales(
|
||||
uniq_id VARCHAR(32) NOT NULL PRIMARY KEY
|
||||
,product_name VARCHAR(536) NOT NULL
|
||||
,manufacturer VARCHAR(48)
|
||||
,price VARCHAR(19)
|
||||
,number_available_in_stock VARCHAR(13)
|
||||
,number_of_reviews VARCHAR(5)
|
||||
,number_of_answered_questions INTEGER
|
||||
,average_review_rating VARCHAR(18)
|
||||
,amazon_category_and_sub_category VARCHAR(120)
|
||||
,customers_who_bought_this_item_also_bought VARCHAR(932)
|
||||
);
|
||||
INSERT INTO amazon_sales(uniq_id,product_name,manufacturer,price,number_available_in_stock,number_of_reviews,number_of_answered_questions,average_review_rating,amazon_category_and_sub_category,customers_who_bought_this_item_also_bought) VALUES ('eac7efa5dbd3d667f26eb3d3ab504464','Hornby 2014 Catalogue','Hornby','£3.42','5 new','15',1,'4.9 out of 5 stars','Hobbies > Model Trains & Railway Sets > Rail Vehicles > Trains','http://www.amazon.co.uk/Hornby-R8150-Catalogue-2015/dp/B00S9SUUBE | http://www.amazon.co.uk/Hornby-Book-Model-Railways-Edition/dp/1844860957 | http://www.amazon.co.uk/Hornby-Book-Scenic-Railway-Modelling/dp/1844861120 | http://www.amazon.co.uk/Peco-60-Plans-Book/dp/B002QVL16I | http://www.amazon.co.uk/Hornby-Gloucester | http://www.amazon.co.uk/Airfix-5014429781902');
|
||||
INSERT INTO amazon_sales(uniq_id,product_name,manufacturer,price,number_available_in_stock,number_of_reviews,number_of_answered_questions,average_review_rating,amazon_category_and_sub_category,customers_who_bought_this_item_also_bought) VALUES ('b17540ef7e86e461d37f3ae58b7b72ac','FunkyBuys® Large Christmas Holiday Express Festive Train Set (SI-TY1017) Toy Light / Sounds / Battery Operated & Smoke','FunkyBuys','£16.99',NULL,'2',1,'4.5 out of 5 stars','Hobbies > Model Trains & Railway Sets > Rail Vehicles > Trains','http://www.amazon.co.uk/Christmas-Holiday-Express-Festive-Train-Set-Toy/dp/B009R8S8AA | http://www.amazon.co.uk/Goldlok-Holiday-Express-Operated-Multi-Colour/dp/B009R8PAO2 | http://www.amazon.co.uk/FunkyBuys%C2%AE-Christmas-SI-TY1017-Ornaments-Operated/dp/B01437QMHA | http://www.amazon.co.uk/Holiday-Express-Christmas-Ornament-Decoration | http://www.amazon.co.uk/Seasonal-Vision-Christmas-Tree-Train/dp/B0044ZC1W2 | http://www.amazon.co.uk/Coca-Cola-Santa-Express-Train-Set/dp/B004BYSNU0');
|
||||
INSERT INTO amazon_sales(uniq_id,product_name,manufacturer,price,number_available_in_stock,number_of_reviews,number_of_answered_questions,average_review_rating,amazon_category_and_sub_category,customers_who_bought_this_item_also_bought) VALUES ('348f344247b0c1a935b1223072ef9d8a','CLASSIC TOY TRAIN SET TRACK CARRIAGES LIGHT ENGINE BOXED BOYS KIDS BATTERY','ccf','£9.99','2 new','17',2,'3.9 out of 5 stars','Hobbies > Model Trains & Railway Sets > Rail Vehicles > Trains','http://www.amazon.co.uk/Classic-Train-Lights-Battery-Operated/dp/B0041L9OHE | http://www.amazon.co.uk/Train-With-Tracks-Battery-Operated-x/dp/B009P540O8 | http://www.amazon.co.uk/13-Piece-Train-Set-Ideal/dp/B0173N6E4W | http://www.amazon.co.uk/Train-Flash-Electric-Sound-Europe/dp/B008D7CEH4 | http://www.amazon.co.uk/Train-Ultimate-Sticker-Book-Stickers/dp/1405314516 | http://www.amazon.co.uk/Train-Stickers-Dover-Little-Activity/dp/0486403106');
|
||||
INSERT INTO amazon_sales(uniq_id,product_name,manufacturer,price,number_available_in_stock,number_of_reviews,number_of_answered_questions,average_review_rating,amazon_category_and_sub_category,customers_who_bought_this_item_also_bought) VALUES ('e12b92dbb8eaee78b22965d2a9bbbd9f','HORNBY Coach R4410A BR Hawksworth Corridor 3rd','Hornby','£39.99',NULL,'1',2,'5.0 out of 5 stars','Hobbies > Model Trains & Railway Sets > Rail Vehicles > Trains',NULL);
|
||||
INSERT INTO amazon_sales(uniq_id,product_name,manufacturer,price,number_available_in_stock,number_of_reviews,number_of_answered_questions,average_review_rating,amazon_category_and_sub_category,customers_who_bought_this_item_also_bought) VALUES ('e33a9adeed5f36840ccc227db4682a36','Hornby 00 Gauge 0-4-0 Gildenlow Salt Co. Steam Locomotive Model','Hornby','£32.19',NULL,'3',2,'4.7 out of 5 stars','Hobbies > Model Trains & Railway Sets > Rail Vehicles > Trains','http://www.amazon.co.uk/Hornby-R6367-RailRoad-Gauge-Rolling/dp/B000WDWSD2 | http://www.amazon.co.uk/Hornby-R3064-RailRoad-Smokey-Locomotive | http://www.amazon.co.uk/Hornby-R8222-Gauge-Track-Extension/dp/B000RK3FZK | http://www.amazon.co.uk/Hornby-R6371-RailRoad-Petrol-Tanker/dp/B000WDS002 | http://www.amazon.co.uk/Hornby-R076-00-Gauge-Footbridge | http://www.amazon.co.uk/Hornby-R6368-RailRoad-Gauge-Brake/dp/B000WDWT22');
|
||||
INSERT INTO amazon_sales(uniq_id,product_name,manufacturer,price,number_available_in_stock,number_of_reviews,number_of_answered_questions,average_review_rating,amazon_category_and_sub_category,customers_who_bought_this_item_also_bought) VALUES ('cb34f0a84102c1ebc3ef6892d7444d36','20pcs Model Garden Light Double Heads Lamppost Scale 1:100','Generic','£6.99',NULL,'2',1,'5.0 out of 5 stars','Hobbies > Model Trains & Railway Sets > Lighting & Signal Engineering > Lamps & Lighting','http://www.amazon.co.uk/Single-Head-Garden-Lights-Lamppost-Layout/dp/B008XCSHCA | http://www.amazon.co.uk/douself-100Pcs-OO-Scale-Passenger/dp/B00GRUD8W4 | http://www.amazon.co.uk/Hornby-Digital-Electric-Point-Track/dp/B00105UJ14 | http://www.amazon.co.uk/20Pcs-Scenery-Landscape-Train-Flowers/dp/B00C1843MA | http://www.amazon.co.uk/Scenery-Landscape-100-Made-Plastic-Cement/dp/B007UYIJ48');
|
||||
INSERT INTO amazon_sales(uniq_id,product_name,manufacturer,price,number_available_in_stock,number_of_reviews,number_of_answered_questions,average_review_rating,amazon_category_and_sub_category,customers_who_bought_this_item_also_bought) VALUES ('f74b562470571dfb689324adf236f82c','Hornby 00 Gauge 230mm BR Bogie Passenger Brake Coach Model (Red)','Hornby','£24.99',NULL,'2',1,'4.5 out of 5 stars','Hobbies > Model Trains & Railway Sets > Rail Vehicles > Trains','http://www.amazon.co.uk/Hornby-R4388-RailRoad-Composite-Gauge/dp/B00260GEXO | http://www.amazon.co.uk/Hornby-R1138-Passenger-Freight-Electric/dp/B006ZL6976');
|
||||
INSERT INTO amazon_sales(uniq_id,product_name,manufacturer,price,number_available_in_stock,number_of_reviews,number_of_answered_questions,average_review_rating,amazon_category_and_sub_category,customers_who_bought_this_item_also_bought) VALUES ('87bbb472ef9d90dcef140a551665c929','Hornby Santa''s Express Train Set','Hornby','£69.93','3 new','36',7,'4.3 out of 5 stars','Hobbies > Model Trains & Railway Sets > Rail Vehicles > Trains','http://www.amazon.co.uk/Hornby-R8221-Gauge-Track-Extension/dp/B000PVFYZ0 | http://www.amazon.co.uk/Hornby-R8222-Gauge-Track-Extension/dp/B000RK3FZK | http://www.amazon.co.uk/Hornby-R6368-RailRoad-Gauge-Brake/dp/B000WDWT22 | http://www.amazon.co.uk/Hornby-R6370-RailRoad-Tredegar-Gauge/dp/B000WDZH58 | http://www.amazon.co.uk/Hornby-R044-Passing-Contact-Switch/dp/B000H5V0RK | http://www.amazon.co.uk/Hornby-Gauge-Logan-Plank-Wagon/dp/B00SWV6RAG');
|
||||
INSERT INTO amazon_sales(uniq_id,product_name,manufacturer,price,number_available_in_stock,number_of_reviews,number_of_answered_questions,average_review_rating,amazon_category_and_sub_category,customers_who_bought_this_item_also_bought) VALUES ('7e2aa2b4596a39ba852449718413d7cc','Hornby Gauge Western Express Digital Train Set with eLink and TTS Loco Train Set','Hornby','£235.58','4 new','1',1,'5.0 out of 5 stars','Hobbies > Model Trains & Railway Sets > Rail Vehicles > Trains','http://www.amazon.co.uk/Hornby-Western-Master-E-Link-Electric/dp/B00BUKPXS8 | http://www.amazon.co.uk/Hornby-Gloucester | http://www.amazon.co.uk/Hornby-Majestic-E-Link-Gauge-Electric/dp/B00BUKPXU6 | http://www.amazon.co.uk/Hornby-Gauge-Master-Glens/dp/B00TQNJIIW | http://www.amazon.co.uk/Hornby-Gauge-Eurostar-2014-Train/dp/B00TQNJIIC | http://www.amazon.co.uk/HORNBY-Digital-Train-Layout-Track/dp/B006BRH55Y');
|
||||
INSERT INTO amazon_sales(uniq_id,product_name,manufacturer,price,number_available_in_stock,number_of_reviews,number_of_answered_questions,average_review_rating,amazon_category_and_sub_category,customers_who_bought_this_item_also_bought) VALUES ('5afbaf65680c9f378af5b3a3ae22427e','Learning Curve Chuggington Interactive Chatsworth','Chuggington',NULL,'1 new','8',1,'4.8 out of 5 stars','Hobbies > Model Trains & Railway Sets > Rail Vehicles > Trains','http://www.amazon.co.uk/Learning-Curve-Chuggington | http://www.amazon.co.uk/Chuggington | http://www.amazon.co.uk/Learning-Curve-Chuggington | http://www.amazon.co.uk/Learning-Chuggington');`;
|
||||
_.dataSources.EnterQuery(query);
|
||||
_.dataSources.RunQuery();
|
||||
|
||||
query = `CREATE TABLE Simpsons(
|
||||
episode_id VARCHAR(7) NOT NULL PRIMARY KEY
|
||||
,season INTEGER NOT NULL
|
||||
,episode INTEGER NOT NULL
|
||||
,number_in_series INTEGER NOT NULL
|
||||
,title VARCHAR(83) NOT NULL
|
||||
,summary VARCHAR(577) NOT NULL
|
||||
,air_date DATE NOT NULL
|
||||
,episode_image VARCHAR(164) NOT NULL
|
||||
,rating NUMERIC(3,1)
|
||||
,votes INTEGER
|
||||
);
|
||||
INSERT INTO Simpsons(episode_id,season,episode,number_in_series,title,summary,air_date,episode_image,rating,votes) VALUES ('S1-E1',1,1,1,'Simpsons Roasting on an Open Fire','The family is forced to spend all of their savings to get Bart''s new tattoo removed, and with no money for Christmas, Homer is forced to become a store Santa.','1989-12-17','https://m.media-amazon.com/images/M/MV5BZjJjMzMwOTctODk5ZC00NWM4LTgyNjAtNjNmN2I1OTc5OTAyXkEyXkFqcGdeQXVyNTAyODkwOQ@@._V1_UY126_UX224_AL_.jpg',8.1,5499);
|
||||
INSERT INTO Simpsons(episode_id,season,episode,number_in_series,title,summary,air_date,episode_image,rating,votes) VALUES ('S1-E2',1,2,2,'Bart the Genius','Bart ends up at a school for gifted children after cheating on an IQ test.','1990-01-14','https://m.media-amazon.com/images/M/MV5BOTA0MTk3ZjktZGFhMi00ODcxLTlkYzgtZTJiMTQ5Y2I4MzhiXkEyXkFqcGdeQXVyNTAyODkwOQ@@._V1_UY126_UX224_AL_.jpg',7.8,3456);
|
||||
INSERT INTO Simpsons(episode_id,season,episode,number_in_series,title,summary,air_date,episode_image,rating,votes) VALUES ('S1-E3',1,3,3,'Homer''s Odyssey','After losing his job, Homer contemplates ending it all, until he discovers a new life path as a safety advocate.','1990-01-21','https://m.media-amazon.com/images/M/MV5BMzQ3M2M1YjQtNTkzNS00MDlhLWFiY2QtOWJiODZhNGJlZWMxXkEyXkFqcGdeQXVyNTAyODkwOQ@@._V1_UY126_UX224_AL_.jpg',7.4,3034);
|
||||
INSERT INTO Simpsons(episode_id,season,episode,number_in_series,title,summary,air_date,episode_image,rating,votes) VALUES ('S1-E4',1,4,4,'There''s No Disgrace Like Home','After being embarrassed by the rest of the family at a company picnic, Homer becomes obsessed with improving their behavior towards each other.','1990-01-28','https://m.media-amazon.com/images/M/MV5BOTZmNmE1NDUtMmRhOC00ZTYyLTkzMTEtOTM5YTgwMTc5YmMxXkEyXkFqcGdeQXVyNTAyODkwOQ@@._V1_UY126_UX224_AL_.jpg',7.7,2978);
|
||||
INSERT INTO Simpsons(episode_id,season,episode,number_in_series,title,summary,air_date,episode_image,rating,votes) VALUES ('S1-E5',1,5,5,'Bart the General','After being beaten up by Nelson Muntz one too many times, Bart turns to Grampa for help, and soon leads a rebellion against the school bully.','1990-02-04','https://m.media-amazon.com/images/M/MV5BMzk4ZDU2OTMtZjM0NC00ZWIyLWFmNmQtMjcyZGQ1OWE0ZWMyXkEyXkFqcGdeQXVyNTAyODkwOQ@@._V1_UY126_UX224_AL_.jpg',8.0,3023);
|
||||
INSERT INTO Simpsons(episode_id,season,episode,number_in_series,title,summary,air_date,episode_image,rating,votes) VALUES ('S1-E6',1,6,6,'Moaning Lisa','A depressed Lisa''s spirit is lifted when she meets a jazz-man, Bleeding Gums Murphy.','1990-02-11','https://m.media-amazon.com/images/M/MV5BODI3ZmEzMmEtNjE2MS00MjMyLWI0MmEtMTdhMWE4YzUwMzkwXkEyXkFqcGdeQXVyNTAyODkwOQ@@._V1_UY126_UX224_AL_.jpg',7.6,2903);
|
||||
INSERT INTO Simpsons(episode_id,season,episode,number_in_series,title,summary,air_date,episode_image,rating,votes) VALUES ('S1-E7',1,7,7,'The Call of the Simpsons','Homer takes the family camping, but it soon becomes a misadventure when they lose their equipment and Homer is mistaken for Bigfoot.','1990-02-18','https://m.media-amazon.com/images/M/MV5BOTkxMzY3Y2QtMWMyMC00NDllLTkyMTctZTY4MDFjZGExYTc1XkEyXkFqcGdeQXVyNTAyODkwOQ@@._V1_UY126_UX224_AL_.jpg',7.8,2807);
|
||||
INSERT INTO Simpsons(episode_id,season,episode,number_in_series,title,summary,air_date,episode_image,rating,votes) VALUES ('S1-E8',1,8,8,'The Telltale Head','Bart gets more than he bargained for when he saws the head off a statue of the town''s founder.','1990-02-25','https://m.media-amazon.com/images/M/MV5BMzhhNTM3ZDYtYWQ3OS00NDU2LTk4MGEtOGZmMWUwODlmMjQyXkEyXkFqcGdeQXVyNTAyODkwOQ@@._V1_UY126_UX224_AL_.jpg',7.7,2733);
|
||||
INSERT INTO Simpsons(episode_id,season,episode,number_in_series,title,summary,air_date,episode_image,rating,votes) VALUES ('S1-E9',1,9,9,'Life on the Fast Lane','Marge contemplates an affair with a handsome bowling instructor.','1990-03-18','https://m.media-amazon.com/images/M/MV5BNzcxYWExZWYtMzY1MC00YjhlLWFmZmUtOTQ3ODZhZTUwN2EzXkEyXkFqcGdeQXVyNTAyODkwOQ@@._V1_UY126_UX224_AL_.jpg',7.5,2716);
|
||||
INSERT INTO Simpsons(episode_id,season,episode,number_in_series,title,summary,air_date,episode_image,rating,votes) VALUES ('S1-E10',1,10,10,'Homer''s Night Out','After a photograph of Homer canoodling with an exotic dancer is distributed throughout Springfield, he finds himself kicked out of the house by Marge.','1990-03-25','https://m.media-amazon.com/images/M/MV5BMTQ4NzU0MjY1OF5BMl5BanBnXkFtZTgwNTE4NTQ2MjE@._V1_UX224_CR0,0,224,126_AL_.jpg',7.3,2624);`;
|
||||
_.dataSources.EnterQuery(query);
|
||||
_.dataSources.RunQuery();
|
||||
});
|
||||
//_.agHelper.ActionContextMenuWithInPane("Delete"); Since next case can continue in same template
|
||||
});
|
||||
|
||||
it("1. Validate Show all existing tables, Describe table & verify query responses", () => {
|
||||
runQueryNValidate(
|
||||
"SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE='BASE TABLE';",
|
||||
["TABLE_CATALOG", "TABLE_SCHEMA", "TABLE_NAME", "TABLE_TYPE"],
|
||||
);
|
||||
runQueryNValidate("exec sp_columns Amazon_Sales;", [
|
||||
"TABLE_QUALIFIER",
|
||||
"TABLE_OWNER",
|
||||
"TABLE_NAME",
|
||||
"COLUMN_NAME",
|
||||
"DATA_TYPE",
|
||||
"TYPE_NAME",
|
||||
"PRECISION",
|
||||
"LENGTH",
|
||||
"SCALE",
|
||||
"RADIX",
|
||||
"NULLABLE",
|
||||
"REMARKS",
|
||||
"COLUMN_DEF",
|
||||
"SQL_DATA_TYPE",
|
||||
"SQL_DATETIME_SUB",
|
||||
"CHAR_OCTET_LENGTH",
|
||||
"ORDINAL_POSITION",
|
||||
"IS_NULLABLE",
|
||||
"SS_DATA_TYPE",
|
||||
]);
|
||||
_.agHelper.ActionContextMenuWithInPane("Delete");
|
||||
});
|
||||
|
||||
it("2. Run a Select query & Add Suggested widget - Table", () => {
|
||||
query = `Select * from Simpsons;`;
|
||||
_.dataSources.CreateQueryFromOverlay(dsName, query, "selectSimpsons"); //Creating query from EE overlay
|
||||
_.dataSources.RunQueryNVerifyResponseViews(10); //Could be 99 in CI, to check aft init load script is working
|
||||
|
||||
_.dataSources.AddSuggesstedWidget(Widgets.Table);
|
||||
_.agHelper.GetNClick(_.propPane._deleteWidget);
|
||||
|
||||
_.entityExplorer.SelectEntityByName("selectSimpsons", "Queries/JS");
|
||||
_.agHelper.ActionContextMenuWithInPane("Delete");
|
||||
});
|
||||
|
||||
after("Verify Deletion of the datasource", () => {
|
||||
_.entityExplorer.SelectEntityByName(dsName, "Datasources");
|
||||
_.entityExplorer.ActionContextMenuByEntityName(
|
||||
dsName,
|
||||
"Delete",
|
||||
"Are you sure?",
|
||||
);
|
||||
_.agHelper.ValidateNetworkStatus("@deleteDatasource", 200);
|
||||
});
|
||||
|
||||
function runQueryNValidate(query: string, columnHeaders: string[]) {
|
||||
_.dataSources.EnterQuery(query);
|
||||
_.dataSources.RunQuery();
|
||||
_.dataSources.AssertQueryResponseHeaders(columnHeaders);
|
||||
}
|
||||
});
|
||||
|
|
@ -1,151 +0,0 @@
|
|||
import { ObjectsRegistry } from "../../../../support/Objects/Registry";
|
||||
import inputData from "../../../../support/Objects/mySqlData";
|
||||
|
||||
let dsName: any, query: string;
|
||||
const agHelper = ObjectsRegistry.AggregateHelper,
|
||||
ee = ObjectsRegistry.EntityExplorer,
|
||||
dataSources = ObjectsRegistry.DataSources,
|
||||
table = ObjectsRegistry.Table,
|
||||
locator = ObjectsRegistry.CommonLocators,
|
||||
deployMode = ObjectsRegistry.DeployMode,
|
||||
appSettings = ObjectsRegistry.AppSettings;
|
||||
|
||||
describe("MySQL Datatype tests", function () {
|
||||
before(() => {
|
||||
cy.fixture("Datatypes/mySQLdsl").then((val: any) => {
|
||||
agHelper.AddDsl(val);
|
||||
});
|
||||
appSettings.OpenPaneAndChangeTheme("Moon");
|
||||
});
|
||||
|
||||
it("1. Create Mysql DS", function () {
|
||||
dataSources.CreateDataSource("MySql");
|
||||
cy.get("@dsName").then(($dsName) => {
|
||||
dsName = $dsName;
|
||||
});
|
||||
});
|
||||
|
||||
it("2. Creating mysqlDTs table", () => {
|
||||
//IF NOT EXISTS can be used - which creates tabel if it does not exist and donot throw any error if table exists.
|
||||
//But if we add this option then next case could fail inn that case.
|
||||
query = inputData.query.createTable;
|
||||
ee.CreateNewDsQuery(dsName);
|
||||
agHelper.RenameWithInPane("createTable");
|
||||
agHelper.GetNClick(dataSources._templateMenu);
|
||||
dataSources.EnterQuery(query);
|
||||
dataSources.RunQuery();
|
||||
|
||||
ee.ExpandCollapseEntity("Datasources");
|
||||
ee.ActionContextMenuByEntityName(dsName, "Refresh");
|
||||
agHelper.AssertElementVisible(
|
||||
ee._entityNameInExplorer(inputData.tableName),
|
||||
);
|
||||
});
|
||||
|
||||
it("3. Creating SELECT query", () => {
|
||||
ee.ActionTemplateMenuByEntityName(inputData.tableName, "SELECT");
|
||||
agHelper.RenameWithInPane("selectRecords");
|
||||
dataSources.RunQuery();
|
||||
agHelper
|
||||
.GetText(dataSources._noRecordFound)
|
||||
.then(($noRecMsg) => expect($noRecMsg).to.eq("No data records to show"));
|
||||
});
|
||||
|
||||
it("4. Creating all queries", () => {
|
||||
query = inputData.query.insertRecord;
|
||||
ee.ActionTemplateMenuByEntityName(inputData.tableName, "INSERT");
|
||||
agHelper.RenameWithInPane("insertRecord");
|
||||
dataSources.EnterQuery(query);
|
||||
|
||||
query = inputData.query.dropTable;
|
||||
ee.ActionTemplateMenuByEntityName(inputData.tableName, "DELETE");
|
||||
agHelper.RenameWithInPane("dropTable");
|
||||
dataSources.EnterQuery(query);
|
||||
});
|
||||
|
||||
//Insert valid/true values into datasource
|
||||
it("5. Inserting record", () => {
|
||||
ee.SelectEntityByName("Page1");
|
||||
deployMode.DeployApp();
|
||||
table.WaitForTableEmpty(); //asserting table is empty before inserting!
|
||||
agHelper.ClickButton("Run InsertQuery");
|
||||
inputData.input.forEach((valueArr, i) => {
|
||||
agHelper.ClickButton("Run InsertQuery");
|
||||
valueArr.forEach((value, index) => {
|
||||
if (value !== "")
|
||||
agHelper.EnterInputText(inputData.inputFieldName[index], value);
|
||||
});
|
||||
i % 2 && agHelper.ToggleSwitch("Bool_column");
|
||||
agHelper.ClickButton("insertRecord");
|
||||
agHelper.AssertElementVisible(locator._spanButton("Run InsertQuery"));
|
||||
agHelper.Sleep(2000);
|
||||
});
|
||||
});
|
||||
|
||||
//Verify weather expected value is present in each cell
|
||||
//i.e. weather right data is pushed and fetched from datasource.
|
||||
it("6. Validating values in each cell", () => {
|
||||
cy.wait(2000);
|
||||
inputData.result.forEach((res_array, i) => {
|
||||
res_array.forEach((value, j) => {
|
||||
table.ReadTableRowColumnData(j, i, "v1", 0).then(($cellData) => {
|
||||
if (i === inputData.result.length - 1) {
|
||||
const obj = JSON.parse($cellData);
|
||||
expect(JSON.stringify(obj)).to.eq(JSON.stringify(value));
|
||||
} else {
|
||||
expect($cellData).to.eq(value);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
//null will be displayed as empty string in tables
|
||||
//So test null we have to intercept execute request.
|
||||
//And check response payload.
|
||||
it("7. Testing null value", () => {
|
||||
deployMode.NavigateBacktoEditor();
|
||||
ee.ExpandCollapseEntity("Queries/JS");
|
||||
ee.SelectEntityByName("selectRecords");
|
||||
dataSources.RunQuery(false);
|
||||
cy.wait("@postExecute").then((intercept) => {
|
||||
expect(
|
||||
typeof intercept.response?.body.data.body[5].varchar_column,
|
||||
).to.be.equal("object");
|
||||
expect(intercept.response?.body.data.body[5].varchar_column).to.be.equal(
|
||||
null,
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
it("8. Validate drop of mysqlDTs - Table from MySQL datasource", () => {
|
||||
ee.SelectEntityByName("dropTable");
|
||||
dataSources.RunQuery();
|
||||
dataSources.ReadQueryTableResponse(0).then(($cellData) => {
|
||||
expect($cellData).to.eq("0"); //Success response for dropped table!
|
||||
});
|
||||
ee.ExpandCollapseEntity("Queries/JS", false);
|
||||
ee.ExpandCollapseEntity("Datasources");
|
||||
ee.ExpandCollapseEntity(dsName);
|
||||
ee.ActionContextMenuByEntityName(dsName, "Refresh");
|
||||
agHelper.AssertElementAbsence(
|
||||
ee._entityNameInExplorer(inputData.tableName),
|
||||
);
|
||||
ee.ExpandCollapseEntity(dsName, false);
|
||||
ee.ExpandCollapseEntity("Datasources", false);
|
||||
});
|
||||
|
||||
it("9. Verify Deletion of the datasource after all created queries are Deleted", () => {
|
||||
dataSources.DeleteDatasouceFromWinthinDS(dsName, 409); //Since all queries exists
|
||||
ee.ExpandCollapseEntity("Queries/JS");
|
||||
["createTable", "dropTable", "insertRecord", "selectRecords"].forEach(
|
||||
(type) => {
|
||||
ee.ActionContextMenuByEntityName(type, "Delete", "Are you sure?");
|
||||
},
|
||||
);
|
||||
deployMode.DeployApp();
|
||||
deployMode.NavigateBacktoEditor();
|
||||
ee.ExpandCollapseEntity("Queries/JS");
|
||||
dataSources.DeleteDatasouceFromWinthinDS(dsName, 200);
|
||||
});
|
||||
});
|
||||
|
|
@ -1,80 +0,0 @@
|
|||
import { ObjectsRegistry } from "../../../../support/Objects/Registry";
|
||||
import inputData from "../../../../support/Objects/mySqlData";
|
||||
|
||||
let dsName: any, query: string;
|
||||
const agHelper = ObjectsRegistry.AggregateHelper,
|
||||
ee = ObjectsRegistry.EntityExplorer,
|
||||
dataSources = ObjectsRegistry.DataSources,
|
||||
propPane = ObjectsRegistry.PropertyPane,
|
||||
table = ObjectsRegistry.Table,
|
||||
locator = ObjectsRegistry.CommonLocators,
|
||||
deployMode = ObjectsRegistry.DeployMode;
|
||||
|
||||
describe("MySQL Datatype tests", function () {
|
||||
it("1. Create Mysql DS", function () {
|
||||
dataSources.CreateDataSource("MySql");
|
||||
cy.get("@dsName").then(($dsName) => {
|
||||
dsName = $dsName;
|
||||
});
|
||||
});
|
||||
|
||||
it("2. Creating mysqlDTs table", () => {
|
||||
//IF NOT EXISTS can be used - which creates tabel if it does not exist and donot throw any error if table exists.
|
||||
//But if we add this option then next case could fail inn that case.
|
||||
query = inputData.query.createTable;
|
||||
ee.CreateNewDsQuery(dsName);
|
||||
agHelper.RenameWithInPane("createTable");
|
||||
agHelper.GetNClick(dataSources._templateMenu);
|
||||
dataSources.EnterQuery(query);
|
||||
dataSources.RunQuery();
|
||||
|
||||
ee.ExpandCollapseEntity("Datasources");
|
||||
ee.ActionContextMenuByEntityName(dsName, "Refresh");
|
||||
agHelper.AssertElementVisible(
|
||||
ee._entityNameInExplorer(inputData.tableName),
|
||||
);
|
||||
});
|
||||
|
||||
//Insert false values to each column and check for the error status of the request.
|
||||
it("3. False Cases", () => {
|
||||
ee.ActionTemplateMenuByEntityName(inputData.tableName, "INSERT");
|
||||
agHelper.RenameWithInPane("falseCases");
|
||||
inputData.falseResult.forEach((res_array, i) => {
|
||||
res_array.forEach((value) => {
|
||||
query =
|
||||
typeof value === "string"
|
||||
? `INSERT INTO ${inputData.tableName} (${inputData.inputFieldName[i]}) VALUES ({{"${value}"}})`
|
||||
: `INSERT INTO ${inputData.tableName} (${inputData.inputFieldName[i]}) VALUES ({{${value}}})`;
|
||||
dataSources.EnterQuery(query);
|
||||
dataSources.RunQuery(true, false);
|
||||
});
|
||||
});
|
||||
agHelper.Sleep(2000);
|
||||
agHelper.WaitUntilAllToastsDisappear();
|
||||
});
|
||||
|
||||
//This is a special case.
|
||||
//Added due to server side checks, which was handled in Datatype handling.
|
||||
it("4. Long Integer as query param", () => {
|
||||
query = `SELECT * FROM ${inputData.tableName} LIMIT {{2147483648}}`;
|
||||
dataSources.EnterQuery(query);
|
||||
dataSources.RunQuery();
|
||||
});
|
||||
|
||||
it("5. Drop Table", () => {
|
||||
query = inputData.query.dropTable;
|
||||
dataSources.EnterQuery(query);
|
||||
dataSources.RunQuery();
|
||||
});
|
||||
|
||||
it("6. Verify Deletion of the datasource after all created queries are Deleted", () => {
|
||||
ee.ExpandCollapseEntity("Queries/JS");
|
||||
["falseCases", "createTable"].forEach((type) => {
|
||||
ee.ActionContextMenuByEntityName(type, "Delete", "Are you sure?");
|
||||
});
|
||||
deployMode.DeployApp();
|
||||
deployMode.NavigateBacktoEditor();
|
||||
ee.ExpandCollapseEntity("Queries/JS");
|
||||
dataSources.DeleteDatasouceFromWinthinDS(dsName, 200);
|
||||
});
|
||||
});
|
||||
|
|
@ -0,0 +1,154 @@
|
|||
import * as _ from "../../../../support/Objects/ObjectsCore";
|
||||
import inputData from "../../../../support/Objects/mySqlData";
|
||||
|
||||
let dsName: any, query: string;
|
||||
|
||||
describe("MySQL Datatype tests", function () {
|
||||
before("Load dsl, Change theme, Create Mysql DS", () => {
|
||||
cy.fixture("Datatypes/mySQLdsl").then((val: any) => {
|
||||
_.agHelper.AddDsl(val);
|
||||
});
|
||||
_.appSettings.OpenPaneAndChangeTheme("Moon");
|
||||
_.dataSources.CreateDataSource("MySql");
|
||||
cy.get("@dsName").then(($dsName) => {
|
||||
dsName = $dsName;
|
||||
});
|
||||
});
|
||||
|
||||
it("1. Creating mysqlDTs _.table & queries", () => {
|
||||
//IF NOT EXISTS can be used - which creates tabel if it does not exist and donot throw any error if _.table exists.
|
||||
//But if we add this option then next case could fail inn that case.
|
||||
query = inputData.query.createTable;
|
||||
|
||||
_.dataSources.CreateQueryFromOverlay(dsName, query, "createTable"); //Creating query from EE overlay
|
||||
_.dataSources.RunQuery();
|
||||
|
||||
_.entityExplorer.ExpandCollapseEntity("Datasources");
|
||||
_.entityExplorer.ActionContextMenuByEntityName(dsName, "Refresh");
|
||||
_.agHelper.AssertElementVisible(
|
||||
_.entityExplorer._entityNameInExplorer(inputData.tableName),
|
||||
);
|
||||
|
||||
//Creating SELECT query
|
||||
_.entityExplorer.ActionTemplateMenuByEntityName(
|
||||
inputData.tableName,
|
||||
"SELECT",
|
||||
);
|
||||
_.agHelper.RenameWithInPane("selectRecords");
|
||||
_.dataSources.RunQuery();
|
||||
_.agHelper
|
||||
.GetText(_.dataSources._noRecordFound)
|
||||
.then(($noRecMsg) => expect($noRecMsg).to.eq("No data records to show"));
|
||||
|
||||
//Other queries
|
||||
query = inputData.query.insertRecord;
|
||||
_.entityExplorer.ActionTemplateMenuByEntityName(
|
||||
inputData.tableName,
|
||||
"INSERT",
|
||||
);
|
||||
_.agHelper.RenameWithInPane("insertRecord");
|
||||
_.dataSources.EnterQuery(query);
|
||||
|
||||
query = inputData.query.dropTable;
|
||||
_.entityExplorer.ActionTemplateMenuByEntityName(
|
||||
inputData.tableName,
|
||||
"DELETE",
|
||||
);
|
||||
_.agHelper.RenameWithInPane("dropTable");
|
||||
_.dataSources.EnterQuery(query);
|
||||
});
|
||||
|
||||
//Insert valid/true values into datasource
|
||||
it("2. Inserting record", () => {
|
||||
_.entityExplorer.SelectEntityByName("Page1");
|
||||
_.deployMode.DeployApp();
|
||||
_.table.WaitForTableEmpty(); //asserting table is empty before inserting!
|
||||
_.agHelper.ClickButton("Run InsertQuery");
|
||||
inputData.input.forEach((valueArr, i) => {
|
||||
_.agHelper.ClickButton("Run InsertQuery");
|
||||
valueArr.forEach((value, index) => {
|
||||
if (value !== "")
|
||||
_.agHelper.EnterInputText(inputData.inputFieldName[index], value);
|
||||
});
|
||||
i % 2 && _.agHelper.ToggleSwitch("Bool_column");
|
||||
_.agHelper.ClickButton("insertRecord");
|
||||
_.agHelper.AssertElementVisible(
|
||||
_.locators._spanButton("Run InsertQuery"),
|
||||
);
|
||||
_.agHelper.Sleep(2000);
|
||||
});
|
||||
});
|
||||
|
||||
//Verify weather expected value is present in each cell
|
||||
//i.e. weather right data is pushed and fetched from datasource.
|
||||
it("3. Validating values in each cell", () => {
|
||||
cy.wait(2000);
|
||||
inputData.result.forEach((res_array, i) => {
|
||||
res_array.forEach((value, j) => {
|
||||
_.table.ReadTableRowColumnData(j, i, "v1", 0).then(($cellData) => {
|
||||
if (i === inputData.result.length - 1) {
|
||||
const obj = JSON.parse($cellData);
|
||||
expect(JSON.stringify(obj)).to.eq(JSON.stringify(value));
|
||||
} else {
|
||||
expect($cellData).to.eq(value);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
//null will be displayed as empty string in _.tables
|
||||
//So test null we have to intercept execute request.
|
||||
//And check response payload.
|
||||
it("4. Testing null value", () => {
|
||||
_.deployMode.NavigateBacktoEditor();
|
||||
_.entityExplorer.ExpandCollapseEntity("Queries/JS");
|
||||
_.entityExplorer.SelectEntityByName("selectRecords");
|
||||
_.dataSources.RunQuery(false);
|
||||
cy.wait("@postExecute").then((intercept) => {
|
||||
expect(
|
||||
typeof intercept.response?.body.data.body[5].varchar_column,
|
||||
).to.be.equal("object");
|
||||
expect(intercept.response?.body.data.body[5].varchar_column).to.be.equal(
|
||||
null,
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
after(
|
||||
"Verify Drop of tables & Deletion of the datasource after all created queries are Deleted",
|
||||
() => {
|
||||
_.entityExplorer.SelectEntityByName("dropTable");
|
||||
_.dataSources.RunQuery();
|
||||
_.dataSources.ReadQueryTableResponse(0).then(($cellData) => {
|
||||
expect($cellData).to.eq("0"); //Success response for dropped _.table!
|
||||
});
|
||||
_.entityExplorer.ExpandCollapseEntity("Queries/JS", false);
|
||||
_.entityExplorer.ExpandCollapseEntity("Datasources");
|
||||
_.entityExplorer.ExpandCollapseEntity(dsName);
|
||||
_.entityExplorer.ActionContextMenuByEntityName(dsName, "Refresh");
|
||||
_.agHelper.AssertElementAbsence(
|
||||
_.entityExplorer._entityNameInExplorer(inputData.tableName),
|
||||
);
|
||||
_.entityExplorer.ExpandCollapseEntity(dsName, false);
|
||||
_.entityExplorer.ExpandCollapseEntity("Datasources", false);
|
||||
|
||||
//DS deletion
|
||||
_.dataSources.DeleteDatasouceFromWinthinDS(dsName, 409); //Since all queries exists
|
||||
_.entityExplorer.ExpandCollapseEntity("Queries/JS");
|
||||
["createTable", "dropTable", "insertRecord", "selectRecords"].forEach(
|
||||
(type) => {
|
||||
_.entityExplorer.ActionContextMenuByEntityName(
|
||||
type,
|
||||
"Delete",
|
||||
"Are you sure?",
|
||||
);
|
||||
},
|
||||
);
|
||||
_.deployMode.DeployApp();
|
||||
_.deployMode.NavigateBacktoEditor();
|
||||
_.entityExplorer.ExpandCollapseEntity("Queries/JS");
|
||||
_.dataSources.DeleteDatasouceFromWinthinDS(dsName, 200);
|
||||
},
|
||||
);
|
||||
});
|
||||
|
|
@ -0,0 +1,74 @@
|
|||
import * as _ from "../../../../support/Objects/ObjectsCore";
|
||||
import inputData from "../../../../support/Objects/mySqlData";
|
||||
|
||||
let dsName: any, query: string;
|
||||
|
||||
describe("MySQL Datatype tests", function () {
|
||||
before("Create Mysql DS & Create mysqlDTs table", function () {
|
||||
_.dataSources.CreateDataSource("MySql");
|
||||
cy.get("@dsName").then(($dsName) => {
|
||||
dsName = $dsName;
|
||||
//IF NOT EXISTS can be used - which creates tabel if it does not exist and donot throw any error if table exists.
|
||||
//But if we add this option then next case could fail inn that case.
|
||||
query = inputData.query.createTable;
|
||||
_.dataSources.CreateQueryAfterDSSaved(query, "createTable"); //Creating query from EE overlay
|
||||
_.dataSources.RunQuery();
|
||||
|
||||
_.entityExplorer.ExpandCollapseEntity("Datasources");
|
||||
_.entityExplorer.ActionContextMenuByEntityName(dsName, "Refresh");
|
||||
_.agHelper.AssertElementVisible(
|
||||
_.entityExplorer._entityNameInExplorer(inputData.tableName),
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
//Insert false values to each column and check for the error status of the request.
|
||||
it("1. False Cases & Long Integer as query param", () => {
|
||||
_.entityExplorer.ActionTemplateMenuByEntityName(
|
||||
inputData.tableName,
|
||||
"INSERT",
|
||||
);
|
||||
_.agHelper.RenameWithInPane("falseCases");
|
||||
inputData.falseResult.forEach((res_array, i) => {
|
||||
res_array.forEach((value) => {
|
||||
query =
|
||||
typeof value === "string"
|
||||
? `INSERT INTO ${inputData.tableName} (${inputData.inputFieldName[i]}) VALUES ({{"${value}"}})`
|
||||
: `INSERT INTO ${inputData.tableName} (${inputData.inputFieldName[i]}) VALUES ({{${value}}})`;
|
||||
_.dataSources.EnterQuery(query);
|
||||
_.dataSources.RunQuery(true, false);
|
||||
});
|
||||
});
|
||||
_.agHelper.Sleep(2000);
|
||||
_.agHelper.WaitUntilAllToastsDisappear();
|
||||
|
||||
//This is a special case.
|
||||
//Added due to server side checks, which was handled in Datatype handling.
|
||||
//Long Integer as query param
|
||||
query = `SELECT * FROM ${inputData.tableName} LIMIT {{2147483648}}`;
|
||||
_.dataSources.EnterQuery(query);
|
||||
_.dataSources.RunQuery();
|
||||
});
|
||||
|
||||
after(
|
||||
"Verify Drop table & Deletion of the datasource after all created queries are Deleted",
|
||||
() => {
|
||||
query = inputData.query.dropTable;
|
||||
_.dataSources.EnterQuery(query);
|
||||
_.dataSources.RunQuery();
|
||||
|
||||
_.entityExplorer.ExpandCollapseEntity("Queries/JS");
|
||||
["falseCases", "createTable"].forEach((type) => {
|
||||
_.entityExplorer.ActionContextMenuByEntityName(
|
||||
type,
|
||||
"Delete",
|
||||
"Are you sure?",
|
||||
);
|
||||
});
|
||||
_.deployMode.DeployApp();
|
||||
_.deployMode.NavigateBacktoEditor();
|
||||
_.entityExplorer.ExpandCollapseEntity("Queries/JS");
|
||||
_.dataSources.DeleteDatasouceFromWinthinDS(dsName, 200);
|
||||
},
|
||||
);
|
||||
});
|
||||
|
|
@ -1,23 +1,17 @@
|
|||
import { ObjectsRegistry } from "../../../../support/Objects/Registry";
|
||||
import * as _ from "../../../../support/Objects/ObjectsCore";
|
||||
|
||||
let guid: any, dsName_1: any, dsName_2: any;
|
||||
|
||||
const agHelper = ObjectsRegistry.AggregateHelper,
|
||||
ee = ObjectsRegistry.EntityExplorer,
|
||||
dataSources = ObjectsRegistry.DataSources,
|
||||
propPane = ObjectsRegistry.PropertyPane,
|
||||
deployMode = ObjectsRegistry.DeployMode;
|
||||
|
||||
describe("Test Postgres number of connections on page load + Bug 11572, Bug 11202", function () {
|
||||
before(() => {
|
||||
agHelper.GenerateUUID();
|
||||
_.agHelper.GenerateUUID();
|
||||
cy.get("@guid").then((uid) => {
|
||||
dataSources.NavigateToDSCreateNew();
|
||||
dataSources.CreatePlugIn("PostgreSQL");
|
||||
_.dataSources.NavigateToDSCreateNew();
|
||||
_.dataSources.CreatePlugIn("PostgreSQL");
|
||||
guid = uid;
|
||||
agHelper.RenameWithInPane("Postgres_1_ " + guid, false);
|
||||
dataSources.FillPostgresDSForm();
|
||||
dataSources.TestSaveDatasource();
|
||||
_.agHelper.RenameWithInPane("Postgres_1_ " + guid, false);
|
||||
_.dataSources.FillPostgresDSForm();
|
||||
_.dataSources.TestSaveDatasource();
|
||||
|
||||
cy.wrap("Postgres_1_ " + guid).as("dsName_1");
|
||||
cy.get("@dsName_1").then(($dsName) => {
|
||||
|
|
@ -27,9 +21,6 @@ describe("Test Postgres number of connections on page load + Bug 11572, Bug 1120
|
|||
});
|
||||
|
||||
it("1. Run create new user query", () => {
|
||||
ee.CreateNewDsQuery(dsName_1);
|
||||
agHelper.GetNClick(dataSources._templateMenu);
|
||||
agHelper.RenameWithInPane("create_user");
|
||||
const userName = "test_conn_user_" + guid;
|
||||
const userCreateQuery =
|
||||
`create user ` +
|
||||
|
|
@ -37,96 +28,100 @@ describe("Test Postgres number of connections on page load + Bug 11572, Bug 1120
|
|||
` with password 'password'; grant select, insert, update, delete on all tables in schema public to ` +
|
||||
userName +
|
||||
`;`;
|
||||
dataSources.EnterQuery(userCreateQuery);
|
||||
dataSources.RunQuery();
|
||||
dataSources.ReadQueryTableResponse(0).then(($cellData) => {
|
||||
_.dataSources.CreateQueryFromOverlay(
|
||||
dsName_1,
|
||||
userCreateQuery,
|
||||
"create_user",
|
||||
); //Creating query from EE overlay
|
||||
_.dataSources.RunQuery();
|
||||
_.dataSources.ReadQueryTableResponse(0).then(($cellData) => {
|
||||
expect($cellData).to.eq("0");
|
||||
});
|
||||
});
|
||||
|
||||
it("2. Create new datasource for user test_conn_user", () => {
|
||||
dataSources.NavigateToDSCreateNew();
|
||||
dataSources.CreatePlugIn("PostgreSQL");
|
||||
agHelper.RenameWithInPane("Postgres_2_ " + guid, false);
|
||||
_.dataSources.NavigateToDSCreateNew();
|
||||
_.dataSources.CreatePlugIn("PostgreSQL");
|
||||
_.agHelper.RenameWithInPane("Postgres_2_ " + guid, false);
|
||||
const userName = "test_conn_user_" + guid;
|
||||
dataSources.FillPostgresDSForm(false, userName, "password");
|
||||
dataSources.TestSaveDatasource();
|
||||
_.dataSources.FillPostgresDSForm(false, userName, "password");
|
||||
_.dataSources.TestSaveDatasource();
|
||||
|
||||
cy.wrap("Postgres_2_ " + guid).as("dsName_2");
|
||||
cy.get("@dsName_2").then(($dsName) => {
|
||||
dsName_2 = $dsName;
|
||||
});
|
||||
});
|
||||
|
||||
it("3. Create 10 queries", () => {
|
||||
//Create 10 queries
|
||||
for (let i = 1; i <= 10; i++) {
|
||||
dataSources.NavigateFromActiveDS(dsName_2, true);
|
||||
agHelper.GetNClick(dataSources._templateMenu);
|
||||
agHelper.RenameWithInPane("Query_" + i);
|
||||
_.dataSources.NavigateFromActiveDS(dsName_2, true);
|
||||
_.agHelper.GetNClick(_.dataSources._templateMenu);
|
||||
_.agHelper.RenameWithInPane("Query_" + i);
|
||||
const userCreateQuery = `select table_name from information_schema.tables where table_schema='public' and table_type='BASE TABLE';`;
|
||||
dataSources.EnterQuery(userCreateQuery);
|
||||
_.dataSources.EnterQuery(userCreateQuery);
|
||||
}
|
||||
});
|
||||
|
||||
it.skip("4. Bind queries to select widget", () => {
|
||||
it.skip("3. Bind queries to select widget", () => {
|
||||
for (let i = 1; i <= 10; i++) {
|
||||
ee.DragDropWidgetNVerify("selectwidget", i * 50 + 50, i * 50 + 200);
|
||||
propPane.UpdatePropertyFieldValue(
|
||||
_.entityExplorer.DragDropWidgetNVerify(
|
||||
"selectwidget",
|
||||
i * 50 + 50,
|
||||
i * 50 + 200,
|
||||
);
|
||||
_.propPane.UpdatePropertyFieldValue(
|
||||
"Options",
|
||||
"{{Query_" +
|
||||
i +
|
||||
".data.map( (obj) =>{ return {'label': obj.table_name, 'value': obj.table_name }})}}",
|
||||
);
|
||||
propPane.UpdatePropertyFieldValue(
|
||||
_.propPane.UpdatePropertyFieldValue(
|
||||
"Default Selected Value",
|
||||
"{{Query_" + i + ".data[" + (i - 1) + "].table_name}}",
|
||||
);
|
||||
agHelper.ValidateNetworkStatus("@updateLayout", 200);
|
||||
_.agHelper.ValidateNetworkStatus("@updateLayout", 200);
|
||||
}
|
||||
});
|
||||
|
||||
it("5. Run query to drop any open connections before deploy and then deploy app", () => {
|
||||
dataSources.NavigateFromActiveDS(dsName_1, true);
|
||||
agHelper.GetNClick(dataSources._templateMenu);
|
||||
agHelper.RenameWithInPane("check_number_of_connections_1");
|
||||
it("4. Run query to drop any open connections before deploy and then deploy app", () => {
|
||||
_.dataSources.NavigateFromActiveDS(dsName_1, true);
|
||||
_.agHelper.GetNClick(_.dataSources._templateMenu);
|
||||
_.agHelper.RenameWithInPane("check_number_of_connections_1");
|
||||
const userName = "test_conn_user_" + guid;
|
||||
const dropConnections =
|
||||
`select pg_terminate_backend(pg_stat_activity.pid) from pg_stat_activity where pg_stat_activity.usename = '` +
|
||||
userName +
|
||||
`'`;
|
||||
dataSources.EnterQuery(dropConnections);
|
||||
dataSources.RunQuery();
|
||||
_.dataSources.EnterQuery(dropConnections);
|
||||
_.dataSources.RunQuery();
|
||||
const checkNoOfConnQuery =
|
||||
`select count(*) from pg_stat_activity where usename='` + userName + `'`;
|
||||
dataSources.EnterQuery(checkNoOfConnQuery);
|
||||
dataSources.RunQuery();
|
||||
dataSources.ReadQueryTableResponse(0).then(($cellData) => {
|
||||
_.dataSources.EnterQuery(checkNoOfConnQuery);
|
||||
_.dataSources.RunQuery();
|
||||
_.dataSources.ReadQueryTableResponse(0).then(($cellData) => {
|
||||
expect(Number($cellData)).to.eq(0);
|
||||
});
|
||||
deployMode.DeployApp();
|
||||
agHelper.Sleep(10000);
|
||||
deployMode.NavigateBacktoEditor();
|
||||
_.deployMode.DeployApp();
|
||||
_.agHelper.Sleep(10000);
|
||||
_.deployMode.NavigateBacktoEditor();
|
||||
});
|
||||
|
||||
it("6. Run query to check number of open connections after deploy", () => {
|
||||
dataSources.NavigateFromActiveDS(dsName_2, true);
|
||||
agHelper.GetNClick(dataSources._templateMenu);
|
||||
agHelper.RenameWithInPane("check_number_of_connections_2");
|
||||
it("5. Run query to check number of open connections after deploy", () => {
|
||||
_.dataSources.NavigateFromActiveDS(dsName_2, true);
|
||||
_.agHelper.GetNClick(_.dataSources._templateMenu);
|
||||
_.agHelper.RenameWithInPane("check_number_of_connections_2");
|
||||
const checkNoOfConnQuery =
|
||||
`select count(*) from pg_stat_activity where usename='test_conn_user_` +
|
||||
guid +
|
||||
`'`;
|
||||
dataSources.EnterQuery(checkNoOfConnQuery);
|
||||
dataSources.RunQuery();
|
||||
dataSources.ReadQueryTableResponse(0).then(($cellData) => {
|
||||
_.dataSources.EnterQuery(checkNoOfConnQuery);
|
||||
_.dataSources.RunQuery();
|
||||
_.dataSources.ReadQueryTableResponse(0).then(($cellData) => {
|
||||
expect(Number($cellData)).to.lte(5);
|
||||
});
|
||||
});
|
||||
|
||||
it("7. Drop the newly created user", () => {
|
||||
ee.CreateNewDsQuery(dsName_1);
|
||||
agHelper.RenameWithInPane("drop_user");
|
||||
agHelper.GetNClick(dataSources._templateMenu);
|
||||
it("6. Drop the newly created user", () => {
|
||||
const userName = "test_conn_user_" + guid;
|
||||
const dropUser =
|
||||
`DROP OWNED BY ` +
|
||||
|
|
@ -135,39 +130,50 @@ describe("Test Postgres number of connections on page load + Bug 11572, Bug 1120
|
|||
DROP USER ` +
|
||||
userName +
|
||||
`;`;
|
||||
dataSources.EnterQuery(dropUser);
|
||||
dataSources.RunQuery();
|
||||
dataSources.ReadQueryTableResponse(0).then(($cellData) => {
|
||||
_.dataSources.CreateQueryFromOverlay(dsName_1, dropUser, "drop_user"); //Creating query from EE overlay
|
||||
_.dataSources.RunQuery();
|
||||
_.dataSources.ReadQueryTableResponse(0).then(($cellData) => {
|
||||
expect($cellData).to.eq("0");
|
||||
});
|
||||
|
||||
agHelper.ActionContextMenuWithInPane("Delete");
|
||||
_.agHelper.ActionContextMenuWithInPane("Delete");
|
||||
});
|
||||
|
||||
it("8. Verify Deletion of all created queries", () => {
|
||||
ee.ExpandCollapseEntity("Queries/JS");
|
||||
ee.ActionContextMenuByEntityName("create_user", "Delete", "Are you sure?");
|
||||
ee.ActionContextMenuByEntityName(
|
||||
"check_number_of_connections_1",
|
||||
"Delete",
|
||||
"Are you sure?",
|
||||
);
|
||||
ee.ActionContextMenuByEntityName(
|
||||
"check_number_of_connections_2",
|
||||
"Delete",
|
||||
"Are you sure?",
|
||||
);
|
||||
after(
|
||||
"Verify Verify Deletion of all created queries & Deletion of datasource",
|
||||
() => {
|
||||
//Verify Deletion of all created queries
|
||||
_.entityExplorer.ExpandCollapseEntity("Queries/JS");
|
||||
_.entityExplorer.ActionContextMenuByEntityName(
|
||||
"create_user",
|
||||
"Delete",
|
||||
"Are you sure?",
|
||||
);
|
||||
_.entityExplorer.ActionContextMenuByEntityName(
|
||||
"check_number_of_connections_1",
|
||||
"Delete",
|
||||
"Are you sure?",
|
||||
);
|
||||
_.entityExplorer.ActionContextMenuByEntityName(
|
||||
"check_number_of_connections_2",
|
||||
"Delete",
|
||||
"Are you sure?",
|
||||
);
|
||||
|
||||
for (let i = 1; i <= 10; i++) {
|
||||
ee.ActionContextMenuByEntityName("Query_" + i, "Delete", "Are you sure?");
|
||||
}
|
||||
});
|
||||
for (let i = 1; i <= 10; i++) {
|
||||
_.entityExplorer.ActionContextMenuByEntityName(
|
||||
"Query_" + i,
|
||||
"Delete",
|
||||
"Are you sure?",
|
||||
);
|
||||
}
|
||||
|
||||
it("9. Verify Deletion of datasource", () => {
|
||||
deployMode.DeployApp();
|
||||
deployMode.NavigateBacktoEditor();
|
||||
ee.ExpandCollapseEntity("Queries/JS");
|
||||
dataSources.DeleteDatasouceFromWinthinDS(dsName_1, 200);
|
||||
dataSources.DeleteDatasouceFromWinthinDS(dsName_2, 200);
|
||||
});
|
||||
//Verify deletion of datasource
|
||||
_.deployMode.DeployApp();
|
||||
_.deployMode.NavigateBacktoEditor();
|
||||
_.entityExplorer.ExpandCollapseEntity("Queries/JS");
|
||||
_.dataSources.DeleteDatasouceFromWinthinDS(dsName_1, 200);
|
||||
_.dataSources.DeleteDatasouceFromWinthinDS(dsName_2, 200);
|
||||
},
|
||||
);
|
||||
});
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -1,307 +1,279 @@
|
|||
import { ObjectsRegistry } from "../../../../support/Objects/Registry";
|
||||
import * as _ from "../../../../support/Objects/ObjectsCore";
|
||||
|
||||
let dsName: any, query: string, imageNameToUpload: string;
|
||||
const agHelper = ObjectsRegistry.AggregateHelper,
|
||||
ee = ObjectsRegistry.EntityExplorer,
|
||||
dataSources = ObjectsRegistry.DataSources,
|
||||
table = ObjectsRegistry.Table,
|
||||
locator = ObjectsRegistry.CommonLocators,
|
||||
deployMode = ObjectsRegistry.DeployMode,
|
||||
appSettings = ObjectsRegistry.AppSettings;
|
||||
|
||||
describe("Binary Datatype tests", function () {
|
||||
before(() => {
|
||||
dataSources.CreateDataSource("Postgres");
|
||||
before("Create DS, Importing App & setting theme", () => {
|
||||
cy.fixture("Datatypes/BinaryDTdsl").then((val: any) => {
|
||||
_.agHelper.AddDsl(val);
|
||||
});
|
||||
_.appSettings.OpenPaneAndChangeThemeColors(24, -37);
|
||||
_.dataSources.CreateDataSource("Postgres");
|
||||
cy.get("@dsName").then(($dsName) => {
|
||||
dsName = $dsName;
|
||||
});
|
||||
});
|
||||
|
||||
it("0. Importing App & setting theme", () => {
|
||||
cy.fixture("Datatypes/BinaryDTdsl").then((val: any) => {
|
||||
agHelper.AddDsl(val);
|
||||
});
|
||||
ee.NavigateToSwitcher("widgets");
|
||||
appSettings.OpenPaneAndChangeThemeColors(24, -37);
|
||||
});
|
||||
|
||||
it("1. Creating table query - binarytype", () => {
|
||||
it("1. Creating table queries - binarytype + Bug 14493", () => {
|
||||
query = `CREATE table binarytype (serialid SERIAL primary key, imagename TEXT, existingImage bytea, newImage bytea);`;
|
||||
dataSources.NavigateFromActiveDS(dsName, true);
|
||||
agHelper.GetNClick(dataSources._templateMenu);
|
||||
agHelper.RenameWithInPane("createTable");
|
||||
dataSources.EnterQuery(query);
|
||||
dataSources.RunQuery();
|
||||
_.dataSources.CreateQueryAfterDSSaved(query, "createTable");
|
||||
_.dataSources.RunQuery();
|
||||
|
||||
ee.ExpandCollapseEntity("Datasources");
|
||||
ee.ActionContextMenuByEntityName(dsName, "Refresh");
|
||||
agHelper.AssertElementVisible(
|
||||
ee._entityNameInExplorer("public.binarytype"),
|
||||
_.entityExplorer.ExpandCollapseEntity("Datasources");
|
||||
_.entityExplorer.ActionContextMenuByEntityName(dsName, "Refresh");
|
||||
_.agHelper.AssertElementVisible(
|
||||
_.entityExplorer._entityNameInExplorer("public.binarytype"),
|
||||
);
|
||||
});
|
||||
|
||||
it("2. Creating SELECT query - binarytype + Bug 14493", () => {
|
||||
//Creating SELECT query - binarytype + Bug 14493
|
||||
query = `SELECT binarytype.serialid, binarytype.imagename, encode(binarytype.existingimage, 'escape') as "OldImage", encode(binarytype.newimage, 'escape') as "NewImage" from public."binarytype";`;
|
||||
ee.ActionTemplateMenuByEntityName("public.binarytype", "SELECT");
|
||||
agHelper.RenameWithInPane("selectRecords");
|
||||
dataSources.RunQuery();
|
||||
agHelper
|
||||
.GetText(dataSources._noRecordFound)
|
||||
_.entityExplorer.ActionTemplateMenuByEntityName(
|
||||
"public.binarytype",
|
||||
"SELECT",
|
||||
);
|
||||
_.agHelper.RenameWithInPane("selectRecords");
|
||||
_.dataSources.RunQuery();
|
||||
_.agHelper
|
||||
.GetText(_.dataSources._noRecordFound)
|
||||
.then(($noRecMsg) => expect($noRecMsg).to.eq("No data records to show"));
|
||||
dataSources.EnterQuery(query);
|
||||
});
|
||||
_.dataSources.EnterQuery(query);
|
||||
|
||||
it("3. Creating all queries - binarytype", () => {
|
||||
//Other queries
|
||||
query = `INSERT INTO public."binarytype" ("imagename", "existingimage", "newimage") VALUES ('{{Insertimagename.text}}', '{{Insertimage.files[0].data}}', '{{Insertimage.files[0].data}}');`;
|
||||
ee.CreateNewDsQuery(dsName);
|
||||
agHelper.RenameWithInPane("insertRecord");
|
||||
agHelper.GetNClick(dataSources._templateMenu);
|
||||
dataSources.EnterQuery(query);
|
||||
_.dataSources.CreateQueryFromOverlay(dsName, query, "insertRecord");
|
||||
|
||||
query = `UPDATE public."binarytype" SET "imagename" ='{{Updatename.text}}', "existingimage" = '{{Table1.selectedRow.OldImage}}', "newimage" = '{{Updateimage.files[0].data}}' WHERE serialid = {{Table1.selectedRow.serialid}};`;
|
||||
ee.CreateNewDsQuery(dsName);
|
||||
agHelper.RenameWithInPane("updateRecord");
|
||||
agHelper.GetNClick(dataSources._templateMenu);
|
||||
dataSources.EnterQuery(query);
|
||||
_.dataSources.CreateQueryFromOverlay(dsName, query, "updateRecord");
|
||||
|
||||
query = `DELETE FROM public."binarytype" WHERE serialId = {{Table1.selectedRow.serialid}}`;
|
||||
ee.CreateNewDsQuery(dsName);
|
||||
agHelper.RenameWithInPane("deleteRecord");
|
||||
agHelper.GetNClick(dataSources._templateMenu);
|
||||
dataSources.EnterQuery(query);
|
||||
_.dataSources.CreateQueryFromOverlay(dsName, query, "deleteRecord");
|
||||
|
||||
query = `DELETE FROM public."binarytype"`;
|
||||
ee.CreateNewDsQuery(dsName);
|
||||
agHelper.RenameWithInPane("deleteAllRecords");
|
||||
agHelper.GetNClick(dataSources._templateMenu);
|
||||
dataSources.EnterQuery(query);
|
||||
_.dataSources.CreateQueryFromOverlay(dsName, query, "deleteAllRecords");
|
||||
|
||||
query = `drop table public."binarytype"`;
|
||||
ee.CreateNewDsQuery(dsName);
|
||||
agHelper.RenameWithInPane("dropTable");
|
||||
agHelper.GetNClick(dataSources._templateMenu);
|
||||
dataSources.EnterQuery(query);
|
||||
query = `DROP table public."binarytype"`;
|
||||
_.dataSources.CreateQueryFromOverlay(dsName, query, "dropTable");
|
||||
|
||||
ee.ExpandCollapseEntity("Queries/JS", false);
|
||||
ee.ExpandCollapseEntity(dsName, false);
|
||||
_.entityExplorer.ExpandCollapseEntity("Queries/JS", false);
|
||||
_.entityExplorer.ExpandCollapseEntity(dsName, false);
|
||||
});
|
||||
|
||||
it("4. Inserting record - binarytype", () => {
|
||||
it("2. Inserting record - binarytype", () => {
|
||||
imageNameToUpload = "Datatypes/Bridge.jpg";
|
||||
ee.SelectEntityByName("Page1");
|
||||
deployMode.DeployApp();
|
||||
table.WaitForTableEmpty(); //asserting table is empty before inserting!
|
||||
agHelper.ClickButton("Run InsertQuery");
|
||||
agHelper.AssertElementVisible(locator._modal);
|
||||
_.entityExplorer.SelectEntityByName("Page1");
|
||||
_.deployMode.DeployApp();
|
||||
_.table.WaitForTableEmpty(); //asserting _.table is empty before inserting!
|
||||
_.agHelper.ClickButton("Run InsertQuery");
|
||||
_.agHelper.AssertElementVisible(_.locators._modal);
|
||||
|
||||
agHelper.ClickButton("Select New Image");
|
||||
agHelper.UploadFile(imageNameToUpload);
|
||||
_.agHelper.ClickButton("Select New Image");
|
||||
_.agHelper.UploadFile(imageNameToUpload);
|
||||
|
||||
agHelper.ClickButton("Insert");
|
||||
agHelper.AssertElementAbsence(locator._toastMsg); //Assert that Insert did not fail
|
||||
agHelper.AssertElementVisible(locator._spanButton("Run InsertQuery"));
|
||||
agHelper.AssertElementAbsence(locator._spinner, 20000); //for the update row to appear at last
|
||||
table.WaitUntilTableLoad();
|
||||
agHelper.Sleep(2000); //some more time for all rows with images to be populated
|
||||
table.ReadTableRowColumnData(0, 0).then(($cellData) => {
|
||||
_.agHelper.ClickButton("Insert");
|
||||
_.agHelper.AssertElementAbsence(_.locators._toastMsg); //Assert that Insert did not fail
|
||||
_.agHelper.AssertElementVisible(_.locators._spanButton("Run InsertQuery"));
|
||||
_.agHelper.AssertElementAbsence(_.locators._spinner, 20000); //for the update row to appear at last
|
||||
_.table.WaitUntilTableLoad();
|
||||
_.agHelper.Sleep(2000); //some more time for all rows with images to be populated
|
||||
_.table.ReadTableRowColumnData(0, 0).then(($cellData) => {
|
||||
expect($cellData).to.eq("1"); //asserting serial column is inserting fine in sequence
|
||||
});
|
||||
table.ReadTableRowColumnData(0, 1, "v1", 200).then(($cellData) => {
|
||||
_.table.ReadTableRowColumnData(0, 1, "v1", 200).then(($cellData) => {
|
||||
expect($cellData).to.eq("Bridge.jpg");
|
||||
});
|
||||
table.AssertTableRowImageColumnIsLoaded(0, 2).then(($oldimage) => {
|
||||
table.AssertTableRowImageColumnIsLoaded(0, 3).then(($newimage) => {
|
||||
_.table.AssertTableRowImageColumnIsLoaded(0, 2).then(($oldimage) => {
|
||||
_.table.AssertTableRowImageColumnIsLoaded(0, 3).then(($newimage) => {
|
||||
expect($oldimage).to.eq($newimage);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
it("5. Inserting another record - binarytype", () => {
|
||||
it("3. Inserting another record - binarytype", () => {
|
||||
imageNameToUpload = "Datatypes/Georgia.jpeg";
|
||||
|
||||
agHelper.ClickButton("Run InsertQuery");
|
||||
agHelper.AssertElementVisible(locator._modal);
|
||||
_.agHelper.ClickButton("Run InsertQuery");
|
||||
_.agHelper.AssertElementVisible(_.locators._modal);
|
||||
|
||||
agHelper.ClickButton("Select New Image");
|
||||
agHelper.UploadFile(imageNameToUpload);
|
||||
_.agHelper.ClickButton("Select New Image");
|
||||
_.agHelper.UploadFile(imageNameToUpload);
|
||||
|
||||
agHelper.ClickButton("Insert");
|
||||
agHelper.AssertElementAbsence(locator._toastMsg); //Assert that Insert did not fail
|
||||
agHelper.AssertElementVisible(locator._spanButton("Run InsertQuery"));
|
||||
agHelper.AssertElementAbsence(locator._spinner, 20000); //for the update row to appear at last
|
||||
table.WaitUntilTableLoad();
|
||||
agHelper.Sleep(2000); //some more time for all rows with images to be populated
|
||||
table.ReadTableRowColumnData(1, 0).then(($cellData) => {
|
||||
_.agHelper.ClickButton("Insert");
|
||||
_.agHelper.AssertElementAbsence(_.locators._toastMsg); //Assert that Insert did not fail
|
||||
_.agHelper.AssertElementVisible(_.locators._spanButton("Run InsertQuery"));
|
||||
_.agHelper.AssertElementAbsence(_.locators._spinner, 20000); //for the update row to appear at last
|
||||
_.table.WaitUntilTableLoad();
|
||||
_.agHelper.Sleep(2000); //some more time for all rows with images to be populated
|
||||
_.table.ReadTableRowColumnData(1, 0).then(($cellData) => {
|
||||
expect($cellData).to.eq("2"); //asserting serial column is inserting fine in sequence
|
||||
});
|
||||
table.ReadTableRowColumnData(1, 1, "v1", 200).then(($cellData) => {
|
||||
_.table.ReadTableRowColumnData(1, 1, "v1", 200).then(($cellData) => {
|
||||
expect($cellData).to.eq("Georgia.jpeg");
|
||||
});
|
||||
table.AssertTableRowImageColumnIsLoaded(1, 2).then(($oldimage) => {
|
||||
table.AssertTableRowImageColumnIsLoaded(1, 3).then(($newimage) => {
|
||||
_.table.AssertTableRowImageColumnIsLoaded(1, 2).then(($oldimage) => {
|
||||
_.table.AssertTableRowImageColumnIsLoaded(1, 3).then(($newimage) => {
|
||||
expect($oldimage).to.eq($newimage);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
it("6. Inserting another record - binarytype", () => {
|
||||
it("4. Inserting another record - binarytype", () => {
|
||||
imageNameToUpload = "Datatypes/Maine.jpeg";
|
||||
|
||||
agHelper.ClickButton("Run InsertQuery");
|
||||
agHelper.AssertElementVisible(locator._modal);
|
||||
_.agHelper.ClickButton("Run InsertQuery");
|
||||
_.agHelper.AssertElementVisible(_.locators._modal);
|
||||
|
||||
agHelper.ClickButton("Select New Image");
|
||||
agHelper.UploadFile(imageNameToUpload);
|
||||
_.agHelper.ClickButton("Select New Image");
|
||||
_.agHelper.UploadFile(imageNameToUpload);
|
||||
|
||||
agHelper.ClickButton("Insert");
|
||||
agHelper.AssertElementAbsence(locator._toastMsg); //Assert that Insert did not fail
|
||||
agHelper.AssertElementVisible(locator._spanButton("Run InsertQuery"));
|
||||
agHelper.AssertElementAbsence(locator._spinner, 20000); //for the update row to appear at last
|
||||
table.WaitUntilTableLoad();
|
||||
agHelper.Sleep(2000); //some more time for all rows with images to be populated
|
||||
table.ReadTableRowColumnData(2, 0).then(($cellData) => {
|
||||
_.agHelper.ClickButton("Insert");
|
||||
_.agHelper.AssertElementAbsence(_.locators._toastMsg); //Assert that Insert did not fail
|
||||
_.agHelper.AssertElementVisible(_.locators._spanButton("Run InsertQuery"));
|
||||
_.agHelper.AssertElementAbsence(_.locators._spinner, 20000); //for the update row to appear at last
|
||||
_.table.WaitUntilTableLoad();
|
||||
_.agHelper.Sleep(2000); //some more time for all rows with images to be populated
|
||||
_.table.ReadTableRowColumnData(2, 0).then(($cellData) => {
|
||||
expect($cellData).to.eq("3"); //asserting serial column is inserting fine in sequence
|
||||
});
|
||||
table.ReadTableRowColumnData(2, 1, "v1", 200).then(($cellData) => {
|
||||
_.table.ReadTableRowColumnData(2, 1, "v1", 200).then(($cellData) => {
|
||||
expect($cellData).to.eq("Maine.jpeg");
|
||||
});
|
||||
table.AssertTableRowImageColumnIsLoaded(2, 2).then(($oldimage) => {
|
||||
table.AssertTableRowImageColumnIsLoaded(2, 3).then(($newimage) => {
|
||||
_.table.AssertTableRowImageColumnIsLoaded(2, 2).then(($oldimage) => {
|
||||
_.table.AssertTableRowImageColumnIsLoaded(2, 3).then(($newimage) => {
|
||||
expect($oldimage).to.eq($newimage);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
it("7. Updating record - binarytype", () => {
|
||||
it("5. Updating record - binarytype", () => {
|
||||
imageNameToUpload = "Datatypes/NewJersey.jpeg";
|
||||
|
||||
table.SelectTableRow(1);
|
||||
agHelper.ClickButton("Run UpdateQuery");
|
||||
agHelper.AssertElementVisible(locator._modal);
|
||||
_.table.SelectTableRow(1);
|
||||
_.agHelper.ClickButton("Run UpdateQuery");
|
||||
_.agHelper.AssertElementVisible(_.locators._modal);
|
||||
|
||||
agHelper.ClickButton("Select update image");
|
||||
agHelper.UploadFile(imageNameToUpload);
|
||||
_.agHelper.ClickButton("Select update image");
|
||||
_.agHelper.UploadFile(imageNameToUpload);
|
||||
|
||||
agHelper.ClickButton("Update");
|
||||
agHelper.AssertElementAbsence(locator._toastMsg); //Assert that Update did not fail
|
||||
agHelper.AssertElementVisible(locator._spanButton("Run UpdateQuery"));
|
||||
agHelper.AssertElementAbsence(locator._spinner, 20000); //for the update row to appear at last
|
||||
table.WaitUntilTableLoad();
|
||||
agHelper.Sleep(10000); //some more time for rows to rearrange!
|
||||
table.ReadTableRowColumnData(2, 0, "v1", 2000).then(($cellData) => {
|
||||
_.agHelper.ClickButton("Update");
|
||||
_.agHelper.AssertElementAbsence(_.locators._toastMsg); //Assert that Update did not fail
|
||||
_.agHelper.AssertElementVisible(_.locators._spanButton("Run UpdateQuery"));
|
||||
_.agHelper.AssertElementAbsence(_.locators._spinner, 20000); //for the update row to appear at last
|
||||
_.table.WaitUntilTableLoad();
|
||||
_.agHelper.Sleep(10000); //some more time for rows to rearrange!
|
||||
_.table.ReadTableRowColumnData(2, 0, "v1", 2000).then(($cellData) => {
|
||||
expect($cellData).to.eq("2"); //asserting serial column is inserting fine in sequence
|
||||
});
|
||||
table.ReadTableRowColumnData(2, 1, "v1", 200).then(($cellData) => {
|
||||
_.table.ReadTableRowColumnData(2, 1, "v1", 200).then(($cellData) => {
|
||||
expect($cellData).to.eq("NewJersey.jpeg");
|
||||
});
|
||||
table.AssertTableRowImageColumnIsLoaded(2, 2).then(($oldimage) => {
|
||||
table.AssertTableRowImageColumnIsLoaded(2, 3).then(($newimage) => {
|
||||
_.table.AssertTableRowImageColumnIsLoaded(2, 2).then(($oldimage) => {
|
||||
_.table.AssertTableRowImageColumnIsLoaded(2, 3).then(($newimage) => {
|
||||
expect($oldimage).to.not.eq($newimage);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
it("8. Validating Binary (bytea) - escape, hex, base64 functions", () => {
|
||||
deployMode.NavigateBacktoEditor();
|
||||
table.WaitUntilTableLoad();
|
||||
ee.ExpandCollapseEntity("Queries/JS");
|
||||
dataSources.NavigateFromActiveDS(dsName, true);
|
||||
agHelper.RenameWithInPane("verifyBinaryFunctions");
|
||||
it("6. Validating Binary (bytea) - escape, hex, base64 functions", () => {
|
||||
_.deployMode.NavigateBacktoEditor();
|
||||
_.table.WaitUntilTableLoad();
|
||||
_.entityExplorer.ExpandCollapseEntity("Queries/JS");
|
||||
_.dataSources.NavigateFromActiveDS(dsName, true);
|
||||
_.agHelper.RenameWithInPane("verifyBinaryFunctions");
|
||||
|
||||
//Validating zero octet
|
||||
query = `select encode('\\000'::bytea, 'hex') as "zero octet Hex", encode('\\000'::bytea, 'escape') as "zero octet Escape";`;
|
||||
agHelper.GetNClick(dataSources._templateMenu);
|
||||
dataSources.EnterQuery(query);
|
||||
dataSources.RunQuery();
|
||||
dataSources.AssertQueryResponseHeaders([
|
||||
_.agHelper.GetNClick(_.dataSources._templateMenu);
|
||||
_.dataSources.EnterQuery(query);
|
||||
_.dataSources.RunQuery();
|
||||
_.dataSources.AssertQueryResponseHeaders([
|
||||
"zero octet Hex",
|
||||
"zero octet Escape",
|
||||
]);
|
||||
dataSources.ReadQueryTableResponse(0).then(($cellData) => {
|
||||
_.dataSources.ReadQueryTableResponse(0).then(($cellData) => {
|
||||
expect($cellData).to.eq("00");
|
||||
});
|
||||
dataSources.ReadQueryTableResponse(1).then(($cellData) => {
|
||||
_.dataSources.ReadQueryTableResponse(1).then(($cellData) => {
|
||||
expect($cellData).to.eq(`\\000`);
|
||||
});
|
||||
|
||||
//Validating single quote
|
||||
query = `select encode(''''::bytea, 'escape') as "single quote Escape1", encode('\\047'::bytea, 'escape') as "single quote Escape2", encode(''''::bytea, 'hex') as "single quote Hex1", encode('\\047'::bytea, 'hex') as "single quote Hex2", encode(''''::bytea, 'base64') as "single quote Base64";`;
|
||||
dataSources.EnterQuery(query);
|
||||
dataSources.RunQuery();
|
||||
dataSources.AssertQueryResponseHeaders([
|
||||
_.dataSources.EnterQuery(query);
|
||||
_.dataSources.RunQuery();
|
||||
_.dataSources.AssertQueryResponseHeaders([
|
||||
"single quote Escape1",
|
||||
"single quote Escape2",
|
||||
"single quote Hex1",
|
||||
"single quote Hex2",
|
||||
"single quote Base64",
|
||||
]);
|
||||
dataSources.ReadQueryTableResponse(0).then(($cellData) => {
|
||||
_.dataSources.ReadQueryTableResponse(0).then(($cellData) => {
|
||||
expect($cellData).to.eq("'");
|
||||
});
|
||||
dataSources.ReadQueryTableResponse(1).then(($cellData) => {
|
||||
_.dataSources.ReadQueryTableResponse(1).then(($cellData) => {
|
||||
expect($cellData).to.eq("'");
|
||||
});
|
||||
dataSources.ReadQueryTableResponse(2).then(($cellData) => {
|
||||
_.dataSources.ReadQueryTableResponse(2).then(($cellData) => {
|
||||
expect($cellData).to.eq("27");
|
||||
});
|
||||
dataSources.ReadQueryTableResponse(3).then(($cellData) => {
|
||||
_.dataSources.ReadQueryTableResponse(3).then(($cellData) => {
|
||||
expect($cellData).to.eq("27");
|
||||
});
|
||||
dataSources.ReadQueryTableResponse(4).then(($cellData) => {
|
||||
_.dataSources.ReadQueryTableResponse(4).then(($cellData) => {
|
||||
expect($cellData).to.eq("Jw==");
|
||||
});
|
||||
|
||||
//Validating backslash
|
||||
query = `select encode('\\\\'::bytea, 'escape') as "backslash Escape1", encode('\\134'::bytea, 'escape') as "backslash Escape2", encode('\\\\'::bytea, 'hex') as "backslash Hex1", encode('\\134'::bytea, 'hex') as "backslash Hex2", encode('\\\\'::bytea, 'base64') as "backslash Base64";`;
|
||||
dataSources.EnterQuery(query);
|
||||
dataSources.RunQuery();
|
||||
dataSources.AssertQueryResponseHeaders([
|
||||
_.dataSources.EnterQuery(query);
|
||||
_.dataSources.RunQuery();
|
||||
_.dataSources.AssertQueryResponseHeaders([
|
||||
"backslash Escape1",
|
||||
"backslash Escape2",
|
||||
"backslash Hex1",
|
||||
"backslash Hex2",
|
||||
"backslash Base64",
|
||||
]);
|
||||
dataSources.ReadQueryTableResponse(0).then(($cellData) => {
|
||||
_.dataSources.ReadQueryTableResponse(0).then(($cellData) => {
|
||||
expect($cellData).to.eq("\\\\");
|
||||
});
|
||||
dataSources.ReadQueryTableResponse(1).then(($cellData) => {
|
||||
_.dataSources.ReadQueryTableResponse(1).then(($cellData) => {
|
||||
expect($cellData).to.eq("\\\\");
|
||||
});
|
||||
dataSources.ReadQueryTableResponse(2).then(($cellData) => {
|
||||
_.dataSources.ReadQueryTableResponse(2).then(($cellData) => {
|
||||
expect($cellData).to.eq("5c");
|
||||
});
|
||||
dataSources.ReadQueryTableResponse(3).then(($cellData) => {
|
||||
_.dataSources.ReadQueryTableResponse(3).then(($cellData) => {
|
||||
expect($cellData).to.eq("5c");
|
||||
});
|
||||
dataSources.ReadQueryTableResponse(4).then(($cellData) => {
|
||||
_.dataSources.ReadQueryTableResponse(4).then(($cellData) => {
|
||||
expect($cellData).to.eq("XA==");
|
||||
});
|
||||
|
||||
//Validating random string
|
||||
query = `select encode('abc \\153\\154\\155 \\052\\251\\124'::bytea::bytea, 'escape') as "string bytea_output Escape", encode('abc \\153\\154\\155 \\052\\251\\124'::bytea::bytea, 'hex') as "string bytea_output Hex", encode('abc \\153\\154\\155 \\052\\251\\124'::bytea::bytea, 'base64') as "string bytea_output Base64";`;
|
||||
dataSources.EnterQuery(query);
|
||||
dataSources.RunQuery();
|
||||
dataSources.AssertQueryResponseHeaders([
|
||||
_.dataSources.EnterQuery(query);
|
||||
_.dataSources.RunQuery();
|
||||
_.dataSources.AssertQueryResponseHeaders([
|
||||
"string bytea_output Escape",
|
||||
"string bytea_output Hex",
|
||||
"string bytea_output Base64",
|
||||
]);
|
||||
dataSources.ReadQueryTableResponse(0).then(($cellData) => {
|
||||
_.dataSources.ReadQueryTableResponse(0).then(($cellData) => {
|
||||
expect($cellData).to.eq(`abc klm *\\251T`);
|
||||
});
|
||||
dataSources.ReadQueryTableResponse(1).then(($cellData) => {
|
||||
_.dataSources.ReadQueryTableResponse(1).then(($cellData) => {
|
||||
expect($cellData).to.eq("616263206b6c6d202aa954");
|
||||
});
|
||||
dataSources.ReadQueryTableResponse(2).then(($cellData) => {
|
||||
_.dataSources.ReadQueryTableResponse(2).then(($cellData) => {
|
||||
expect($cellData).to.eq("YWJjIGtsbSAqqVQ=");
|
||||
});
|
||||
|
||||
//Validating text value1
|
||||
query = `select encode(E'123abc456', 'escape') as "Escape1", encode(E'123abc456', 'hex') as "Hex1", encode('abc456', 'escape') as "Escape2", encode('abc456', 'hex') as "Hex2", encode(E'123\\\\000456'::bytea, 'escape') as "Escape3", encode(E'123\\\\000456'::bytea, 'hex') as "Hex3";`;
|
||||
dataSources.EnterQuery(query);
|
||||
dataSources.RunQuery();
|
||||
dataSources.AssertQueryResponseHeaders([
|
||||
_.dataSources.EnterQuery(query);
|
||||
_.dataSources.RunQuery();
|
||||
_.dataSources.AssertQueryResponseHeaders([
|
||||
"Escape1",
|
||||
"Hex1",
|
||||
"Escape2",
|
||||
|
|
@ -309,125 +281,148 @@ describe("Binary Datatype tests", function () {
|
|||
"Escape3",
|
||||
"Hex3",
|
||||
]);
|
||||
dataSources.ReadQueryTableResponse(0).then(($cellData) => {
|
||||
_.dataSources.ReadQueryTableResponse(0).then(($cellData) => {
|
||||
expect($cellData).to.eq("123abc456");
|
||||
});
|
||||
dataSources.ReadQueryTableResponse(1).then(($cellData) => {
|
||||
_.dataSources.ReadQueryTableResponse(1).then(($cellData) => {
|
||||
expect($cellData).to.eq("313233616263343536");
|
||||
});
|
||||
dataSources.ReadQueryTableResponse(2).then(($cellData) => {
|
||||
_.dataSources.ReadQueryTableResponse(2).then(($cellData) => {
|
||||
expect($cellData).to.eq("abc456");
|
||||
});
|
||||
dataSources.ReadQueryTableResponse(3).then(($cellData) => {
|
||||
_.dataSources.ReadQueryTableResponse(3).then(($cellData) => {
|
||||
expect($cellData).to.eq("616263343536");
|
||||
});
|
||||
dataSources.ReadQueryTableResponse(4).then(($cellData) => {
|
||||
_.dataSources.ReadQueryTableResponse(4).then(($cellData) => {
|
||||
expect($cellData).to.eq(`123\\000456`);
|
||||
});
|
||||
dataSources.ReadQueryTableResponse(5).then(($cellData) => {
|
||||
_.dataSources.ReadQueryTableResponse(5).then(($cellData) => {
|
||||
expect($cellData).to.eq("31323300343536");
|
||||
});
|
||||
|
||||
agHelper.ActionContextMenuWithInPane("Delete");
|
||||
ee.ExpandCollapseEntity("Queries/JS", false);
|
||||
_.agHelper.ActionContextMenuWithInPane("Delete");
|
||||
_.entityExplorer.ExpandCollapseEntity("Queries/JS", false);
|
||||
});
|
||||
|
||||
it("9. Deleting records - binarytype", () => {
|
||||
ee.SelectEntityByName("Page1");
|
||||
deployMode.DeployApp();
|
||||
table.WaitUntilTableLoad();
|
||||
table.SelectTableRow(1);
|
||||
agHelper.ClickButton("DeleteQuery", 1);
|
||||
agHelper.ValidateNetworkStatus("@postExecute", 200);
|
||||
agHelper.ValidateNetworkStatus("@postExecute", 200);
|
||||
agHelper.AssertElementAbsence(locator._spinner, 20000); //Allowing time for delete to be success
|
||||
agHelper.Sleep(6000); //Allwowing time for delete to be success
|
||||
table.ReadTableRowColumnData(1, 0).then(($cellData) => {
|
||||
it("7. Deleting records - binarytype", () => {
|
||||
_.entityExplorer.SelectEntityByName("Page1");
|
||||
_.deployMode.DeployApp();
|
||||
_.table.WaitUntilTableLoad();
|
||||
_.table.SelectTableRow(1);
|
||||
_.agHelper.ClickButton("DeleteQuery", 1);
|
||||
_.agHelper.ValidateNetworkStatus("@postExecute", 200);
|
||||
_.agHelper.ValidateNetworkStatus("@postExecute", 200);
|
||||
_.agHelper.AssertElementAbsence(_.locators._spinner, 20000); //Allowing time for delete to be success
|
||||
_.agHelper.Sleep(6000); //Allwowing time for delete to be success
|
||||
_.table.ReadTableRowColumnData(1, 0).then(($cellData) => {
|
||||
expect($cellData).not.to.eq("3"); //asserting 2nd record is deleted
|
||||
});
|
||||
table.ReadTableRowColumnData(1, 0, "v1", 200).then(($cellData) => {
|
||||
_.table.ReadTableRowColumnData(1, 0, "v1", 200).then(($cellData) => {
|
||||
expect($cellData).to.eq("2");
|
||||
});
|
||||
|
||||
//Deleting all records from .table
|
||||
_.agHelper.GetNClick(_.locators._deleteIcon);
|
||||
_.agHelper.AssertElementVisible(_.locators._spanButton("Run InsertQuery"));
|
||||
_.agHelper.Sleep(2000);
|
||||
_.table.WaitForTableEmpty();
|
||||
});
|
||||
|
||||
it("10. Deleting all records from table - binarytype", () => {
|
||||
agHelper.GetNClick(locator._deleteIcon);
|
||||
agHelper.AssertElementVisible(locator._spanButton("Run InsertQuery"));
|
||||
agHelper.Sleep(2000);
|
||||
table.WaitForTableEmpty();
|
||||
});
|
||||
|
||||
it("11. Inserting another record (to check serial column) - binarytype", () => {
|
||||
it("8. Inserting another record (to check serial column) - binarytype", () => {
|
||||
imageNameToUpload = "Datatypes/Massachusetts.jpeg";
|
||||
|
||||
agHelper.ClickButton("Run InsertQuery");
|
||||
agHelper.AssertElementVisible(locator._modal);
|
||||
_.agHelper.ClickButton("Run InsertQuery");
|
||||
_.agHelper.AssertElementVisible(_.locators._modal);
|
||||
|
||||
//agHelper.EnterInputText("Imagename", "Massachusetts");
|
||||
agHelper.ClickButton("Select New Image");
|
||||
agHelper.UploadFile(imageNameToUpload);
|
||||
//_.agHelper.EnterInputText("Imagename", "Massachusetts");
|
||||
_.agHelper.ClickButton("Select New Image");
|
||||
_.agHelper.UploadFile(imageNameToUpload);
|
||||
|
||||
agHelper.ClickButton("Insert");
|
||||
agHelper.AssertElementAbsence(locator._toastMsg); //Assert that Insert did not fail
|
||||
agHelper.AssertElementVisible(locator._spanButton("Run InsertQuery"));
|
||||
table.WaitUntilTableLoad();
|
||||
agHelper.Sleep(2000); //for all rows with images to be populated
|
||||
table.ReadTableRowColumnData(0, 0, "v1", 2000).then(($cellData) => {
|
||||
_.agHelper.ClickButton("Insert");
|
||||
_.agHelper.AssertElementAbsence(_.locators._toastMsg); //Assert that Insert did not fail
|
||||
_.agHelper.AssertElementVisible(_.locators._spanButton("Run InsertQuery"));
|
||||
_.table.WaitUntilTableLoad();
|
||||
_.agHelper.Sleep(2000); //for all rows with images to be populated
|
||||
_.table.ReadTableRowColumnData(0, 0, "v1", 2000).then(($cellData) => {
|
||||
expect($cellData).to.eq("4"); //asserting serial column is inserting fine in sequence
|
||||
});
|
||||
table.ReadTableRowColumnData(0, 1, "v1", 200).then(($cellData) => {
|
||||
_.table.ReadTableRowColumnData(0, 1, "v1", 200).then(($cellData) => {
|
||||
expect($cellData).to.eq("Massachusetts.jpeg");
|
||||
});
|
||||
table.AssertTableRowImageColumnIsLoaded(0, 2).then(($oldimage) => {
|
||||
table.AssertTableRowImageColumnIsLoaded(0, 3).then(($newimage) => {
|
||||
_.table.AssertTableRowImageColumnIsLoaded(0, 2).then(($oldimage) => {
|
||||
_.table.AssertTableRowImageColumnIsLoaded(0, 3).then(($newimage) => {
|
||||
expect($oldimage).to.eq($newimage);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
it("12. Validate Drop of the Newly Created - binarytype - Table from Postgres datasource", () => {
|
||||
deployMode.NavigateBacktoEditor();
|
||||
ee.ExpandCollapseEntity("Queries/JS");
|
||||
ee.SelectEntityByName("dropTable");
|
||||
dataSources.RunQuery();
|
||||
dataSources.ReadQueryTableResponse(0).then(($cellData) => {
|
||||
expect($cellData).to.eq("0"); //Success response for dropped table!
|
||||
});
|
||||
ee.ExpandCollapseEntity("Queries/JS", false);
|
||||
ee.ExpandCollapseEntity("Datasources");
|
||||
ee.ExpandCollapseEntity(dsName);
|
||||
ee.ActionContextMenuByEntityName(dsName, "Refresh");
|
||||
agHelper.AssertElementAbsence(
|
||||
ee._entityNameInExplorer("public.binarytype"),
|
||||
);
|
||||
ee.ExpandCollapseEntity(dsName, false);
|
||||
ee.ExpandCollapseEntity("Datasources", false);
|
||||
});
|
||||
it("9. Validate Drop of the Newly Created - binarytype - Table from Postgres datasource", () => {});
|
||||
|
||||
it("13. Verify Deletion of all created queries", () => {
|
||||
dataSources.DeleteDatasouceFromWinthinDS(dsName, 409); //Since all queries exists
|
||||
ee.ExpandCollapseEntity("Queries/JS");
|
||||
ee.ActionContextMenuByEntityName("createTable", "Delete", "Are you sure?");
|
||||
ee.ActionContextMenuByEntityName(
|
||||
"deleteAllRecords",
|
||||
"Delete",
|
||||
"Are you sure?",
|
||||
);
|
||||
ee.ActionContextMenuByEntityName("deleteRecord", "Delete", "Are you sure?");
|
||||
ee.ActionContextMenuByEntityName("dropTable", "Delete", "Are you sure?");
|
||||
ee.ActionContextMenuByEntityName("insertRecord", "Delete", "Are you sure?");
|
||||
ee.ActionContextMenuByEntityName(
|
||||
"selectRecords",
|
||||
"Delete",
|
||||
"Are you sure?",
|
||||
);
|
||||
ee.ActionContextMenuByEntityName("updateRecord", "Delete", "Are you sure?");
|
||||
});
|
||||
after(
|
||||
"Validate Drop of the Newly Created - binarytype - Table & Verify Deletion of all created queries",
|
||||
() => {
|
||||
//Drop table
|
||||
_.deployMode.NavigateBacktoEditor();
|
||||
_.entityExplorer.ExpandCollapseEntity("Queries/JS");
|
||||
_.entityExplorer.SelectEntityByName("dropTable");
|
||||
_.dataSources.RunQuery();
|
||||
_.dataSources.ReadQueryTableResponse(0).then(($cellData) => {
|
||||
expect($cellData).to.eq("0"); //Success response for dropped _.table!
|
||||
});
|
||||
_.entityExplorer.ExpandCollapseEntity("Queries/JS", false);
|
||||
_.entityExplorer.ExpandCollapseEntity("Datasources");
|
||||
_.entityExplorer.ExpandCollapseEntity(dsName);
|
||||
_.entityExplorer.ActionContextMenuByEntityName(dsName, "Refresh");
|
||||
_.agHelper.AssertElementAbsence(
|
||||
_.entityExplorer._entityNameInExplorer("public.binarytype"),
|
||||
);
|
||||
_.entityExplorer.ExpandCollapseEntity(dsName, false);
|
||||
_.entityExplorer.ExpandCollapseEntity("Datasources", false);
|
||||
|
||||
it("14. Verify Deletion of datasource", () => {
|
||||
deployMode.DeployApp();
|
||||
deployMode.NavigateBacktoEditor();
|
||||
ee.ExpandCollapseEntity("Queries/JS");
|
||||
dataSources.DeleteDatasouceFromWinthinDS(dsName, 200);
|
||||
});
|
||||
//Delete all queries
|
||||
_.dataSources.DeleteDatasouceFromWinthinDS(dsName, 409); //Since all queries exists
|
||||
_.entityExplorer.ExpandCollapseEntity("Queries/JS");
|
||||
_.entityExplorer.ActionContextMenuByEntityName(
|
||||
"createTable",
|
||||
"Delete",
|
||||
"Are you sure?",
|
||||
);
|
||||
_.entityExplorer.ActionContextMenuByEntityName(
|
||||
"deleteAllRecords",
|
||||
"Delete",
|
||||
"Are you sure?",
|
||||
);
|
||||
_.entityExplorer.ActionContextMenuByEntityName(
|
||||
"deleteRecord",
|
||||
"Delete",
|
||||
"Are you sure?",
|
||||
);
|
||||
_.entityExplorer.ActionContextMenuByEntityName(
|
||||
"dropTable",
|
||||
"Delete",
|
||||
"Are you sure?",
|
||||
);
|
||||
_.entityExplorer.ActionContextMenuByEntityName(
|
||||
"insertRecord",
|
||||
"Delete",
|
||||
"Are you sure?",
|
||||
);
|
||||
_.entityExplorer.ActionContextMenuByEntityName(
|
||||
"selectRecords",
|
||||
"Delete",
|
||||
"Are you sure?",
|
||||
);
|
||||
_.entityExplorer.ActionContextMenuByEntityName(
|
||||
"updateRecord",
|
||||
"Delete",
|
||||
"Are you sure?",
|
||||
);
|
||||
|
||||
//Delete DS
|
||||
_.deployMode.DeployApp();
|
||||
_.deployMode.NavigateBacktoEditor();
|
||||
_.entityExplorer.ExpandCollapseEntity("Queries/JS");
|
||||
_.dataSources.DeleteDatasouceFromWinthinDS(dsName, 200);
|
||||
},
|
||||
);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,297 +1,295 @@
|
|||
import { ObjectsRegistry } from "../../../../support/Objects/Registry";
|
||||
import * as _ from "../../../../support/Objects/ObjectsCore";
|
||||
|
||||
let dsName: any, query: string;
|
||||
const agHelper = ObjectsRegistry.AggregateHelper,
|
||||
ee = ObjectsRegistry.EntityExplorer,
|
||||
dataSources = ObjectsRegistry.DataSources,
|
||||
table = ObjectsRegistry.Table,
|
||||
locator = ObjectsRegistry.CommonLocators,
|
||||
deployMode = ObjectsRegistry.DeployMode,
|
||||
appSettings = ObjectsRegistry.AppSettings;
|
||||
|
||||
describe("Boolean & Enum Datatype tests", function () {
|
||||
before(() => {
|
||||
before("Create Postgress DS, Add dsl, Appply theme", () => {
|
||||
cy.fixture("Datatypes/BooleanEnumDTdsl").then((val: any) => {
|
||||
agHelper.AddDsl(val);
|
||||
_.agHelper.AddDsl(val);
|
||||
});
|
||||
appSettings.OpenPaneAndChangeThemeColors(-18, -20);
|
||||
});
|
||||
|
||||
it("1. Create Postgress DS", function () {
|
||||
dataSources.CreateDataSource("Postgres");
|
||||
_.appSettings.OpenPaneAndChangeThemeColors(-18, -20);
|
||||
_.dataSources.CreateDataSource("Postgres");
|
||||
cy.get("@dsName").then(($dsName) => {
|
||||
dsName = $dsName;
|
||||
});
|
||||
});
|
||||
|
||||
it("2. Creating enum & table queries - boolenumtypes", () => {
|
||||
it("1. Creating enum & table queries - boolenumtypes + Bug 14493", () => {
|
||||
query = `CREATE TYPE weekdays AS ENUM ('Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday');`;
|
||||
dataSources.NavigateFromActiveDS(dsName, true);
|
||||
agHelper.GetNClick(dataSources._templateMenu);
|
||||
agHelper.RenameWithInPane("createEnum");
|
||||
dataSources.EnterQuery(query);
|
||||
dataSources.RunQuery();
|
||||
_.dataSources.CreateQueryAfterDSSaved(query, "createEnum");
|
||||
_.dataSources.RunQuery();
|
||||
|
||||
query = `create table boolenumtypes (serialId SERIAL not null primary key, workingDay weekdays, AreWeWorking boolean)`;
|
||||
ee.CreateNewDsQuery(dsName);
|
||||
agHelper.RenameWithInPane("createTable");
|
||||
agHelper.GetNClick(dataSources._templateMenu);
|
||||
dataSources.EnterQuery(query);
|
||||
dataSources.RunQuery();
|
||||
_.dataSources.CreateQueryFromOverlay(dsName, query, "createTable");
|
||||
_.dataSources.RunQuery();
|
||||
|
||||
ee.ExpandCollapseEntity("Datasources");
|
||||
ee.ExpandCollapseEntity(dsName); //Clicking Create Query from Active DS is already expanding ds
|
||||
ee.ActionContextMenuByEntityName(dsName, "Refresh");
|
||||
agHelper.AssertElementVisible(
|
||||
ee._entityNameInExplorer("public.boolenumtypes"),
|
||||
_.entityExplorer.ExpandCollapseEntity("Datasources");
|
||||
_.entityExplorer.ExpandCollapseEntity(dsName); //Clicking Create Query from Active DS is already expanding ds
|
||||
_.entityExplorer.ActionContextMenuByEntityName(dsName, "Refresh");
|
||||
_.agHelper.AssertElementVisible(
|
||||
_.entityExplorer._entityNameInExplorer("public.boolenumtypes"),
|
||||
);
|
||||
});
|
||||
|
||||
it("3. Creating SELECT query - boolenumtypes + Bug 14493", () => {
|
||||
ee.ActionTemplateMenuByEntityName("public.boolenumtypes", "SELECT");
|
||||
agHelper.RenameWithInPane("selectRecords");
|
||||
dataSources.RunQuery();
|
||||
agHelper
|
||||
.GetText(dataSources._noRecordFound)
|
||||
//Select query:
|
||||
_.entityExplorer.ActionTemplateMenuByEntityName(
|
||||
"public.boolenumtypes",
|
||||
"SELECT",
|
||||
);
|
||||
_.agHelper.RenameWithInPane("selectRecords");
|
||||
_.dataSources.RunQuery();
|
||||
_.agHelper
|
||||
.GetText(_.dataSources._noRecordFound)
|
||||
.then(($noRecMsg) => expect($noRecMsg).to.eq("No data records to show"));
|
||||
});
|
||||
|
||||
it("4. Creating all queries - boolenumtypes", () => {
|
||||
//Other queries
|
||||
query = `INSERT INTO public."boolenumtypes" ("workingday", "areweworking") VALUES ({{Insertworkingday.selectedOptionValue}}, {{Insertareweworking.isSwitchedOn}})`;
|
||||
ee.CreateNewDsQuery(dsName);
|
||||
agHelper.RenameWithInPane("insertRecord");
|
||||
agHelper.GetNClick(dataSources._templateMenu);
|
||||
dataSources.EnterQuery(query);
|
||||
_.dataSources.CreateQueryFromOverlay(dsName, query, "insertRecord");
|
||||
|
||||
query = `UPDATE public."boolenumtypes" SET "workingday" = {{Updateworkingday.selectedOptionValue}}, "areweworking" = {{Updateareweworking.isSwitchedOn}} WHERE serialid = {{Table1.selectedRow.serialid}};`;
|
||||
ee.CreateNewDsQuery(dsName);
|
||||
agHelper.RenameWithInPane("updateRecord");
|
||||
agHelper.GetNClick(dataSources._templateMenu);
|
||||
dataSources.EnterQuery(query);
|
||||
_.dataSources.CreateQueryFromOverlay(dsName, query, "updateRecord");
|
||||
|
||||
query = `SELECT * from enum_range(NULL::weekdays)`;
|
||||
ee.CreateNewDsQuery(dsName);
|
||||
agHelper.RenameWithInPane("getEnum");
|
||||
agHelper.GetNClick(dataSources._templateMenu);
|
||||
dataSources.EnterQuery(query);
|
||||
_.dataSources.CreateQueryFromOverlay(dsName, query, "getEnum");
|
||||
|
||||
query = `DELETE FROM public."boolenumtypes" WHERE serialId ={{Table1.selectedRow.serialid}}`;
|
||||
ee.CreateNewDsQuery(dsName);
|
||||
agHelper.RenameWithInPane("deleteRecord");
|
||||
agHelper.GetNClick(dataSources._templateMenu);
|
||||
dataSources.EnterQuery(query);
|
||||
_.dataSources.CreateQueryFromOverlay(dsName, query, "deleteRecord");
|
||||
|
||||
query = `DELETE FROM public."boolenumtypes"`;
|
||||
ee.CreateNewDsQuery(dsName);
|
||||
agHelper.RenameWithInPane("deleteAllRecords");
|
||||
agHelper.GetNClick(dataSources._templateMenu);
|
||||
dataSources.EnterQuery(query);
|
||||
_.dataSources.CreateQueryFromOverlay(dsName, query, "deleteAllRecords");
|
||||
|
||||
query = `drop table public."boolenumtypes"`;
|
||||
ee.CreateNewDsQuery(dsName);
|
||||
agHelper.RenameWithInPane("dropTable");
|
||||
agHelper.GetNClick(dataSources._templateMenu);
|
||||
dataSources.EnterQuery(query);
|
||||
query = `DROP table public."boolenumtypes"`;
|
||||
_.dataSources.CreateQueryFromOverlay(dsName, query, "dropTable");
|
||||
|
||||
query = `drop type weekdays`;
|
||||
ee.CreateNewDsQuery(dsName);
|
||||
agHelper.RenameWithInPane("dropEnum");
|
||||
agHelper.GetNClick(dataSources._templateMenu);
|
||||
dataSources.EnterQuery(query);
|
||||
_.dataSources.CreateQueryFromOverlay(dsName, query, "dropEnum");
|
||||
|
||||
ee.ExpandCollapseEntity("Queries/JS", false);
|
||||
ee.ExpandCollapseEntity(dsName, false);
|
||||
_.entityExplorer.ExpandCollapseEntity("Queries/JS", false);
|
||||
_.entityExplorer.ExpandCollapseEntity(dsName, false);
|
||||
});
|
||||
|
||||
it("5. Inserting record - boolenumtypes", () => {
|
||||
ee.SelectEntityByName("Page1");
|
||||
deployMode.DeployApp();
|
||||
table.WaitForTableEmpty(); //asserting table is empty before inserting!
|
||||
agHelper.ClickButton("Run InsertQuery");
|
||||
agHelper.AssertElementVisible(locator._modal);
|
||||
agHelper.SelectDropDown("Monday");
|
||||
agHelper.ToggleSwitch("Areweworking");
|
||||
agHelper.ClickButton("Insert");
|
||||
agHelper.AssertElementAbsence(locator._toastMsg); //Assert that Insert did not fail
|
||||
agHelper.AssertElementVisible(locator._spanButton("Run InsertQuery"));
|
||||
table.ReadTableRowColumnData(0, 0, "v1", 2000).then(($cellData) => {
|
||||
it("2. Inserting record - boolenumtypes", () => {
|
||||
_.entityExplorer.SelectEntityByName("Page1");
|
||||
_.deployMode.DeployApp();
|
||||
_.table.WaitForTableEmpty(); //asserting _.table is empty before inserting!
|
||||
_.agHelper.ClickButton("Run InsertQuery");
|
||||
_.agHelper.AssertElementVisible(_.locators._modal);
|
||||
_.agHelper.SelectDropDown("Monday");
|
||||
_.agHelper.ToggleSwitch("Areweworking");
|
||||
_.agHelper.ClickButton("Insert");
|
||||
_.agHelper.AssertElementAbsence(_.locators._toastMsg); //Assert that Insert did not fail
|
||||
_.agHelper.AssertElementVisible(_.locators._spanButton("Run InsertQuery"));
|
||||
_.table.ReadTableRowColumnData(0, 0, "v1", 2000).then(($cellData) => {
|
||||
expect($cellData).to.eq("1"); //asserting serial column is inserting fine in sequence
|
||||
});
|
||||
table.ReadTableRowColumnData(0, 1, "v1", 200).then(($cellData) => {
|
||||
_.table.ReadTableRowColumnData(0, 1, "v1", 200).then(($cellData) => {
|
||||
expect($cellData).to.eq("Monday");
|
||||
});
|
||||
table.ReadTableRowColumnData(0, 2, "v1", 200).then(($cellData) => {
|
||||
_.table.ReadTableRowColumnData(0, 2, "v1", 200).then(($cellData) => {
|
||||
expect($cellData).to.eq("true");
|
||||
});
|
||||
});
|
||||
|
||||
it("6. Inserting another record - boolenumtypes", () => {
|
||||
agHelper.ClickButton("Run InsertQuery");
|
||||
agHelper.AssertElementVisible(locator._modal);
|
||||
agHelper.SelectDropDown("Saturday");
|
||||
agHelper.ToggleSwitch("Areweworking", "uncheck");
|
||||
agHelper.ClickButton("Insert");
|
||||
agHelper.AssertElementVisible(locator._spanButton("Run InsertQuery"));
|
||||
table.ReadTableRowColumnData(1, 0, "v1", 2000).then(($cellData) => {
|
||||
it("3. Inserting another record - boolenumtypes", () => {
|
||||
_.agHelper.ClickButton("Run InsertQuery");
|
||||
_.agHelper.AssertElementVisible(_.locators._modal);
|
||||
_.agHelper.SelectDropDown("Saturday");
|
||||
_.agHelper.ToggleSwitch("Areweworking", "uncheck");
|
||||
_.agHelper.ClickButton("Insert");
|
||||
_.agHelper.AssertElementVisible(_.locators._spanButton("Run InsertQuery"));
|
||||
_.table.ReadTableRowColumnData(1, 0, "v1", 2000).then(($cellData) => {
|
||||
expect($cellData).to.eq("2"); //asserting serial column is inserting fine in sequence
|
||||
});
|
||||
table.ReadTableRowColumnData(1, 1, "v1", 200).then(($cellData) => {
|
||||
_.table.ReadTableRowColumnData(1, 1, "v1", 200).then(($cellData) => {
|
||||
expect($cellData).to.eq("Saturday");
|
||||
});
|
||||
table.ReadTableRowColumnData(1, 2, "v1", 200).then(($cellData) => {
|
||||
_.table.ReadTableRowColumnData(1, 2, "v1", 200).then(($cellData) => {
|
||||
expect($cellData).to.eq("false");
|
||||
});
|
||||
});
|
||||
|
||||
it("7. Inserting another record - boolenumtypes", () => {
|
||||
agHelper.ClickButton("Run InsertQuery");
|
||||
agHelper.AssertElementVisible(locator._modal);
|
||||
agHelper.SelectDropDown("Friday");
|
||||
agHelper.ToggleSwitch("Areweworking", "uncheck");
|
||||
agHelper.ClickButton("Insert");
|
||||
agHelper.AssertElementVisible(locator._spanButton("Run InsertQuery"));
|
||||
table.ReadTableRowColumnData(2, 0, "v1", 2000).then(($cellData) => {
|
||||
it("4. Inserting another record - boolenumtypes", () => {
|
||||
_.agHelper.ClickButton("Run InsertQuery");
|
||||
_.agHelper.AssertElementVisible(_.locators._modal);
|
||||
_.agHelper.SelectDropDown("Friday");
|
||||
_.agHelper.ToggleSwitch("Areweworking", "uncheck");
|
||||
_.agHelper.ClickButton("Insert");
|
||||
_.agHelper.AssertElementVisible(_.locators._spanButton("Run InsertQuery"));
|
||||
_.table.ReadTableRowColumnData(2, 0, "v1", 2000).then(($cellData) => {
|
||||
expect($cellData).to.eq("3"); //asserting serial column is inserting fine in sequence
|
||||
});
|
||||
table.ReadTableRowColumnData(2, 1, "v1", 200).then(($cellData) => {
|
||||
_.table.ReadTableRowColumnData(2, 1, "v1", 200).then(($cellData) => {
|
||||
expect($cellData).to.eq("Friday");
|
||||
});
|
||||
table.ReadTableRowColumnData(2, 2, "v1", 200).then(($cellData) => {
|
||||
_.table.ReadTableRowColumnData(2, 2, "v1", 200).then(($cellData) => {
|
||||
expect($cellData).to.eq("false");
|
||||
});
|
||||
});
|
||||
|
||||
it("8. Updating record - boolenumtypes", () => {
|
||||
table.SelectTableRow(2);
|
||||
agHelper.ClickButton("Run UpdateQuery");
|
||||
agHelper.AssertElementVisible(locator._modal);
|
||||
agHelper.ToggleSwitch("Areweworking", "check");
|
||||
agHelper.ClickButton("Update");
|
||||
agHelper.AssertElementAbsence(locator._toastMsg); //Assert that Update did not fail
|
||||
agHelper.AssertElementVisible(locator._spanButton("Run UpdateQuery"));
|
||||
table.ReadTableRowColumnData(2, 0, "v1", 2000).then(($cellData) => {
|
||||
it("5. Updating record - boolenumtypes", () => {
|
||||
_.table.SelectTableRow(2);
|
||||
_.agHelper.ClickButton("Run UpdateQuery");
|
||||
_.agHelper.AssertElementVisible(_.locators._modal);
|
||||
_.agHelper.ToggleSwitch("Areweworking", "check");
|
||||
_.agHelper.ClickButton("Update");
|
||||
_.agHelper.AssertElementAbsence(_.locators._toastMsg); //Assert that Update did not fail
|
||||
_.agHelper.AssertElementVisible(_.locators._spanButton("Run UpdateQuery"));
|
||||
_.table.ReadTableRowColumnData(2, 0, "v1", 2000).then(($cellData) => {
|
||||
expect($cellData).to.eq("3"); //asserting serial column is inserting fine in sequence
|
||||
});
|
||||
table.ReadTableRowColumnData(2, 1, "v1", 200).then(($cellData) => {
|
||||
_.table.ReadTableRowColumnData(2, 1, "v1", 200).then(($cellData) => {
|
||||
expect($cellData).to.eq("Friday");
|
||||
});
|
||||
table.ReadTableRowColumnData(2, 2, "v1", 200).then(($cellData) => {
|
||||
_.table.ReadTableRowColumnData(2, 2, "v1", 200).then(($cellData) => {
|
||||
expect($cellData).to.eq("true");
|
||||
});
|
||||
});
|
||||
|
||||
it("9. Validating Enum Ordering", () => {
|
||||
deployMode.NavigateBacktoEditor();
|
||||
table.WaitUntilTableLoad();
|
||||
it("6. Validating Enum Ordering", () => {
|
||||
_.deployMode.NavigateBacktoEditor();
|
||||
_.table.WaitUntilTableLoad();
|
||||
query = `SELECT * FROM boolenumtypes WHERE workingday > 'Tuesday';`;
|
||||
ee.ExpandCollapseEntity("Queries/JS");
|
||||
ee.CreateNewDsQuery(dsName);
|
||||
agHelper.RenameWithInPane("verifyEnumOrdering");
|
||||
agHelper.GetNClick(dataSources._templateMenu);
|
||||
dataSources.EnterQuery(query);
|
||||
dataSources.RunQuery();
|
||||
dataSources.ReadQueryTableResponse(1).then(($cellData) => {
|
||||
_.entityExplorer.ExpandCollapseEntity("Queries/JS");
|
||||
_.entityExplorer.CreateNewDsQuery(dsName);
|
||||
_.agHelper.RenameWithInPane("verifyEnumOrdering");
|
||||
_.agHelper.GetNClick(_.dataSources._templateMenu);
|
||||
_.dataSources.EnterQuery(query);
|
||||
_.dataSources.RunQuery();
|
||||
_.dataSources.ReadQueryTableResponse(1).then(($cellData) => {
|
||||
expect($cellData).to.eq("Saturday");
|
||||
});
|
||||
dataSources.ReadQueryTableResponse(4).then(($cellData) => {
|
||||
_.dataSources.ReadQueryTableResponse(4).then(($cellData) => {
|
||||
expect($cellData).to.eq("Friday");
|
||||
});
|
||||
|
||||
query = `SELECT * FROM boolenumtypes WHERE workingday = (SELECT MIN(workingday) FROM boolenumtypes);`;
|
||||
dataSources.EnterQuery(query);
|
||||
dataSources.RunQuery();
|
||||
dataSources.ReadQueryTableResponse(1).then(($cellData) => {
|
||||
_.dataSources.EnterQuery(query);
|
||||
_.dataSources.RunQuery();
|
||||
_.dataSources.ReadQueryTableResponse(1).then(($cellData) => {
|
||||
expect($cellData).to.eq("Monday");
|
||||
});
|
||||
agHelper.ActionContextMenuWithInPane("Delete");
|
||||
ee.ExpandCollapseEntity("Queries/JS", false);
|
||||
_.agHelper.ActionContextMenuWithInPane("Delete");
|
||||
_.entityExplorer.ExpandCollapseEntity("Queries/JS", false);
|
||||
});
|
||||
|
||||
it("10. Deleting records - boolenumtypes", () => {
|
||||
ee.SelectEntityByName("Page1");
|
||||
deployMode.DeployApp();
|
||||
table.WaitUntilTableLoad();
|
||||
table.SelectTableRow(1);
|
||||
agHelper.ClickButton("DeleteQuery", 1);
|
||||
agHelper.ValidateNetworkStatus("@postExecute", 200);
|
||||
agHelper.ValidateNetworkStatus("@postExecute", 200);
|
||||
agHelper.Sleep(2500); //Allwowing time for delete to be success
|
||||
table.ReadTableRowColumnData(1, 0, "v1", 2000).then(($cellData) => {
|
||||
it("7. Deleting records - boolenumtypes", () => {
|
||||
_.entityExplorer.SelectEntityByName("Page1");
|
||||
_.deployMode.DeployApp();
|
||||
_.table.WaitUntilTableLoad();
|
||||
_.table.SelectTableRow(1);
|
||||
_.agHelper.ClickButton("DeleteQuery", 1);
|
||||
_.agHelper.ValidateNetworkStatus("@postExecute", 200);
|
||||
_.agHelper.ValidateNetworkStatus("@postExecute", 200);
|
||||
_.agHelper.Sleep(2500); //Allwowing time for delete to be success
|
||||
_.table.ReadTableRowColumnData(1, 0, "v1", 2000).then(($cellData) => {
|
||||
expect($cellData).not.to.eq("2"); //asserting 2nd record is deleted
|
||||
});
|
||||
table.ReadTableRowColumnData(1, 0, "v1", 200).then(($cellData) => {
|
||||
_.table.ReadTableRowColumnData(1, 0, "v1", 200).then(($cellData) => {
|
||||
expect($cellData).to.eq("3");
|
||||
});
|
||||
|
||||
//Deleting all records from table
|
||||
_.agHelper.GetNClick(_.locators._deleteIcon);
|
||||
_.agHelper.AssertElementVisible(_.locators._spanButton("Run InsertQuery"));
|
||||
_.agHelper.Sleep(2000);
|
||||
_.table.WaitForTableEmpty();
|
||||
});
|
||||
|
||||
it("11. Deleting all records from table - boolenumtypes", () => {
|
||||
agHelper.GetNClick(locator._deleteIcon);
|
||||
agHelper.AssertElementVisible(locator._spanButton("Run InsertQuery"));
|
||||
agHelper.Sleep(2000);
|
||||
table.WaitForTableEmpty();
|
||||
});
|
||||
|
||||
it("12. Inserting another record (to check serial column) - boolenumtypes", () => {
|
||||
agHelper.ClickButton("Run InsertQuery");
|
||||
agHelper.AssertElementVisible(locator._modal);
|
||||
agHelper.SelectDropDown("Wednesday");
|
||||
agHelper.ToggleSwitch("Areweworking", "check");
|
||||
agHelper.ClickButton("Insert");
|
||||
agHelper.AssertElementVisible(locator._spanButton("Run InsertQuery"));
|
||||
table.ReadTableRowColumnData(0, 0, "v1", 2000).then(($cellData) => {
|
||||
it("8. Inserting another record (to check serial column) - boolenumtypes", () => {
|
||||
_.agHelper.ClickButton("Run InsertQuery");
|
||||
_.agHelper.AssertElementVisible(_.locators._modal);
|
||||
_.agHelper.SelectDropDown("Wednesday");
|
||||
_.agHelper.ToggleSwitch("Areweworking", "check");
|
||||
_.agHelper.ClickButton("Insert");
|
||||
_.agHelper.AssertElementVisible(_.locators._spanButton("Run InsertQuery"));
|
||||
_.table.ReadTableRowColumnData(0, 0, "v1", 2000).then(($cellData) => {
|
||||
expect($cellData).to.eq("4"); //asserting serial column is inserting fine in sequence
|
||||
});
|
||||
table.ReadTableRowColumnData(0, 1, "v1", 200).then(($cellData) => {
|
||||
_.table.ReadTableRowColumnData(0, 1, "v1", 200).then(($cellData) => {
|
||||
expect($cellData).to.eq("Wednesday");
|
||||
});
|
||||
table.ReadTableRowColumnData(0, 2, "v1", 200).then(($cellData) => {
|
||||
_.table.ReadTableRowColumnData(0, 2, "v1", 200).then(($cellData) => {
|
||||
expect($cellData).to.eq("true");
|
||||
});
|
||||
});
|
||||
|
||||
it("13. Validate Drop of the Newly Created - boolenumtypes - Table from Postgres datasource", () => {
|
||||
deployMode.NavigateBacktoEditor();
|
||||
ee.ExpandCollapseEntity("Queries/JS");
|
||||
ee.SelectEntityByName("dropTable");
|
||||
dataSources.RunQuery();
|
||||
dataSources.ReadQueryTableResponse(0).then(($cellData) => {
|
||||
expect($cellData).to.eq("0"); //Success response for dropped table!
|
||||
});
|
||||
ee.ExpandCollapseEntity("Queries/JS", false);
|
||||
ee.ExpandCollapseEntity("Datasources");
|
||||
ee.ExpandCollapseEntity(dsName);
|
||||
ee.ActionContextMenuByEntityName(dsName, "Refresh");
|
||||
agHelper.AssertElementAbsence(
|
||||
ee._entityNameInExplorer("public.boolenumtypes"),
|
||||
);
|
||||
ee.ExpandCollapseEntity(dsName, false);
|
||||
ee.ExpandCollapseEntity("Datasources", false);
|
||||
});
|
||||
after("Verify Deletion of the datasource after all created queries are Deleted", () => {
|
||||
//Drop table:
|
||||
|
||||
it("14. Verify Deletion of the datasource after all created queries are Deleted", () => {
|
||||
dataSources.DeleteDatasouceFromWinthinDS(dsName, 409); //Since all queries exists
|
||||
ee.ExpandCollapseEntity("Queries/JS");
|
||||
ee.ActionContextMenuByEntityName("createEnum", "Delete", "Are you sure?");
|
||||
ee.ActionContextMenuByEntityName("createTable", "Delete", "Are you sure?");
|
||||
ee.ActionContextMenuByEntityName(
|
||||
_.deployMode.NavigateBacktoEditor();
|
||||
_.entityExplorer.ExpandCollapseEntity("Queries/JS");
|
||||
_.entityExplorer.SelectEntityByName("dropTable");
|
||||
_.dataSources.RunQuery();
|
||||
_.dataSources.ReadQueryTableResponse(0).then(($cellData) => {
|
||||
expect($cellData).to.eq("0"); //Success response for dropped _.table!
|
||||
});
|
||||
_.entityExplorer.ExpandCollapseEntity("Queries/JS", false);
|
||||
_.entityExplorer.ExpandCollapseEntity("Datasources");
|
||||
_.entityExplorer.ExpandCollapseEntity(dsName);
|
||||
_.entityExplorer.ActionContextMenuByEntityName(dsName, "Refresh");
|
||||
_.agHelper.AssertElementAbsence(
|
||||
_.entityExplorer._entityNameInExplorer("public.boolenumtypes"),
|
||||
);
|
||||
_.entityExplorer.ExpandCollapseEntity(dsName, false);
|
||||
_.entityExplorer.ExpandCollapseEntity("Datasources", false);
|
||||
|
||||
//Delete queries
|
||||
_.dataSources.DeleteDatasouceFromWinthinDS(dsName, 409); //Since all queries exists
|
||||
_.entityExplorer.ExpandCollapseEntity("Queries/JS");
|
||||
_.entityExplorer.ActionContextMenuByEntityName(
|
||||
"createEnum",
|
||||
"Delete",
|
||||
"Are you sure?",
|
||||
);
|
||||
_.entityExplorer.ActionContextMenuByEntityName(
|
||||
"createTable",
|
||||
"Delete",
|
||||
"Are you sure?",
|
||||
);
|
||||
_.entityExplorer.ActionContextMenuByEntityName(
|
||||
"deleteAllRecords",
|
||||
"Delete",
|
||||
"Are you sure?",
|
||||
);
|
||||
ee.ActionContextMenuByEntityName("deleteRecord", "Delete", "Are you sure?");
|
||||
ee.ActionContextMenuByEntityName("dropTable", "Delete", "Are you sure?");
|
||||
ee.ActionContextMenuByEntityName("dropEnum", "Delete", "Are you sure?");
|
||||
ee.ActionContextMenuByEntityName("getEnum", "Delete", "Are you sure?");
|
||||
ee.ActionContextMenuByEntityName("insertRecord", "Delete", "Are you sure?");
|
||||
ee.ActionContextMenuByEntityName(
|
||||
_.entityExplorer.ActionContextMenuByEntityName(
|
||||
"deleteRecord",
|
||||
"Delete",
|
||||
"Are you sure?",
|
||||
);
|
||||
_.entityExplorer.ActionContextMenuByEntityName(
|
||||
"dropTable",
|
||||
"Delete",
|
||||
"Are you sure?",
|
||||
);
|
||||
_.entityExplorer.ActionContextMenuByEntityName(
|
||||
"dropEnum",
|
||||
"Delete",
|
||||
"Are you sure?",
|
||||
);
|
||||
_.entityExplorer.ActionContextMenuByEntityName(
|
||||
"getEnum",
|
||||
"Delete",
|
||||
"Are you sure?",
|
||||
);
|
||||
_.entityExplorer.ActionContextMenuByEntityName(
|
||||
"insertRecord",
|
||||
"Delete",
|
||||
"Are you sure?",
|
||||
);
|
||||
_.entityExplorer.ActionContextMenuByEntityName(
|
||||
"selectRecords",
|
||||
"Delete",
|
||||
"Are you sure?",
|
||||
);
|
||||
ee.ActionContextMenuByEntityName("updateRecord", "Delete", "Are you sure?");
|
||||
deployMode.DeployApp();
|
||||
deployMode.NavigateBacktoEditor();
|
||||
ee.ExpandCollapseEntity("Queries/JS");
|
||||
dataSources.DeleteDatasouceFromWinthinDS(dsName, 200);
|
||||
_.entityExplorer.ActionContextMenuByEntityName(
|
||||
"updateRecord",
|
||||
"Delete",
|
||||
"Are you sure?",
|
||||
);
|
||||
|
||||
//Delete ds
|
||||
_.deployMode.DeployApp();
|
||||
_.deployMode.NavigateBacktoEditor();
|
||||
_.entityExplorer.ExpandCollapseEntity("Queries/JS");
|
||||
_.dataSources.DeleteDatasouceFromWinthinDS(dsName, 200);
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -416,9 +416,9 @@ describe("Create a query with a mongo datasource, run, save and then delete the
|
|||
"Insert Document(s)",
|
||||
);
|
||||
|
||||
let nonAsciiDoc = `[{"_id":1, "Från" :"Raksha" , "Frõ" :"Active", "Leverantör":"De Bolster", "Frö":"Basilika - Thai 'Siam Qu_.entityExplorern'"},
|
||||
{"_id":2, "Från" :"Vivek" , "Frõ" :"Active", "Leverantör":"De Bolster", "Frö":"Sallad - Oakleaf 'Salad Bowl'"},
|
||||
{"_id":3, "Från" :"Prapulla" , "Frõ" :"Active", "Leverantör":"De Bolster", "Frö":"Sallad - Oakleaf 'Red Salad Bowl'"}]`;
|
||||
let nonAsciiDoc = `[{"_id":1, "Från" :"Alen" , "Frõ" :"Active", "Leverantör":"De Bolster", "Frö":"Basilika - Thai 'Siam Qu_.entityExplorern'"},
|
||||
{"_id":2, "Från" :"Joann" , "Frõ" :"Active", "Leverantör":"De Bolster", "Frö":"Sallad - Oakleaf 'Salad Bowl'"},
|
||||
{"_id":3, "Från" :"Olivia" , "Frõ" :"Active", "Leverantör":"De Bolster", "Frö":"Sallad - Oakleaf 'Red Salad Bowl'"}]`;
|
||||
|
||||
_.agHelper.EnterValue("NonAsciiTest", {
|
||||
propFieldName: "",
|
||||
|
|
@ -580,7 +580,8 @@ describe("Create a query with a mongo datasource, run, save and then delete the
|
|||
"Raw",
|
||||
);
|
||||
cy.typeValueNValidate('{"drop": "NonAsciiTest"}', formControls.rawBody);
|
||||
_.dataSources.RunQuery();
|
||||
cy.wait(1000); //Waiting a bit before runing the command
|
||||
_.dataSources.RunQuery(true, true, 2000);
|
||||
cy.CheckAndUnfoldEntityItem("Datasources");
|
||||
cy.get("@dSName").then((dbName) => {
|
||||
cy.actionContextMenuByEntityName(dbName, "Refresh");
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ export const WIDGET = {
|
|||
RATING: "ratewidget",
|
||||
CHECKBOXGROUP: "checkboxgroupwidget",
|
||||
CHECKBOX: "checkboxwidget",
|
||||
CHART: "chartwidget",
|
||||
AUDIO: "audiowidget",
|
||||
AUDIORECORDER: "audiorecorderwidget",
|
||||
PHONEINPUT: "phoneinputwidget",
|
||||
|
|
|
|||
|
|
@ -1,13 +1,22 @@
|
|||
import datasourceFormData from "../../fixtures/datasources.json";
|
||||
import { ObjectsRegistry } from "../Objects/Registry";
|
||||
import { WIDGET } from "../../locators/WidgetLocators";
|
||||
|
||||
const DataSourceKVP = {
|
||||
Postgres: "PostgreSQL",
|
||||
Mongo: "MongoDB",
|
||||
MySql: "MySQL",
|
||||
UnAuthenticatedGraphQL: "GraphQL API",
|
||||
MsSql: "Microsoft SQL Server",
|
||||
}; //DataSources KeyValuePair
|
||||
|
||||
export enum Widgets {
|
||||
Dropdown,
|
||||
Table,
|
||||
Chart,
|
||||
Text,
|
||||
}
|
||||
|
||||
export class DataSources {
|
||||
private agHelper = ObjectsRegistry.AggregateHelper;
|
||||
private table = ObjectsRegistry.Table;
|
||||
|
|
@ -125,7 +134,8 @@ export class DataSources {
|
|||
_getStructureReq = "/api/v1/datasources/*/structure?ignoreCache=true";
|
||||
_editDatasourceFromActiveTab = (dsName: string) =>
|
||||
".t--datasource-name:contains('" + dsName + "')";
|
||||
public _urlInputControl = "input[name='url']";
|
||||
private _suggestedWidget = (widgetType: string) =>
|
||||
".t--suggested-widget-" + widgetType + "";
|
||||
|
||||
// Authenticated API locators
|
||||
private _authApiDatasource = ".t--createAuthApiDatasource";
|
||||
|
|
@ -147,13 +157,11 @@ export class DataSources {
|
|||
public _datasourceModalSave = ".t--datasource-modal-save";
|
||||
public _datasourceModalDoNotSave = ".t--datasource-modal-do-not-save";
|
||||
public _deleteDatasourceButton = ".t--delete-datasource";
|
||||
public _urlInputControl = "input[name='url']";
|
||||
|
||||
public AssertViewMode() {
|
||||
this.agHelper.AssertElementExist(this._editButton);
|
||||
}
|
||||
|
||||
public AssertEditMode() {
|
||||
this.agHelper.AssertElementAbsence(this._editButton);
|
||||
public AssertDSEditViewMode(mode: "Edit" | "View") {
|
||||
if (mode == "Edit") this.agHelper.AssertElementAbsence(this._editButton);
|
||||
else if (mode == "View") this.agHelper.AssertElementExist(this._editButton);
|
||||
}
|
||||
|
||||
public GeneratePageWithMockDB() {
|
||||
|
|
@ -375,6 +383,31 @@ export class DataSources {
|
|||
cy.get(this._password).type(datasourceFormData["mysql-password"]);
|
||||
}
|
||||
|
||||
public FillMsSqlDSForm() {
|
||||
this.agHelper.UpdateInputValue(
|
||||
this._host,
|
||||
datasourceFormData["mssql-host"],
|
||||
);
|
||||
this.agHelper.UpdateInputValue(
|
||||
this._port,
|
||||
datasourceFormData["mssql-port"].toString(),
|
||||
);
|
||||
this.agHelper.ClearTextField(this._databaseName);
|
||||
// this.agHelper.UpdateInputValue(
|
||||
// this._databaseName,
|
||||
// datasourceFormData["mssql-databaseName"],
|
||||
// ); //Commenting until MsSQL is init loaded into container
|
||||
this.ExpandSectionByName(this._sectionAuthentication);
|
||||
this.agHelper.UpdateInputValue(
|
||||
this._username,
|
||||
datasourceFormData["mssql-username"],
|
||||
);
|
||||
this.agHelper.UpdateInputValue(
|
||||
this._password,
|
||||
datasourceFormData["mssql-password"],
|
||||
);
|
||||
}
|
||||
|
||||
public FillFirestoreDSForm() {
|
||||
cy.xpath(this.locator._inputFieldByName("Database URL") + "//input").type(
|
||||
datasourceFormData["database-url"],
|
||||
|
|
@ -684,7 +717,7 @@ export class DataSources {
|
|||
}
|
||||
|
||||
public CreateDataSource(
|
||||
dsType: "Postgres" | "Mongo" | "MySql" | "UnAuthenticatedGraphQL",
|
||||
dsType: "Postgres" | "Mongo" | "MySql" | "UnAuthenticatedGraphQL" | "MsSql",
|
||||
navigateToCreateNewDs = true,
|
||||
testNSave = true,
|
||||
) {
|
||||
|
|
@ -702,6 +735,8 @@ export class DataSources {
|
|||
if (DataSourceKVP[dsType] == "PostgreSQL") this.FillPostgresDSForm();
|
||||
else if (DataSourceKVP[dsType] == "MySQL") this.FillMySqlDSForm();
|
||||
else if (DataSourceKVP[dsType] == "MongoDB") this.FillMongoDSForm();
|
||||
else if (DataSourceKVP[dsType] == "Microsoft SQL Server")
|
||||
this.FillMsSqlDSForm();
|
||||
|
||||
if (testNSave) {
|
||||
this.TestSaveDatasource();
|
||||
|
|
@ -854,8 +889,10 @@ export class DataSources {
|
|||
}
|
||||
|
||||
public FillAuthAPIUrl() {
|
||||
const URL = datasourceFormData["authenticatedApiUrl"];
|
||||
this.agHelper.TypeText(this._urlInputControl, URL);
|
||||
this.agHelper.UpdateInput(
|
||||
this.locator._inputFieldByName("URL"),
|
||||
datasourceFormData.authenticatedApiUrl,
|
||||
);
|
||||
}
|
||||
|
||||
public AssertCursorPositionForTextInput(
|
||||
|
|
@ -864,10 +901,8 @@ export class DataSources {
|
|||
typeText = "as",
|
||||
cursorPosition = 0,
|
||||
) {
|
||||
const locator = selector.startsWith("//")
|
||||
? cy.xpath(selector)
|
||||
: cy.get(selector);
|
||||
locator
|
||||
this.agHelper
|
||||
.GetElement(selector)
|
||||
.type(moveCursor)
|
||||
.type(typeText)
|
||||
.should("have.prop", "selectionStart", cursorPosition);
|
||||
|
|
@ -1007,4 +1042,33 @@ export class DataSources {
|
|||
datasourceFormData["OAuth_AuthUrl"],
|
||||
);
|
||||
}
|
||||
|
||||
public AddSuggesstedWidget(widget: Widgets) {
|
||||
switch (widget) {
|
||||
case Widgets.Dropdown:
|
||||
this.agHelper.GetNClick(this._suggestedWidget("SELECT_WIDGET"));
|
||||
this.agHelper.AssertElementVisible(
|
||||
this.locator._widgetInCanvas(WIDGET.SELECT),
|
||||
);
|
||||
break;
|
||||
case Widgets.Table:
|
||||
this.agHelper.GetNClick(this._suggestedWidget("TABLE_WIDGET_V2"));
|
||||
this.agHelper.AssertElementVisible(
|
||||
this.locator._widgetInCanvas(WIDGET.TABLE),
|
||||
);
|
||||
break;
|
||||
case Widgets.Chart:
|
||||
this.agHelper.GetNClick(this._suggestedWidget("CHART_WIDGET"));
|
||||
this.agHelper.AssertElementVisible(
|
||||
this.locator._widgetInCanvas(WIDGET.CHART),
|
||||
);
|
||||
break;
|
||||
case Widgets.Text:
|
||||
this.agHelper.GetNClick(this._suggestedWidget("TEXT_WIDGET"));
|
||||
this.agHelper.AssertElementVisible(
|
||||
this.locator._widgetInCanvas(WIDGET.TEXT),
|
||||
);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
10
app/client/public/tinymce/tinymce.min.js
vendored
10
app/client/public/tinymce/tinymce.min.js
vendored
|
|
@ -10869,12 +10869,10 @@
|
|||
function u(e, t) {
|
||||
h.removeByUri(e.src),
|
||||
n(e.src, t),
|
||||
o
|
||||
.$(e)
|
||||
.attr({
|
||||
src: kf(o) ? t + "?" + new Date().getTime() : t,
|
||||
"data-mce-src": o.convertURL(t, "src"),
|
||||
});
|
||||
o.$(e).attr({
|
||||
src: kf(o) ? t + "?" + new Date().getTime() : t,
|
||||
"data-mce-src": o.convertURL(t, "src"),
|
||||
});
|
||||
}
|
||||
function s(n) {
|
||||
return (
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user