@ -146,9 +146,10 @@ export const genTest = (apiType, dbType) => {
let RESULT _MATH _0 = [ ] ;
let RESULT _MATH _0 = [ ] ;
let RESULT _MATH _1 = [ ] ;
let RESULT _MATH _1 = [ ] ;
let RESULT _MATH _2 = [ ] ;
let RESULT _MATH _2 = [ ] ;
let RESULT _MATH _3 = [ ] ;
let RESULT _WEEKDAY _0 = [ ] ;
let RESULT _WEEKDAY _0 = [ ] ;
let RESULT _WEEKDAY _1 = [ ] ;
let RESULT _WEEKDAY _1 = [ ] ;
for ( let i = 0 ; i < 10 ; i ++ ) {
for ( let i = 0 ; i < 10 ; i ++ ) {
// CONCAT, LOWER, UPPER, TRIM
// CONCAT, LOWER, UPPER, TRIM
RESULT _STRING [ i ] = ` ${ city [ i ] . toUpperCase ( ) } ${ city [
RESULT _STRING [ i ] = ` ${ city [ i ] . toUpperCase ( ) } ${ city [
@ -171,9 +172,12 @@ export const genTest = (apiType, dbType) => {
Math . min ( cityId [ i ] , countryId [ i ] ) +
Math . min ( cityId [ i ] , countryId [ i ] ) +
Math . max ( cityId [ i ] , countryId [ i ] ) ;
Math . max ( cityId [ i ] , countryId [ i ] ) ;
RESULT _MATH _2 [ i ] =
1.23 + Math . min ( 2.34 , 3.45 ) + Math . max ( 2.34 , 3.45 ) ;
// LOG, EXP, POWER, SQRT
// LOG, EXP, POWER, SQRT
// only integer verification being computed, hence trunc
// only integer verification being computed, hence trunc
RESULT _MATH _2 [ i ] = Math . trunc (
RESULT _MATH _3 [ i ] = Math . trunc (
Math . log ( cityId [ i ] ) +
Math . log ( cityId [ i ] ) +
Math . exp ( cityId [ i ] ) +
Math . exp ( cityId [ i ] ) +
Math . pow ( cityId [ i ] , 3 ) +
Math . pow ( cityId [ i ] , 3 ) +
@ -227,23 +231,32 @@ export const genTest = (apiType, dbType) => {
rowValidation ( "NC_MATH_1" , RESULT _MATH _1 ) ;
rowValidation ( "NC_MATH_1" , RESULT _MATH _1 ) ;
} ) ;
} ) ;
it ( "Formula: ROUND with decimals, MIN, MAX" , ( ) => {
editColumnByName (
"NC_MATH_1" ,
"NC_MATH_2" ,
` ROUND(1.2345, 2) + MIN(2.34, 3.45) + MAX(2.34, 3.45) `
) ;
rowValidation ( "NC_MATH_2" , RESULT _MATH _2 )
} )
it ( "Formula: LOG, EXP, POWER, SQRT" , ( ) => {
it ( "Formula: LOG, EXP, POWER, SQRT" , ( ) => {
// if (!isXcdb()) {
// if (!isXcdb()) {
if ( dbType === "mysql" ) {
if ( dbType === "mysql" ) {
// SQLITE doesnt support LOG, EXP, POWER SQRT construct
// SQLITE doesnt support LOG, EXP, POWER SQRT construct
editColumnByName (
editColumnByName (
"NC_MATH_1" ,
"NC_MATH_2" ,
"NC_MATH_2" ,
"NC_MATH_3" ,
` LOG({CityId}) + EXP({CityId}) + POWER({CityId}, 3) + SQRT({CountryId}) `
` LOG({CityId}) + EXP({CityId}) + POWER({CityId}, 3) + SQRT({CountryId}) `
) ;
) ;
rowValidation ( "NC_MATH_2 " , RESULT _MATH _2 ) ;
rowValidation ( "NC_MATH_3 " , RESULT _MATH _3 ) ;
}
}
} ) ;
} ) ;
it ( "Formula: NOW, EDIT & Delete column" , ( ) => {
it ( "Formula: NOW, EDIT & Delete column" , ( ) => {
// if (!isXcdb()) editColumnByName("NC_MATH_2", "NC_NOW", `NOW()`);
// if (!isXcdb()) editColumnByName("NC_MATH_2", "NC_NOW", `NOW()`);
if ( dbType === "mysql" ) editColumnByName ( "NC_MATH_2 " , "NC_NOW" , ` NOW() ` ) ;
if ( dbType === "mysql" ) editColumnByName ( "NC_MATH_3 " , "NC_NOW" , ` NOW() ` ) ;
else editColumnByName ( "NC_MATH_1 " , "NC_NOW" , ` NOW() ` ) ;
else editColumnByName ( "NC_MATH_2 " , "NC_NOW" , ` NOW() ` ) ;
deleteColumnByName ( "NC_NOW" ) ;
deleteColumnByName ( "NC_NOW" ) ;
cy . closeTableTab ( "City" ) ;
cy . closeTableTab ( "City" ) ;