Untitled

mail@pastecode.io avatar
unknown
plain_text
2 months ago
82 kB
2
Indexable
Never
import 'cypress-localstorage-commands'
import { LF } from '../../support/whatnot'
import { reset_window, configure_common, configure_env, configure_dss, checkYAML } from '../../support/pages/batch-ing/jdbc'


const ENV = {
    MIN:   { url: 'jdbc:oracle:thin@fwcy.com:2000;p1=v1;p2=v2',      usr: 'fwcy-usr' },
    MAX:   { url: 'jdbc:oracle:thin@fwcy.com:2000;p1=v1;p2=v2',      usr: 'fwcy-usr' },
    UPD:   { url: 'jdbc:oracle:thin@fwcyu.com:2000;p1=v1;p2=v2',     usr: 'fwcyu-usr' },
    DEV:   { url: 'jdbc:oracle:thin@fwcy.dev.com:2000;p1=v1;p2=v2',  usr: 'fwcy-dev-usr' },
    TEST:  { url: 'jdbc:oracle:thin@fwcy.test.com:2000;p1=v1;p2=v2', usr: 'fwcy-test-usr' },
    PROD:  { url: 'jdbc:oracle:thin@fwcy.prod.com:2000;p1=v1;p2=v2', usr: 'fwcy-prod-usr' },
    SHORT: { url: 'jdbc:oracle:thin@fwcy.com:2000;p1=v1;p2=v2',      usr: 'fwcy-usr' }
}
const DS = {
    MIN: {
        DS1: { tab: 'fwcy_ds1.tab', cols: 'fwcy,ds1,cols', watermark_col: null, max_ts_col: null, where: null, where_max: null, init_where_max: null, fetch_size: 1000000 },
        DS2: { tab: 'fwcy_ds2.tab', cols: 'fwcy,ds2,cols', watermark_col: null, max_ts_col: null, where: null, where_max: null, init_where_max: null, fetch_size: 2000000 },
        DS3: { tab: 'fwcy_ds3.tab', cols: 'fwcy,ds3,cols', watermark_col: null, max_ts_col: null, where: null, where_max: null, init_where_max: null, fetch_size: 3000000 }
    },
    MAX: {
        DS1: { tab: 'fwcy_ds1.tab', cols: 'fwcy,ds1,cols', watermark_col: 'fwcy_ds1_wc', max_ts_col: 'fwcy_ds1_mc', where: 'fwcy-ds1-w', where_max: 'fwcy-ds1-wm', init_where_max: 'fwcy-ds1-iwm', fetch_size: 1000000 },
        DS2: { tab: 'fwcy_ds2.tab', cols: 'fwcy,ds2,cols', watermark_col: 'fwcy_ds2_wc', max_ts_col: 'fwcy_ds2_mc', where: 'fwcy-ds2-w', where_max: 'fwcy-ds2-wm', init_where_max: 'fwcy-ds2-iwm', fetch_size: 2000000 },
        DS3: { tab: 'fwcy_ds3.tab', cols: 'fwcy,ds3,cols', watermark_col: 'fwcy_ds3_wc', max_ts_col: 'fwcy_ds3_mc', where: 'fwcy-ds3-w', where_max: 'fwcy-ds3-wm', init_where_max: 'fwcy-ds3-iwm', fetch_size: 3000000 }
    },
    UPD: {
        DS1: { tab: 'fwcyu_ds1.tab', cols: 'fwcyu,ds1,cols', watermark_col: 'fwcyu_ds1_wc', max_ts_col: 'fwcyu_ds1_mc', where: 'fwcyu-ds1-w', where_max: 'fwcyu-ds1-wm', init_where_max: 'fwcyu-ds1-iwm', fetch_size: 1000001 },
        DS2: { tab: 'fwcyu_ds2.tab', cols: 'fwcyu,ds2,cols', watermark_col: 'fwcyu_ds2_wc', max_ts_col: 'fwcyu_ds2_mc', where: 'fwcyu-ds2-w', where_max: 'fwcyu-ds2-wm', init_where_max: 'fwcyu-ds2-iwm', fetch_size: 2000001 },
        DS3: { tab: 'fwcyu_ds3.tab', cols: 'fwcyu,ds3,cols', watermark_col: 'fwcyu_ds3_wc', max_ts_col: 'fwcyu_ds3_mc', where: 'fwcyu-ds3-w', where_max: 'fwcyu-ds3-wm', init_where_max: 'fwcyu-ds3-iwm', fetch_size: 3000001 }
    },
    DEV:   { tab: 'fwcy_ds_dev.tab',  cols: 'fwcy,dev,ds,cols',   watermark_col: 'fwcy_ds_dev_wc',  max_ts_col: 'fwcy_ds_dev_mc',  where: 'fwcy-ds-dev-w',  where_max: 'fwcy-ds-dev-wm',  init_where_max: 'fwcy-ds-dev-iwm',  fetch_size: 1000000 },
    TEST:  { tab: 'fwcy_ds_test.tab', cols: 'fwcy,test,ds,cols',  watermark_col: 'fwcy_ds_test_wc', max_ts_col: 'fwcy_ds_test_mc', where: 'fwcy-ds-test-w', where_max: 'fwcy-ds-test-wm', init_where_max: 'fwcy-ds-test-iwm', fetch_size: 2000000 },
    PROD:  { tab: 'fwcy_ds_prod.tab', cols: 'fwcy,prod,ds,cols',  watermark_col: 'fwcy_ds_prod_wc', max_ts_col: 'fwcy_ds_prod_mc', where: 'fwcy-ds-prod-w', where_max: 'fwcy-ds-prod-wm', init_where_max: 'fwcy-ds-prod-iwm', fetch_size: 3000000 },
    SHORT: { tab: 'fwcy_ds.tab',      cols: 'fwcy,ds,cols',       watermark_col: undefined,         max_ts_col: undefined,         where: undefined,        where_max: 'fwcy-ds-wm',      init_where_max: undefined,          fetch_size: 1000000 }
}
const DS_DEP = {
    MIN: {
        DS1: { jads: null, jvm: '-Xmx19G', k8s_cpu: null, k8s_ram: null, m: null, h: null, d: null },
        DS2: { jads: null, jvm: '-Xmx18G', k8s_cpu: null, k8s_ram: null, m: null, h: null, d: null },
        DS3: { jads: null, jvm: '-Xmx17G', k8s_cpu: null, k8s_ram: null, m: null, h: null, d: null }
    },
    MAX: {
        DS1: { jads: 1000, jvm: '-Xmx19G', k8s_cpu: 1100, k8s_ram: '11Gi', m: 31, h: 19, d: 11, mon: 'January',  wd: 'Monday' },
        DS2: { jads: 2000, jvm: '-Xmx18G', k8s_cpu: 2100, k8s_ram: '12Gi', m: 32, h: 18, d: 12, mon: 'February', wd: 'Tuesday' },
        DS3: { jads: 2000, jvm: '-Xmx17G', k8s_cpu: 3100, k8s_ram: '13Gi', m: 33, h: 17, d: 13, mon: 'March',    wd: 'Wednesday' }
    },
    UPD: {
        DS1: { jads: 1001, jvm: '-Xmx16G', k8s_cpu: 1101, k8s_ram: '12Gi', m: 32, h: 20, d: 12, mon: 'September',  wd: 'Thursday' },
        DS2: { jads: 2001, jvm: '-Xmx17G', k8s_cpu: 2101, k8s_ram: '13Gi', m: 33, h: 21, d: 13, mon: 'October',    wd: 'Friday' },
        DS3: { jads: 3001, jvm: '-Xmx18G', k8s_cpu: 3101, k8s_ram: '14Gi', m: 34, h: 22, d: 14, mon: 'November',   wd: 'Saturday' }
    },
    DEV:   { jads: 1000,      jvm: '-Xmx19G', k8s_cpu: 1100,      k8s_ram: '11Gi',    m: 31,        h: 19,        d: 11,        mon: 'January',  wd: 'Monday' },
    TEST:  { jads: 2000,      jvm: '-Xmx18G', k8s_cpu: 2100,      k8s_ram: '12Gi',    m: 32,        h: 18,        d: 12,        mon: 'February', wd: 'Tuesday' },
    PROD:  { jads: 2000,      jvm: '-Xmx17G', k8s_cpu: 3100,      k8s_ram: '13Gi',    m: 33,        h: 17,        d: 13,        mon: 'March',    wd: 'Wednesday' },
    SHORT: { jads: undefined, jvm: undefined, k8s_cpu: undefined, k8s_ram: undefined, m: undefined, h: undefined, d: undefined, mon: undefined,  wd: undefined}
}
const DS_ING = {
    MIN: {
        DS1: { bblock: 10000, bbuff: null, cs: 10100,  ts: null },
        DS2: { bblock: 20000, bbuff: null, cs: 10200,  ts: null },
        DS3: { bblock: 30000, bbuff: null, cs: 10300,  ts: null }
    },
    MAX: {
        DS1: { bblock: 10000, bbuff: 11000, cs: 10100, ts: '2001-09-21 11:21:31' },
        DS2: { bblock: 20000, bbuff: 21000, cs: 20100, ts: '2002-08-22 12:22:32' },
        DS3: { bblock: 30000, bbuff: 31000, cs: 30100, ts: '2003-07-23 13:23:33' }
    },
    UPD: {
        DS1: { bblock: 10001, bbuff: 11001, cs: 10101, ts: '2011-01-19 21:31:41' },
        DS2: { bblock: 20001, bbuff: 21001, cs: 20101, ts: '2012-01-18 22:32:42' },
        DS3: { bblock: 30001, bbuff: 31001, cs: 30101, ts: '2013-01-17 23:33:43' }
    },
    DEV:   { bblock: 10000, bbuff: 11000, cs: 10100, ts: '2001-09-21 11:21:31' },
    TEST:  { bblock: 20000, bbuff: 21000, cs: 20100, ts: '2002-08-22 12:22:32' },
    PROD:  { bblock: 30000, bbuff: 31000, cs: 30100, ts: '2003-07-23 13:23:33' },
    SHORT: { bblock: undefined, bbuff: undefined, cs: undefined, ts: undefined }
}

function create__no_dc__no_dss__test() {
    // Configure common. TEST, PROD: disable. DEV: enable and configure.
    configure_common({ dc: 'fwcy-dc', ing: 'jdbc', conf_dc: false, conf_dss: false })
    cy.switchEnv('TEST').switch('Configure', false)
    cy.switchEnv('PROD').switch('Configure', false)
    cy.switchEnv('DEV').switch('Configure', true)

    // Click the 'CREATE' button. DEV: check YAML. TEST, PROD: check no YAML.
    cy.create()
    cy.switchEnv('DEV').checkNoYAML()
    cy.switchEnv('TEST').checkNoYAML()
    cy.switchEnv('PROD').checkNoYAML()
}

function create__dc__test() {
    // Configure common. TEST, PROD: disable. DEV: enable and configure.
    let common = configure_common({ dc: 'fwcy-dc', ing: 'jdbc', conf_dc: true, conf_dss: false })
    cy.switchEnv('TEST').switch('Configure', false)
    cy.switchEnv('PROD').switch('Configure', false)
    cy.switchEnv('DEV').switch('Configure', true)
    let env = configure_env(ENV.MAX)

    // Click the 'CREATE' button. DEV: check YAML. TEST, PROD: check no YAML.
    cy.create()
    cy.switchEnv('DEV')
    checkYAML({ common, env }, 'dev')
    // cy.switchEnv('TEST').checkNoYAML()
    // cy.switchEnv('PROD').checkNoYAML()
}

function create__dss_min__test() {
    // Configure common. TEST, PROD: disable. DEV: enable and configure.
    let common = configure_common({ dc: 'fwcy-dc', ing: 'jdbc', conf_dc: false, conf_dss: true })
    cy.switchEnv('TEST').switch('Configure', false)
    cy.switchEnv('PROD').switch('Configure', false)
    cy.switchEnv('DEV').switch('Configure', true)
    let env = configure_env(ENV.SHORT)

    // Navigate to the 'Data Sets' tab. DEV: configure.
    cy.navigate('Data Sets')
    cy.switchEnv('DEV')
    let dss = configure_dss({
        'fwcy-ds1': { ...DS.MIN.DS1, dep: DS_DEP.MIN.DS1, ing: DS_ING.MIN.DS1 },
        'fwcy-ds2': { ...DS.MIN.DS2, dep: DS_DEP.MIN.DS2, ing: DS_ING.MIN.DS2 },
        'fwcy-ds3': { ...DS.MIN.DS3, dep: DS_DEP.MIN.DS3, ing: DS_ING.MIN.DS3 }
    })

    // Click the 'CREATE' button. DEV: check YAML. TEST, PROD: check no YAML.
    cy.create()
    cy.switchEnv('DEV')
    checkYAML({ common, env, dss }, 'dev')
    // cy.switchEnv('TEST').checkNoYAML()
    // cy.switchEnv('PROD').checkNoYAML()
}

function create__dss_max__test() {
    // Configure common. TEST, PROD: disable. DEV: enable and configure.
    let common = configure_common({ dc: 'fwcy-dc', ing: 'jdbc', conf_dc: false, conf_dss: true })
    cy.switchEnv('TEST').switch('Configure', false)
    cy.switchEnv('PROD').switch('Configure', false)
    cy.switchEnv('DEV').switch('Configure', true)
    let env = configure_env(ENV.SHORT)

    // Navigate to the 'Data Sets' tab. DEV: configure.
    cy.navigate('Data Sets')
    cy.switchEnv('DEV')
    let dss = configure_dss({
        'fwcy-ds1': { ...DS.MAX.DS1, dep: DS_DEP.MAX.DS1, ing: DS_ING.MAX.DS1 },
        'fwcy-ds2': { ...DS.MAX.DS2, dep: DS_DEP.MAX.DS2, ing: DS_ING.MAX.DS2 },
        'fwcy-ds3': { ...DS.MAX.DS3, dep: DS_DEP.MAX.DS3, ing: DS_ING.MAX.DS3 }
    })

    // Click the 'CREATE' button. DEV: check YAML. TEST, PROD: check no YAML.
    cy.create()
    cy.switchEnv('DEV')
    checkYAML({ common, env, dss }, 'dev')
    // cy.switchEnv('TEST').checkNoYAML()
    // cy.switchEnv('PROD').checkNoYAML()
}

function create__dc__dss__test() {
    // Configure common. TEST, PROD: disable. DEV: enable and configure.
    let common = configure_common({ dc: 'fwcy-dc', ing: 'jdbc', conf_dc: true, conf_dss: true })
    cy.switchEnv('TEST').switch('Configure', false)
    cy.switchEnv('PROD').switch('Configure', false)
    cy.switchEnv('DEV').switch('Configure', true)
    let env = configure_env(ENV.MAX)

    // Navigate to the 'Data Sets' tab. DEV: configure.
    cy.navigate('Data Sets')
    cy.switchEnv('DEV')
    let dss = configure_dss({
        'fwcy-ds1': { ...DS.MAX.DS1, dep: DS_DEP.MAX.DS1, ing: DS_ING.MAX.DS1 },
        'fwcy-ds2': { ...DS.MAX.DS2, dep: DS_DEP.MAX.DS2, ing: DS_ING.MAX.DS2 },
        'fwcy-ds3': { ...DS.MAX.DS3, dep: DS_DEP.MAX.DS3, ing: DS_ING.MAX.DS3 }
    })

    // Click the 'CREATE' button. DEV: check YAML. TEST, PROD: check no YAML.
    cy.create()
    cy.switchEnv('DEV')
    checkYAML({ common, env, jdbc, dss }, 'dev')
    // cy.switchEnv('TEST').checkNoYAML()
    // cy.switchEnv('PROD').checkNoYAML()
}

function create__all_envs__test() {
    // Configure common. DEV, TEST, PROD: enable and configure.
    let common = configure_common({ dc: 'fwcy-dc', ing: 'jdbc', conf_dc: true, conf_dss: true })
    cy.switchEnv('DEV').switch('Configure', true)
    let dev = { env: configure_env(ENV.DEV, 'DEV') }
    cy.switchEnv('TEST').switch('Configure', true)
    let test = { env: configure_env(ENV.TEST, 'TEST') }
    cy.switchEnv('PROD').switch('Configure', true)
    let prod = { env: configure_env(ENV.PROD, 'PROD') }

    // Navigate to the 'Data Sets' tab. DEV, TEST, PROD: configure.
    cy.navigate('Data Sets')
    cy.switchEnv('DEV')
    dev.dss = configure_dss({ 'fwcy-dev-ds': { ...DS.DEV, dep: DS_DEP.DEV, ing: DS_ING.DEV } }, 'DEV')
    cy.switchEnv('TEST')
    test.dss = configure_dss({ 'fwcy-test-ds': { ...DS.TEST, dep: DS_DEP.TEST, ing: DS_ING.TEST } }, 'TEST')
    cy.switchEnv('PROD')
    prod.dss = configure_dss({ 'fwcy-prod-ds': { ...DS.PROD, dep: DS_DEP.PROD, ing: DS_ING.PROD } }, 'PROD')

    // Click the 'CREATE' button. DEV, TEST, PROD: check YAML.
    cy.create()
    cy.switchEnv('DEV')
    checkYAML({ common, ...dev }, 'dev')
    cy.switchEnv('TEST')
    checkYAML({ common, ...test }, 'test')
    cy.switchEnv('PROD')
    checkYAML({ common, ...prod }, 'prod')
}

function ll__dss_tab_fetch_size__test() {
    // Configure common. TEST, PROD: disable. DEV: enable and configure.
    configure_common({ dc: 'fwcy-dc', ing: 'jdbc', conf_dc: false, conf_dss: true })
    cy.switchEnv('DEV').switch('Configure', true)
    configure_env(ENV.SHORT)

    // Navigate to the 'Data Sets' tab. DEV: configure.
    cy.navigate('Data Sets')
    cy.switchEnv('DEV')
    configure_dss({ 'fwcy-ds': { ...DS.SHORT, fetch_size: 1, dep: DS_DEP.SHORT, ing: DS_ING.SHORT } })

    // Click the 'CREATE' button. DEV: check the limit value.
    cy.create()
    cy.switchEnv('DEV')
    cy.dropdown({ select: 'fwcy-dc_fwcy-ds', from : 'Select Batch Ingestion Config' })
    cy.checkYAML((raw, conf) => { expect(conf['source']['jdbc']['fetch-size']).to.equal(1) })
}

function hl__dss_tab_fetch_size__test() {
    // Configure common. TEST, PROD: disable. DEV: enable and configure.
    configure_common({ dc: 'fwcy-dc', ing: 'jdbc', conf_dc: false, conf_dss: true })
    cy.switchEnv('DEV').switch('Configure', true)
    configure_env(ENV.SHORT)

    // Navigate to the 'Data Sets' tab. DEV: configure.
    cy.navigate('Data Sets')
    cy.switchEnv('DEV')
    configure_dss({ 'fwcy-ds': { ...DS.SHORT, fetch_size: '9223372036854775807' , dep: DS_DEP.SHORT, ing: DS_ING.SHORT } })

    // Click the 'CREATE' button. DEV: check the limit value.
    cy.create()
    cy.switchEnv('DEV')
    cy.dropdown({ select: 'fwcy-dc_fwcy-ds', from : 'Select Batch Ingestion Config' })
    cy.checkYAML((raw, conf) => { expect(conf['source']['jdbc']['fetch-size'].toString()).to.equal('9223372036854775807') })
}

function ll__dss_dep_jads__test() {
    // Configure common. TEST, PROD: disable. DEV: enable and configure.
    configure_common({ dc: 'fwcy-dc', ing: 'jdbc', conf_dc: false, conf_dss: true })
    cy.switchEnv('DEV').switch('Configure', true)
    configure_env(ENV.SHORT)

    // Navigate to the 'Data Sets' tab. DEV: configure.
    cy.navigate('Data Sets')
    cy.switchEnv('DEV')
    configure_dss({ 'fwcy-ds': { ...DS.SHORT, dep: { ...DS_DEP.SHORT, jads: 0 }, ing: DS_ING.SHORT } })

    // Click the 'CREATE' button. DEV: check the limit value.
    cy.create()
    cy.switchEnv('DEV')
    cy.dropdown({ select: 'fwcy-dc_fwcy-ds', from : 'Select Batch Ingestion Config' })
    cy.checkYAML((raw, conf) => { expect(conf['deploy']['job-active-deadline-seconds']).to.equal(0) })
}

function hl__dss_dep_jads__test() {
    // Configure common. TEST, PROD: disable. DEV: enable and configure.
    configure_common({ dc: 'fwcy-dc', ing: 'jdbc', conf_dc: false, conf_dss: true })
    cy.switchEnv('DEV').switch('Configure', true)
    configure_env(ENV.SHORT)

    // Navigate to the 'Data Sets' tab. DEV: configure.
    cy.navigate('Data Sets')
    cy.switchEnv('DEV')
    configure_dss({ 'fwcy-ds': { ...DS.SHORT, dep: { ...DS_DEP.SHORT, jads: '9223372036854775807' }, ing: DS_ING.SHORT } })

    // Click the 'CREATE' button. DEV: check the limit value.
    cy.create()
    cy.switchEnv('DEV')
    cy.dropdown({ select: 'fwcy-dc_fwcy-ds', from : 'Select Batch Ingestion Config' })
    cy.checkYAML((raw, conf) => { expect(conf['deploy']['job-active-deadline-seconds'].toString()).to.equal('9223372036854775807') })
}

function ll__dss_dep_k8s_cpu__test() {
    // Configure common. TEST, PROD: disable. DEV: enable and configure.
    configure_common({ dc: 'fwcy-dc', ing: 'jdbc', conf_dc: false, conf_dss: true })
    cy.switchEnv('DEV').switch('Configure', true)
    configure_env(ENV.SHORT)

    // Navigate to the 'Data Sets' tab. DEV: configure.
    cy.navigate('Data Sets')
    cy.switchEnv('DEV')
    configure_dss({ 'fwcy-ds': { ...DS.SHORT, dep: { ...DS_DEP.SHORT, k8s_cpu: 1 }, ing: DS_ING.SHORT } })

    // Click the 'CREATE' button. DEV: check the limit value.
    cy.create()
    cy.switchEnv('DEV')
    cy.dropdown({ select: 'fwcy-dc_fwcy-ds', from : 'Select Batch Ingestion Config' })
    cy.checkYAML((raw, conf) => { expect(conf['deploy']['k8s-resource-cpu']).to.equal(1) })
}

function hl__dss_dep_k8s_cpu__test() {
    // Configure common. TEST, PROD: disable. DEV: enable and configure.
    configure_common({ dc: 'fwcy-dc', ing: 'jdbc', conf_dc: false, conf_dss: true })
    cy.switchEnv('DEV').switch('Configure', true)
    configure_env(ENV.SHORT)

    // Navigate to the 'Data Sets' tab. DEV: configure.
    cy.navigate('Data Sets')
    cy.switchEnv('DEV')
    configure_dss({ 'fwcy-ds': { ...DS.SHORT, dep: { ...DS_DEP.SHORT, k8s_cpu: '9223372036854775807' }, ing: DS_ING.SHORT } })

    // Click the 'CREATE' button. DEV: check the limit value.
    cy.create()
    cy.switchEnv('DEV')
    cy.dropdown({ select: 'fwcy-dc_fwcy-ds', from : 'Select Batch Ingestion Config' })
    cy.checkYAML((raw, conf) => { expect(conf['deploy']['k8s-resource-cpu'].toString()).to.equal('9223372036854775807') })
}

function ll__dss_dep_k8s_ram__test() {
    // Configure common. TEST, PROD: disable. DEV: enable and configure.
    configure_common({ dc: 'fwcy-dc', ing: 'jdbc', conf_dc: false, conf_dss: true })
    cy.switchEnv('DEV').switch('Configure', true)
    configure_env(ENV.SHORT)

    // Navigate to the 'Data Sets' tab. DEV: configure.
    cy.navigate('Data Sets')
    cy.switchEnv('DEV')
    configure_dss({ 'fwcy-ds': { ...DS.SHORT, dep: { ...DS_DEP.SHORT, k8s_ram: '1Gi' }, ing: DS_ING.SHORT } })

    // Click the 'CREATE' button. DEV: check the limit value.
    cy.create()
    cy.switchEnv('DEV')
    cy.dropdown({ select: 'fwcy-dc_fwcy-ds', from : 'Select Batch Ingestion Config' })
    cy.checkYAML((raw, conf) => { expect(conf['deploy']['k8s-resource-memory']).to.equal('1Gi') })
}

function hl__dss_dep_k8s_ram__test() {
    // Configure common. TEST, PROD: disable. DEV: enable and configure.
    configure_common({ dc: 'fwcy-dc', ing: 'jdbc', conf_dc: false, conf_dss: true })
    cy.switchEnv('DEV').switch('Configure', true)
    configure_env(ENV.SHORT)

    // Navigate to the 'Data Sets' tab. DEV: configure.
    cy.navigate('Data Sets')
    cy.switchEnv('DEV')
    configure_dss({ 'fwcy-ds': { ...DS.SHORT, dep: { ...DS_DEP.SHORT, k8s_ram: '32Gi' }, ing: DS_ING.SHORT } })

    // Click the 'CREATE' button. DEV: check the limit value.
    cy.create()
    cy.switchEnv('DEV')
    cy.dropdown({ select: 'fwcy-dc_fwcy-ds', from : 'Select Batch Ingestion Config' })
    cy.checkYAML((raw, conf) => { expect(conf['deploy']['k8s-resource-memory']).to.equal('32Gi') })
}

function ll__dss_dep_m__test() {
    // Configure common. TEST, PROD: disable. DEV: enable and configure.
    configure_common({ dc: 'fwcy-dc', ing: 'jdbc', conf_dc: false, conf_dss: true })
    cy.switchEnv('DEV').switch('Configure', true)
    configure_env(ENV.SHORT)

    // Navigate to the 'Data Sets' tab. DEV: configure.
    cy.navigate('Data Sets')
    cy.switchEnv('DEV')
    configure_dss({ 'fwcy-ds': { ...DS.SHORT, dep: { ...DS_DEP.SHORT, m: 0 }, ing: DS_ING.SHORT } })

    // Click the 'CREATE' button. DEV: check the limit value.
    cy.create()
    cy.switchEnv('DEV')
    cy.dropdown({ select: 'fwcy-dc_fwcy-ds', from : 'Select Batch Ingestion Config' })
    cy.checkYAML((raw, conf) => { expect(conf['deploy']['job-schedule']).to.equal('0 * * * *') })
}

function hl__dss_dep_m__test() {
    // Configure common. TEST, PROD: disable. DEV: enable and configure.
    configure_common({ dc: 'fwcy-dc', ing: 'jdbc', conf_dc: false, conf_dss: true })
    cy.switchEnv('DEV').switch('Configure', true)
    configure_env(ENV.SHORT)

    // Navigate to the 'Data Sets' tab. DEV: configure.
    cy.navigate('Data Sets')
    cy.switchEnv('DEV')
    configure_dss({ 'fwcy-ds': { ...DS.SHORT, dep: { ...DS_DEP.SHORT, m: 59 }, ing: DS_ING.SHORT } })

    // Click the 'CREATE' button. DEV: check the limit value.
    cy.create()
    cy.switchEnv('DEV')
    cy.dropdown({ select: 'fwcy-dc_fwcy-ds', from : 'Select Batch Ingestion Config' })
    cy.checkYAML((raw, conf) => { expect(conf['deploy']['job-schedule']).to.equal('59 * * * *') })
}

function ll__dss_dep_h__test() {
    // Configure common. TEST, PROD: disable. DEV: enable and configure.
    configure_common({ dc: 'fwcy-dc', ing: 'jdbc', conf_dc: false, conf_dss: true })
    cy.switchEnv('DEV').switch('Configure', true)
    configure_env(ENV.SHORT)

    // Navigate to the 'Data Sets' tab. DEV: configure.
    cy.navigate('Data Sets')
    cy.switchEnv('DEV')
    configure_dss({ 'fwcy-ds': { ...DS.SHORT, dep: { ...DS_DEP.SHORT, h: 0 }, ing: DS_ING.SHORT } })

    // Click the 'CREATE' button. DEV: check the limit value.
    cy.create()
    cy.switchEnv('DEV')
    cy.dropdown({ select: 'fwcy-dc_fwcy-ds', from : 'Select Batch Ingestion Config' })
    cy.checkYAML((raw, conf) => { expect(conf['deploy']['job-schedule']).to.equal('* 0 * * *') })
}

function hl__dss_dep_h__test() {
    // Configure common. TEST, PROD: disable. DEV: enable and configure.
    configure_common({ dc: 'fwcy-dc', ing: 'jdbc', conf_dc: false, conf_dss: true })
    cy.switchEnv('DEV').switch('Configure', true)
    configure_env(ENV.SHORT)

    // Navigate to the 'Data Sets' tab. DEV: configure.
    cy.navigate('Data Sets')
    cy.switchEnv('DEV')
    configure_dss({ 'fwcy-ds': { ...DS.SHORT, dep: { ...DS_DEP.SHORT, h: 23 }, ing: DS_ING.SHORT } })

    // Click the 'CREATE' button. DEV: check the limit value.
    cy.create()
    cy.switchEnv('DEV')
    cy.dropdown({ select: 'fwcy-dc_fwcy-ds', from : 'Select Batch Ingestion Config' })
    cy.checkYAML((raw, conf) => { expect(conf['deploy']['job-schedule']).to.equal('* 23 * * *') })
}

function ll__dss_dep_d__test() {
    // Configure common. TEST, PROD: disable. DEV: enable and configure.
    configure_common({ dc: 'fwcy-dc', ing: 'jdbc', conf_dc: false, conf_dss: true })
    cy.switchEnv('DEV').switch('Configure', true)
    configure_env(ENV.SHORT)

    // Navigate to the 'Data Sets' tab. DEV: configure.
    cy.navigate('Data Sets')
    cy.switchEnv('DEV')
    configure_dss({ 'fwcy-ds': { ...DS.SHORT, dep: { ...DS_DEP.SHORT, d: 1 }, ing: DS_ING.SHORT } })

    // Click the 'CREATE' button. DEV: check the limit value.
    cy.create()
    cy.switchEnv('DEV')
    cy.dropdown({ select: 'fwcy-dc_fwcy-ds', from : 'Select Batch Ingestion Config' })
    cy.checkYAML((raw, conf) => { expect(conf['deploy']['job-schedule']).to.equal('* * 1 * *') })
}

function hl__dss_dep_d__test() {
    // Configure common. TEST, PROD: disable. DEV: enable and configure.
    configure_common({ dc: 'fwcy-dc', ing: 'jdbc', conf_dc: false, conf_dss: true })
    cy.switchEnv('DEV').switch('Configure', true)
    configure_env(ENV.SHORT)

    // Navigate to the 'Data Sets' tab. DEV: configure.
    cy.navigate('Data Sets')
    cy.switchEnv('DEV')
    configure_dss({ 'fwcy-ds': { ...DS.SHORT, dep: { ...DS_DEP.SHORT, d: 31 }, ing: DS_ING.SHORT } })

    // Click the 'CREATE' button. DEV: check the limit value.
    cy.create()
    cy.switchEnv('DEV')
    cy.dropdown({ select: 'fwcy-dc_fwcy-ds', from : 'Select Batch Ingestion Config' })
    cy.checkYAML((raw, conf) => { expect(conf['deploy']['job-schedule']).to.equal('* * 31 * *') })
}

function ll__dss_ing_bblock_size__test() {
    // Configure common. TEST, PROD: disable. DEV: enable and configure.
    configure_common({ dc: 'fwcy-dc', ing: 'jdbc', conf_dc: false, conf_dss: true })
    cy.switchEnv('DEV').switch('Configure', true)
    configure_env(ENV.SHORT)

    // Navigate to the 'Data Sets' tab. DEV: configure.
    cy.navigate('Data Sets')
    cy.switchEnv('DEV')
    configure_dss({ 'fwcy-ds': { ...DS.SHORT, dep: DS_DEP.SHORT, ing: { ...DS_ING.SHORT, bblock: 1 } } })

    // Click the 'CREATE' button. DEV: check the limit value.
    cy.create()
    cy.switchEnv('DEV')
    cy.dropdown({ select: 'fwcy-dc_fwcy-ds', from : 'Select Batch Ingestion Config' })
    cy.checkYAML((raw, conf) => { expect(conf['jdbc-ingestion']['blob-block-size-mb']).to.equal(1) })
}

function hl__dss_ing_bblock_size__test() {
    // Configure common. TEST, PROD: disable. DEV: enable and configure.
    configure_common({ dc: 'fwcy-dc', ing: 'jdbc', conf_dc: false, conf_dss: true })
    cy.switchEnv('DEV').switch('Configure', true)
    configure_env(ENV.SHORT)

    // Navigate to the 'Data Sets' tab. DEV: configure.
    cy.navigate('Data Sets')
    cy.switchEnv('DEV')
    configure_dss({ 'fwcy-ds': { ...DS.SHORT, dep: DS_DEP.SHORT, ing: { ...DS_ING.SHORT, bblock: '9223372036854775807' } } })

    // Click the 'CREATE' button. DEV: check the limit value.
    cy.create()
    cy.switchEnv('DEV')
    cy.dropdown({ select: 'fwcy-dc_fwcy-ds', from : 'Select Batch Ingestion Config' })
    cy.checkYAML((raw, conf) => { expect(conf['jdbc-ingestion']['blob-block-size-mb'].toString()).to.equal('9223372036854775807') })
}

function ll__dss_ing_bbuff_size__test() {
    // Configure common. TEST, PROD: disable. DEV: enable and configure.
    configure_common({ dc: 'fwcy-dc', ing: 'jdbc', conf_dc: false, conf_dss: true })
    cy.switchEnv('DEV').switch('Configure', true)
    configure_env(ENV.SHORT)

    // Navigate to the 'Data Sets' tab. DEV: configure.
    cy.navigate('Data Sets')
    cy.switchEnv('DEV')
    configure_dss({ 'fwcy-ds': { ...DS.SHORT, dep: DS_DEP.SHORT, ing: { ...DS_ING.SHORT, bbuff: 1 } } })

    // Click the 'CREATE' button. DEV: check the limit value.
    cy.create()
    cy.switchEnv('DEV')
    cy.dropdown({ select: 'fwcy-dc_fwcy-ds', from : 'Select Batch Ingestion Config' })
    cy.checkYAML((raw, conf) => { expect(conf['jdbc-ingestion']['blob-buffer-size-mb']).to.equal(1) })
}

function hl__dss_ing_bbuff_size__test() {
    // Configure common. TEST, PROD: disable. DEV: enable and configure.
    configure_common({ dc: 'fwcy-dc', ing: 'jdbc', conf_dc: false, conf_dss: true })
    cy.switchEnv('DEV').switch('Configure', true)
    configure_env(ENV.SHORT)

    // Navigate to the 'Data Sets' tab. DEV: configure.
    cy.navigate('Data Sets')
    cy.switchEnv('DEV')
    configure_dss({ 'fwcy-ds': { ...DS.SHORT, dep: DS_DEP.SHORT, ing: { ...DS_ING.SHORT, bblock: '9223372036854775807' } } })

    // Click the 'CREATE' button. DEV: check the limit value.
    cy.create()
    cy.switchEnv('DEV')
    cy.dropdown({ select: 'fwcy-dc_fwcy-ds', from : 'Select Batch Ingestion Config' })
    cy.checkYAML((raw, conf) => { expect(conf['jdbc-ingestion']['blob-buffer-size-mb'].toString()).to.equal('9223372036854775807') })
}

function ll__dss_ing_chunk_size__test() {
    // Configure common. TEST, PROD: disable. DEV: enable and configure.
    configure_common({ dc: 'fwcy-dc', ing: 'jdbc', conf_dc: false, conf_dss: true })
    cy.switchEnv('DEV').switch('Configure', true)
    configure_env(ENV.SHORT)

    // Navigate to the 'Data Sets' tab. DEV: configure.
    cy.navigate('Data Sets')
    cy.switchEnv('DEV')
    configure_dss({ 'fwcy-ds': { ...DS.SHORT, dep: DS_DEP.SHORT, ing: { ...DS_ING.SHORT, cs: 1 } } })

    // Click the 'CREATE' button. DEV: check the limit value.
    cy.create()
    cy.switchEnv('DEV')
    cy.dropdown({ select: 'fwcy-dc_fwcy-ds', from : 'Select Batch Ingestion Config' })
    cy.checkYAML((raw, conf) => { expect(conf['jdbc-ingestion']['chunk-size']).to.equal(1) })
}

function hl__dss_ing_chunk_size__test() {
    // Configure common. TEST, PROD: disable. DEV: enable and configure.
    configure_common({ dc: 'fwcy-dc', ing: 'jdbc', conf_dc: false, conf_dss: true })
    cy.switchEnv('DEV').switch('Configure', true)
    configure_env(ENV.SHORT)

    // Navigate to the 'Data Sets' tab. DEV: configure.
    cy.navigate('Data Sets')
    cy.switchEnv('DEV')
    configure_dss({ 'fwcy-ds': { ...DS.SHORT, dep: DS_DEP.SHORT, ing: { ...DS_ING.SHORT, cs: '9223372036854775807' } } })

    // Click the 'CREATE' button. DEV: check the limit value.
    cy.create()
    cy.switchEnv('DEV')
    cy.dropdown({ select: 'fwcy-dc_fwcy-ds', from : 'Select Batch Ingestion Config' })
    cy.checkYAML((raw, conf) => { expect(conf['jdbc-ingestion']['chunk-size'].toString()).to.equal('9223372036854775807') })
}

function update__dc__test() {
    // Configure common. TEST, PROD: disable. DEV: enable and configure.
    configure_common({ dc: 'fwcy-dc', ing: 'jdbc', conf_dc: true, conf_dss: false })
    cy.switchEnv('TEST').switch('Configure', false)
    cy.switchEnv('PROD').switch('Configure', false)
    cy.switchEnv('DEV').switch('Configure', true)
    configure_env(ENV.MAX)

    // Click the 'CREATE' button. Click the 'UPDATE' button.
    cy.create()
    cy.update()

    // Navigate to the 'Ingestion' tab. Reconfigure common. DEV: reconfigure.
    cy.navigate('Ingestion')
    let common = configure_common({ dc: 'fwcyu-dc' })
    cy.switchEnv('DEV')
    let env = configure_env(ENV.UPD)
    
    // Click the 'CREATE' button. DEV: check YAML. TEST, PROD: check no YAML.
    cy.create()
    cy.switchEnv('DEV')
    checkYAML({ common, env })
    // cy.switchEnv('TEST').checkNoYAML()
    // cy.switchEnv('PROD').checkNoYAML()
}

function update__dss__test() {
    // Configure common. TEST, PROD: disable. DEV: enable and configure.
    let common = configure_common({ dc: 'fwcy-dc', ing: 'jdbc', conf_dc: true, conf_dss: false })
    cy.switchEnv('TEST').switch('Configure', false)
    cy.switchEnv('PROD').switch('Configure', false)
    cy.switchEnv('DEV').switch('Configure', true)
    configure_env(ENV.SHORT)

    // Navigate to the 'Data Sets' tab. DEV: configure.
    cy.navigate('Data Sets')
    cy.switchEnv('DEV')
    configure_dss({
        'fwcy-ds0': { ...DS.SHORT, dep: DS_DEP.SHORT, ing: DS_ING.SHORT },
        'fwcy-ds1': { ...DS.MAX.DS1, dep: DS_DEP.MAX.DS1, ing: DS_ING.MAX.DS1 },
        'fwcy-ds2': { ...DS.MAX.DS2, dep: DS_DEP.MAX.DS2, ing: DS_ING.MAX.DS2 }
    })
    
    // Click the 'CREATE' button. Click the 'UPDATE' button.
    cy.create()
    cy.update()

    // Navigate to the 'Data Sets' tab. DEV: configure.
    cy.navigate('Data Sets')
    cy.switchEnv('DEV')
    let dss = configure_dss({  // 0 - drop, 1 - no changes, 2 - upd (including renaming), 3 - add.
        'fwcy-ds0': null,
        'fwcy-ds2': { ds: 'fwcyu-ds2', ...DS.UPD.DS2, dep: DS_DEP.UPD.DS2, ing: DS_ING.UPD.DS2 },
        'fwcy-ds3': { ...DS.MAX.DS3, dep: DS_DEP.MAX.DS3, ing: DS_ING.MAX.DS3 }
    })
    
    // Click the 'CREATE' button. DEV: check YAML. TEST, PROD: check no YAML.
    cy.create()
    cy.switchEnv('DEV')
    checkYAML({ common, dss })
    // cy.switchEnv('TEST').checkNoYAML()
    // cy.switchEnv('PROD').checkNoYAML()
}

function blank__dc_dc__test() {
    // Configure common. TEST, PROD: disable. DEV: enable and configure.
    configure_common({ dc: undefined, ing: 'jdbc', conf_dc: true, conf_dss: false })
    cy.switchEnv('TEST').switch('Configure', false)
    cy.switchEnv('PROD').switch('Configure', false)
    cy.switchEnv('DEV').switch('Configure', true)
    configure_env(ENV.SHORT)

    // Click the 'CREATE' button. Check the error message.
    cy.create()
    cy.navigate('Ingestion')
    let label = 'Data Collection'
    cy.checkErr({ err: `"${label}" is required!`, next_to: 'field', label })
}

function blank__dc_ing__test() {
    // Configure common. TEST, PROD: disable. DEV: enable and configure.
    configure_common({ dc: 'fwcy-dc', conf_dc: true, conf_dss: false })

    // Click the 'CREATE' button. Check the error message.
    cy.create()
    cy.navigate('Ingestion')
    let label = 'Ingestion Type'
    cy.checkErr({ err: `"${label}" is required!`, next_to: 'dropdown', label })
}

function blank__dc_url__test() {
    // Configure common. DEV: enable and configure.
    configure_common({ dc: 'fwcy-dc', ing: 'jdbc', conf_dc: true, conf_dss: false })
    cy.switchEnv('DEV').switch('Configure', true)
    configure_env({ ...ENV.SHORT, url: null })
    
    // Click the 'CREATE' button. Check the error message.
    cy.create()
    cy.navigate('Ingestion')
    const label = 'Url'
	cy.checkErr({ err: `"${label}" is required!`, next_to: 'field', label })
}

function blank__dc_username__test() {
    // Configure common. DEV: enable and configure.
    configure_common({ dc: 'fwcy-dc', ing: 'jdbc', conf_dc: true, conf_dss: false })
    cy.switchEnv('DEV').switch('Configure', true)
    configure_env({ ...ENV.SHORT, usr: null })
    
    // Click the 'CREATE' button. Check the error message.
    cy.create()
    cy.navigate('Ingestion')
    const label = 'Username'
	cy.checkErr({ err: `"${label}" is required!`, next_to: 'field', label })
}

function blank__dss_ds__test() {
    // Configure common. DEV: enable and configure.
    configure_common({ dc: 'fwcy-dc', ing: 'jdbc', conf_dc: false, conf_dss: true })
    cy.switchEnv('DEV').switch('Configure', true)
    configure_env(ENV.SHORT)

    // Navigate to the 'Data Sets' tab. DEV: configure.
    cy.navigate('Data Sets')
    configure_dss({ 'fwcy-ds': { ds: null, ...DS.SHORT, dep: DS_DEP.SHORT, ing: DS_ING.SHORT } })

    // Click the 'CREATE' button. Check the error message.
    cy.create()
    cy.navigate('Data Sets')
    cy.get('table td > button[aria-label="Edit"]', LF).click()
    const label = 'DataSet'
    cy.checkErr({ err: `"${label}" is required!`, next_to: 'field', label })
}

function blank__dss_tab_tab_nm__test() {
    // Configure common. DEV: enable and configure.
    configure_common({ dc: 'fwcy-dc', ing: 'jdbc', conf_dc: false, conf_dss: true })
    cy.switchEnv('DEV').switch('Configure', true)
    configure_env(ENV.SHORT)

    // Navigate to the 'Data Sets' tab. DEV: configure.
    cy.navigate('Data Sets')
    configure_dss({ 'fwcy-ds': { ...DS.SHORT, tab: null, dep: DS_DEP.SHORT, ing: DS_ING.SHORT } })

    // Click the 'CREATE' button. Check the error message.
    cy.create()
    cy.navigate('Data Sets')
    cy.get('table td > button[aria-label="Edit"]', LF).click()
    const label = 'Table Name'
    cy.checkErr({ err: `"${label}" is required!`, next_to: 'field', label })
}

function blank__dss_tab_cols__test() {
    // Configure common. DEV: enable and configure.
    configure_common({ dc: 'fwcy-dc', ing: 'jdbc', conf_dc: false, conf_dss: true })
    cy.switchEnv('DEV').switch('Configure', true)
    configure_env(ENV.SHORT)

    // Navigate to the 'Data Sets' tab. DEV: configure.
    cy.navigate('Data Sets')
    configure_dss({ 'fwcy-ds': { ...DS.SHORT, cols: null, dep: DS_DEP.SHORT, ing: DS_ING.SHORT } })

    // Click the 'CREATE' button. Check the error message.
    cy.create()
    cy.navigate('Data Sets')
    cy.get('table td > button[aria-label="Edit"]', LF).click()
    const label = 'Columns'
    cy.checkErr({ err: `"${label}" is required!`, next_to: 'field', label })
}

function blank__dss_tab_fetch_size__test() {
    // Configure common. DEV: enable and configure.
    configure_common({ dc: 'fwcy-dc', ing: 'jdbc', conf_dc: false, conf_dss: true })
    cy.switchEnv('DEV').switch('Configure', true)
    configure_env(ENV.SHORT)

    // Navigate to the 'Data Sets' tab. DEV: configure.
    cy.navigate('Data Sets')
    configure_dss({ 'fwcy-ds': { ...DS.SHORT, fetch_size: null, dep: DS_DEP.SHORT, ing: DS_ING.SHORT } })

    // Click the 'CREATE' button. Check the error message.
    cy.create()
    cy.navigate('Data Sets')
    cy.get('table td > button[aria-label="Edit"]', LF).click()
    const label = 'Fetch Size'
    cy.checkErr({ err: `"${label}" is required!`, next_to: 'field', label })
}

function blank__dss_dep_jvm__test() {
    // Configure common. DEV: enable and configure.
    configure_common({ dc: 'fwcy-dc', ing: 'jdbc', conf_dc: false, conf_dss: true })
    cy.switchEnv('DEV').switch('Configure', true)
    configure_env(ENV.SHORT)

    // Navigate to the 'Data Sets' tab. DEV: configure.
    cy.navigate('Data Sets')
    configure_dss({ 'fwcy-ds': { ...DS.SHORT, dep: { ...DS_DEP.SHORT, jvm: null }, ing: DS_ING.SHORT } })

    // Click the 'CREATE' button. Check the error message.
    cy.create()
    cy.navigate('Data Sets')
    cy.get('table td > button[aria-label="Edit"]', LF).click()
    const label = 'JVM Options'
    cy.checkErr({ err: `"${label}" is required!`, next_to: 'field', label })
}

function blank__dss_ing_bblock_size__test() {
    // Configure common. DEV: enable and configure.
    configure_common({ dc: 'fwcy-dc', ing: 'jdbc', conf_dc: false, conf_dss: true })
    cy.switchEnv('DEV').switch('Configure', true)
    configure_env(ENV.SHORT)

    // Navigate to the 'Data Sets' tab. DEV: configure.
    cy.navigate('Data Sets')
    configure_dss({ 'fwcy-ds': { ...DS.SHORT, dep: DS_DEP.SHORT, ing: { ...DS_ING.SHORT, bblock: null } } })

    // Click the 'CREATE' button. Check the error message.
    cy.create()
    cy.navigate('Data Sets')
    cy.get('table td > button[aria-label="Edit"]', LF).click()
    const label = 'Blob block size mb'
    cy.checkErr({ err: `"${label}" is required!`, next_to: 'field', label })
}

function blank__dss_ing_chunk_size__test() {
    // Configure common. DEV: enable and configure.
    configure_common({ dc: 'fwcy-dc', ing: 'jdbc', conf_dc: false, conf_dss: true })
    cy.switchEnv('DEV').switch('Configure', true)
    configure_env(ENV.SHORT)

    // Navigate to the 'Data Sets' tab. DEV: configure.
    cy.navigate('Data Sets')
    configure_dss({ 'fwcy-ds': { ...DS.SHORT, dep: DS_DEP.SHORT, ing: { ...DS_ING.SHORT, cs: null } } })

    // Click the 'CREATE' button. Check the error message.
    cy.create()
    cy.navigate('Data Sets')
    cy.get('table td > button[aria-label="Edit"]', LF).click()
    const label = 'Chunk Size'
    cy.checkErr({ err: `"${label}" is required!`, next_to: 'field', label })
}

function invalid__dc_dc__test() {
    // Configure common. DEV: enable and configure.
    configure_common({ ing: 'jdbc', conf_dc: true, conf_dss: false })
    cy.switchEnv('DEV').switch('Configure', true)
    configure_env(ENV.SHORT)

    // Click the 'CREATE' button. Check the error message for every incorrect DC.
    const label = 'Data Collection'
    const err = `Incorrect "${label}". It must be a 3+ characters string starting with a letter, and containing only lowercase letters, numbers, and dashes!`
    const check = dc => {
        configure_common({ dc })
        cy.create()
        cy.navigate('Ingestion')
        cy.checkErr({ err, next_to: 'field', label })
    }
    check('cy')        // Too short.
    check('fwcy dc')   // Contains whitespace character.
    check('fwcy_dc')   // Contains underscore.
    check('FWCY-DC')   // Contains capital letters.
    check('12345')     // Starts W/ a digit.
    check('fwcy.$@dc') // Contains special characters.
}

function invalid__dc_url__test() {
    // Configure common. DEV: enable and configure.
    configure_common({ dc: 'fwcy-dc', ing: 'jdbc', conf_dc: true, conf_dss: false })
    cy.switchEnv('DEV').switch('Configure', true)
    configure_env({ ...ENV.SHORT, url: 'fwcy-invalid-url' })

    // Click the 'CREATE' button. Check the error message.
    cy.create()
    cy.navigate('Ingestion')
    const label = 'Url'
    const err = `Incorrect "${label}". It must be a valid JDBC connection string!`
    cy.checkErr({ err, next_to: 'field', label })
}

function invalid__dss_ds__test() {
    // Configure common. DEV: enable and configure.
    configure_common({ dc: 'fwcy-dc', ing: 'jdbc', conf_dc: false, conf_dss: true })
    cy.switchEnv('DEV').switch('Configure', true)
    configure_env(ENV.SHORT)

    // Navigate to the 'Data Sets' tab. DEV: configure.
    cy.navigate('Data Sets')
    configure_dss({ 'fwcy-ds': { ...DS.SHORT, dep: DS_DEP.SHORT, ing: DS_ING.SHORT } })

    // Type/retype incorrect value. Click the 'CREATE' button. Check the error message.
    cy.get('table td > button[aria-label="Edit"]', LF).click()
    const label = 'DataSet'
    const err = `Incorrect "${label}". It must be a 3+ characters string starting with a letter, and containing only lowercase letters, numbers, and dashes!`
    const check = (type) => {
        cy.get('mat-dialog-container', LF).field({ type, into: label, clear: true })
        cy.get('mat-dialog-container', LF).contains('button', 'Save', LF).click()
        cy.create()
        cy.navigate('Data Sets')
        cy.get('table td > button[aria-label="Edit"]', LF).click()
        cy.checkErr({ err, next_to: 'field', label })
    }
    check('cy')        // Too short.
    check('fwcy ds')   // Contains whitespace character.
    check('fwcy_ds')   // Contains underscore.
    check('FWCY-DS')   // Contains capital letters.
    check('12345')     // Starts W/ a digit.
    check('fwcy.$@ds') // Contains special characters.
}

function invalid__dss_tab_tab_nm__test() {
    // Configure common. DEV: enable and configure.
    configure_common({ dc: 'fwcy-dc', ing: 'jdbc', conf_dc: false, conf_dss: true })
    cy.switchEnv('DEV').switch('Configure', true)
    configure_env(ENV.SHORT)

    // Navigate to the 'Data Sets' tab. DEV: configure.
    cy.navigate('Data Sets')
    configure_dss({ 'fwcy-ds': { ...DS.SHORT, dep: DS_DEP.SHORT, ing: DS_ING.SHORT } })

    // Type/retype incorrect value. Click the 'CREATE' button. Check the error message.
    cy.get('table td > button[aria-label="Edit"]', LF).click()
    const label = 'Table Name'
    const err = `Incorrect "${label}". It must be a string containing two alpha-numeric words (underscores are allowed) separated with a dot!`
    const check = (type) => {
        cy.get('mat-dialog-container', LF).field({ type, into: label, clear: true })
        cy.get('mat-dialog-container', LF).contains('button', 'Save', LF).click()
        cy.create()
        cy.navigate('Data Sets')
        cy.get('table td > button[aria-label="Edit"]', LF).click()
        cy.checkErr({ err, next_to: 'field', label })
    }
    check('fwcy_tab')       // Not containing a dot.
    check('fwcy.tab-name')  // Contains a dash.
    check('fwcy.')          // One word/part is missing.
}

function invalid__dss_tab_fetch_size__test() {
    // Configure common. DEV: enable and configure.
    configure_common({ dc: 'fwcy-dc', ing: 'jdbc', conf_dc: false, conf_dss: true })
    cy.switchEnv('DEV').switch('Configure', true)
    configure_env(ENV.SHORT)

    // Navigate to the 'Data Sets' tab. DEV: configure.
    cy.navigate('Data Sets')
    cy.switchEnv('DEV')
    configure_dss({ 'fwcy-ds': { ...DS.SHORT, fetch_size: 1000.5, dep: DS_DEP.SHORT, ing: DS_ING.SHORT } })

    // Click the 'CREATE' button. Check the error message.
    cy.create()
    cy.navigate('Data Sets')
    cy.get('table td > button[aria-label="Edit"]', LF).click()
    const label = 'Fetch Size'
    const err = `Incorrect "${label}". It must be an integer number higher than or equal to 1 and less than or equal to 9223372036854775807!`
    cy.get('mat-dialog-container', LF).checkErr({ err, next_to: 'field', label })
}

function invalid__dss_dep_jads__test() {
    // Configure common. DEV: enable and configure.
    configure_common({ dc: 'fwcy-dc', ing: 'jdbc', conf_dc: false, conf_dss: true })
    cy.switchEnv('DEV').switch('Configure', true)
    configure_env(ENV.SHORT)

    // Navigate to the 'Data Sets' tab. DEV: configure.
    cy.navigate('Data Sets')
    cy.switchEnv('DEV')
    configure_dss({ 'fwcy-ds': { ...DS.SHORT, dep: { ...DS_DEP.SHORT, jads: 1000000.5 }, ing: DS_ING.SHORT } })

    // Click the 'CREATE' button. Check the error message.
    cy.create()
    cy.navigate('Data Sets')
    cy.get('table td > button[aria-label="Edit"]', LF).click()
    const label = 'Job Active Deadline Seconds'
    const err = `Incorrect "${label}"! It must be an integer higher than or equal to 0 and less than or equal to 9223372036854775807!`
	cy.checkErr({ err, next_to: 'field', label })
}

function invalid__dss_dep_k8s_cpu__test() {
    // Configure common. DEV: enable and configure.
    configure_common({ dc: 'fwcy-dc', ing: 'jdbc', conf_dc: false, conf_dss: true })
    cy.switchEnv('DEV').switch('Configure', true)
    configure_env(ENV.SHORT)

    // Navigate to the 'Data Sets' tab. DEV: configure.
    cy.navigate('Data Sets')
    cy.switchEnv('DEV')
    configure_dss({ 'fwcy-ds': { ...DS.SHORT, dep: { ...DS_DEP.SHORT, k8s_cpu: 1000000.5 }, ing: DS_ING.SHORT } })

    // Click the 'CREATE' button. Check the error message.
    cy.create()
    cy.navigate('Data Sets')
    cy.get('table td > button[aria-label="Edit"]', LF).click()
    const label = 'K8S Resource CPU'
    const err = `Incorrect "${label}"! It must be an integer higher than or equal to 1 and less than or equal to 9223372036854775807!`
	cy.checkErr({ err, next_to: 'field', label })
}

function invalid__dss_dep_k8s_ram__test() {
    // Configure common. DEV: enable and configure.
    configure_common({ dc: 'fwcy-dc', ing: 'jdbc', conf_dc: false, conf_dss: true })
    cy.switchEnv('DEV').switch('Configure', true)
    configure_env(ENV.SHORT)

    // Navigate to the 'Data Sets' tab. DEV: configure.
    cy.navigate('Data Sets')
    cy.switchEnv('DEV')
    configure_dss({ 'fwcy-ds': { ...DS.SHORT, dep: { ...DS_DEP.SHORT, k8s_ram: '15.5Gi' }, ing: DS_ING.SHORT } })

    // Click the 'CREATE' button. Check the error message.
    cy.create()
    cy.navigate('Data Sets')
    cy.get('table td > button[aria-label="Edit"]', LF).click()
    const label = 'K8S Resource Memory'
    const err = `Incorrect "${label}"! It must be an integer higher than or equal to 1 and less than or equal to 32 with a "Gi" at the end!`
	cy.checkErr({ err, next_to: 'field', label })
}

function invalid__dss_dep_m__test() {
    // Configure common. DEV: enable and configure.
    configure_common({ dc: 'fwcy-dc', ing: 'jdbc', conf_dc: false, conf_dss: true })
    cy.switchEnv('DEV').switch('Configure', true)
    configure_env(ENV.SHORT)

    // Navigate to the 'Data Sets' tab. DEV: configure.
    cy.navigate('Data Sets')
    cy.switchEnv('DEV')
    configure_dss({ 'fwcy-ds': { ...DS.SHORT, dep: { ...DS_DEP.SHORT, m: 30.5 }, ing: DS_ING.SHORT } })

    // Click the 'CREATE' button. Check the error message.
    cy.create()
    cy.navigate('Data Sets')
    cy.get('table td > button[aria-label="Edit"]', LF).click()
    const label = 'Minute - JobSchedule'
    const err = `Incorrect "${label}"! It must be an integer higher than or equal to 0 and less than or equal to 59!`
	cy.checkErr({ err, next_to: 'field', label })
}

function invalid__dss_dep_h__test() {
    // Configure common. DEV: enable and configure.
    configure_common({ dc: 'fwcy-dc', ing: 'jdbc', conf_dc: false, conf_dss: true })
    cy.switchEnv('DEV').switch('Configure', true)
    configure_env(ENV.SHORT)

    // Navigate to the 'Data Sets' tab. DEV: configure.
    cy.navigate('Data Sets')
    cy.switchEnv('DEV')
    configure_dss({ 'fwcy-ds': { ...DS.SHORT, dep: { ...DS_DEP.SHORT, h: 10.5 }, ing: DS_ING.SHORT } })

    // Click the 'CREATE' button. Check the error message.
    cy.create()
    cy.navigate('Data Sets')
    cy.get('table td > button[aria-label="Edit"]', LF).click()
    const label = 'Hour - Hour'
    const err = `Incorrect "${label}"! It must be an integer higher than or equal to 0 and less than or equal to 23!`
	cy.checkErr({ err, next_to: 'field', label })
}

function invalid__dss_dep_d__test() {
    // Configure common. DEV: enable and configure.
    configure_common({ dc: 'fwcy-dc', ing: 'jdbc', conf_dc: false, conf_dss: true })
    cy.switchEnv('DEV').switch('Configure', true)
    configure_env(ENV.SHORT)

    // Navigate to the 'Data Sets' tab. DEV: configure.
    cy.navigate('Data Sets')
    cy.switchEnv('DEV')
    configure_dss({ 'fwcy-ds': { ...DS.SHORT, dep: { ...DS_DEP.SHORT, d: 10.5 }, ing: DS_ING.SHORT } })

    // Click the 'CREATE' button. Check the error message.
    cy.create()
    cy.navigate('Data Sets')
    cy.get('table td > button[aria-label="Edit"]', LF).click()
    const label = 'Day of Month - JobSchedule'
    const err = `Incorrect "${label}"! It must be an integer higher than or equal to 1 and less than or equal to 31!`
	cy.checkErr({ err, next_to: 'field', label })
}

function invalid__dss_ing_bblock_size__test() {
    // Configure common. DEV: enable and configure.
    configure_common({ dc: 'fwcy-dc', ing: 'jdbc', conf_dc: false, conf_dss: true })
    cy.switchEnv('DEV').switch('Configure', true)
    configure_env(ENV.SHORT)

    // Navigate to the 'Data Sets' tab. DEV: configure.
    cy.navigate('Data Sets')
    cy.switchEnv('DEV')
    configure_dss({ 'fwcy-ds': { ...DS.SHORT, dep: DS_DEP.SHORT, ing: { ...DS_ING.SHORT, bblock: 1000000.5 } } })

    // Click the 'CREATE' button. Check the error message.
    cy.create()
    cy.navigate('Data Sets')
    cy.get('table td > button[aria-label="Edit"]', LF).click()
    const label = 'Blob block size mb'
    const err = `Incorrect "${label}"! It must be an integer higher than or equal to 1 and less than or equal to 9223372036854775807!`
	cy.checkErr({ err, next_to: 'field', label })
}

function invalid__dss_ing_bbuff_size__test() {
    // Configure common. DEV: enable and configure.
    configure_common({ dc: 'fwcy-dc', ing: 'jdbc', conf_dc: false, conf_dss: true })
    cy.switchEnv('DEV').switch('Configure', true)
    configure_env(ENV.SHORT)

    // Navigate to the 'Data Sets' tab. DEV: configure.
    cy.navigate('Data Sets')
    cy.switchEnv('DEV')
    configure_dss({ 'fwcy-ds': { ...DS.SHORT, dep: DS_DEP.SHORT, ing: { ...DS_ING.SHORT, bbuff: 1000000.5 } } })

    // Click the 'CREATE' button. Check the error message.
    cy.create()
    cy.navigate('Data Sets')
    cy.get('table td > button[aria-label="Edit"]', LF).click()
    const label = 'Blob buffer size mb'
    const err = `Incorrect "${label}"! It must be an integer higher than or equal to 1 and less than or equal to 9223372036854775807!`
	cy.checkErr({ err, next_to: 'field', label })
}

function invalid__dss_ing_chunk_size__test() {
    // Configure common. DEV: enable and configure.
    configure_common({ dc: 'fwcy-dc', ing: 'jdbc', conf_dc: false, conf_dss: true })
    cy.switchEnv('DEV').switch('Configure', true)
    configure_env(ENV.SHORT)

    // Navigate to the 'Data Sets' tab. DEV: configure.
    cy.navigate('Data Sets')
    cy.switchEnv('DEV')
    configure_dss({ 'fwcy-ds': { ...DS.SHORT, dep: DS_DEP.SHORT, ing: { ...DS_ING.SHORT, cs: 1000000.5 } } })

    // Click the 'CREATE' button. Check the error message.
    cy.create()
    cy.navigate('Data Sets')
    cy.get('table td > button[aria-label="Edit"]', LF).click()
    const label = 'Chunk Size'
    const err = `Incorrect "${label}"! It must be an integer higher than or equal to 1 and less than or equal to 9223372036854775807!`
	cy.checkErr({ err, next_to: 'field', label })
}

function invalid__dss_ing_start_ts__test() {
    // Configure common. DEV: enable and configure.
    configure_common({ dc: 'fwcy-dc', ing: 'jdbc', conf_dc: false, conf_dss: true })
    cy.switchEnv('DEV').switch('Configure', true)
    configure_env(ENV.SHORT)

    // Navigate to the 'Data Sets' tab. DEV: configure.
    cy.navigate('Data Sets')
    cy.switchEnv('DEV')
    configure_dss({ 'fwcy-ds': { ...DS.SHORT, dep: DS_DEP.SHORT, ing: { ...DS_ING.SHORT, ts: '2000-DEC-01T12:00:00' } } })

    // Click the 'CREATE' button. Check the error message.
    cy.create()
    cy.navigate('Data Sets')
    cy.get('table td > button[aria-label="Edit"]', LF).click()
    const label = 'Start tmstp'
    const err = `Incorrect "${label}"! It must be a valid datetime string in format: "YYYY-MM-DD HH:mm:ss"!`
	cy.checkErr({ err, next_to: 'field', label })
}

function ooll__dss_tab_fetch_size__test() {
    // Configure common. DEV: enable and configure.
    configure_common({ dc: 'fwcy-dc', ing: 'jdbc', conf_dc: false, conf_dss: true })
    cy.switchEnv('DEV').switch('Configure', true)
    configure_env(ENV.SHORT)

    // Navigate to the 'Data Sets' tab. DEV: configure.
    cy.navigate('Data Sets')
    configure_dss({ 'fwcy-ds': { ...DS.SHORT, fetch_size: 0, dep: DS_DEP.SHORT, ing: DS_ING.SHORT } })

    // Click the 'CREATE' button. Check the error message.
    cy.create()
    cy.navigate('Data Sets')
    cy.get('table td > button[aria-label="Edit"]', LF).click()
    const label = 'Fetch Size'
    const err = `Incorrect "${label}". It must be an integer number higher than or equal to 1 and less than or equal to 9223372036854775807!`
    cy.get('mat-dialog-container', LF).checkErr({ err, next_to: 'field', label })
}

function oohl__dss_tab_fetch_size__test() {
    // Configure common. DEV: enable and configure.
    configure_common({ dc: 'fwcy-dc', ing: 'jdbc', conf_dc: false, conf_dss: true })
    cy.switchEnv('DEV').switch('Configure', true)
    configure_env(ENV.SHORT)

    // Navigate to the 'Data Sets' tab. DEV: configure.
    cy.navigate('Data Sets')
    configure_dss({ 'fwcy-ds': { ...DS.SHORT, fetch_size: '9223372036854775808', dep: DS_DEP.SHORT, ing: DS_ING.SHORT } })

    // Click the 'CREATE' button. Check the error message.
    cy.create()
    cy.navigate('Data Sets')
    cy.get('table td > button[aria-label="Edit"]', LF).click()
    const label = 'Fetch Size'
    const err = `Incorrect "${label}". It must be an integer number higher than or equal to 1 and less than or equal to 9223372036854775807!`
    cy.get('mat-dialog-container', LF).checkErr({ err, next_to: 'field', label })
}

function ooll__dss_dep_jads__test() {
    // Configure common. TEST, PROD: disable. DEV: enable and configure.
    configure_common({ dc: 'fwcy-dc', ing: 'jdbc', conf_dc: false, conf_dss: true })
    cy.switchEnv('DEV').switch('Configure', true)
    configure_env(ENV.SHORT)

    // Navigate to the 'Data Sets' tab. DEV: configure.
    cy.navigate('Data Sets')
    cy.switchEnv('DEV')
    configure_dss({ 'fwcy-ds': { ...DS.SHORT, dep: { ...DS_DEP.SHORT, jads: -1 }, ing: DS_ING.SHORT } })

    // Click the 'CREATE' button. Check the error message.
    cy.create()
    cy.navigate('Data Sets')
    cy.get('table td > button[aria-label="Edit"]', LF).click()
    const label = 'Job Active Deadline Seconds'
    const err = `Incorrect "${label}"! It must be an integer higher than or equal to 0 and less than or equal to 9223372036854775807!`
    cy.checkErr({ err, next_to: 'field', label })
}

function oohl__dss_dep_jads__test() {
    // Configure common. TEST, PROD: disable. DEV: enable and configure.
    configure_common({ dc: 'fwcy-dc', ing: 'jdbc', conf_dc: false, conf_dss: true })
    cy.switchEnv('DEV').switch('Configure', true)
    configure_env(ENV.SHORT)

    // Navigate to the 'Data Sets' tab. DEV: configure.
    cy.navigate('Data Sets')
    cy.switchEnv('DEV')
    configure_dss({ 'fwcy-ds': { ...DS.SHORT, dep: { ...DS_DEP.SHORT, jads: '9223372036854775808' }, ing: DS_ING.SHORT } })

    // Click the 'CREATE' button. Check the error message.
    cy.create()
    cy.navigate('Data Sets')
    cy.get('table td > button[aria-label="Edit"]', LF).click()
    const label = 'Job Active Deadline Seconds'
    const err = `Incorrect "${label}"! It must be an integer higher than or equal to 0 and less than or equal to 9223372036854775807!`
    cy.checkErr({ err, next_to: 'field', label })
}

function ooll__dss_dep_k8s_cpu__test() {
    // Configure common. TEST, PROD: disable. DEV: enable and configure.
    configure_common({ dc: 'fwcy-dc', ing: 'jdbc', conf_dc: false, conf_dss: true })
    cy.switchEnv('DEV').switch('Configure', true)
    configure_env(ENV.SHORT)

    // Navigate to the 'Data Sets' tab. DEV: configure.
    cy.navigate('Data Sets')
    cy.switchEnv('DEV')
    configure_dss({ 'fwcy-ds': { ...DS.SHORT, dep: { ...DS_DEP.SHORT, k8s_cpu: 0 }, ing: DS_ING.SHORT } })

    // Click the 'CREATE' button. Check the error message.
    cy.create()
    cy.navigate('Data Sets')
    cy.get('table td > button[aria-label="Edit"]', LF).click()
    const label = 'K8S Resource CPU'
    const err = `Incorrect "${label}"! It must be an integer higher than or equal to 1 and less than or equal to 9223372036854775807!`
    cy.checkErr({ err, next_to: 'field', label })
}

function oohl__dss_dep_k8s_cpu__test() {
    // Configure common. TEST, PROD: disable. DEV: enable and configure.
    configure_common({ dc: 'fwcy-dc', ing: 'jdbc', conf_dc: false, conf_dss: true })
    cy.switchEnv('DEV').switch('Configure', true)
    configure_env(ENV.SHORT)

    // Navigate to the 'Data Sets' tab. DEV: configure.
    cy.navigate('Data Sets')
    cy.switchEnv('DEV')
    configure_dss({ 'fwcy-ds': { ...DS.SHORT, dep: { ...DS_DEP.SHORT, k8s_cpu: '9223372036854775808' }, ing: DS_ING.SHORT } })

    // Click the 'CREATE' button. Check the error message.
    cy.create()
    cy.navigate('Data Sets')
    cy.get('table td > button[aria-label="Edit"]', LF).click()
    const label = 'K8S Resource CPU'
    const err = `Incorrect "${label}"! It must be an integer higher than or equal to 1 and less than or equal to 9223372036854775807!`
    cy.checkErr({ err, next_to: 'field', label })
}

function ooll__dss_dep_k8s_ram__test() {
    // Configure common. TEST, PROD: disable. DEV: enable and configure.
    configure_common({ dc: 'fwcy-dc', ing: 'jdbc', conf_dc: false, conf_dss: true })
    cy.switchEnv('DEV').switch('Configure', true)
    configure_env(ENV.SHORT)

    // Navigate to the 'Data Sets' tab. DEV: configure.
    cy.navigate('Data Sets')
    cy.switchEnv('DEV')
    configure_dss({ 'fwcy-ds': { ...DS.SHORT, dep: { ...DS_DEP.SHORT, k8s_ram: '0Gi' }, ing: DS_ING.SHORT } })

    // Click the 'CREATE' button. Check the error message.
    cy.create()
    cy.navigate('Data Sets')
    cy.get('table td > button[aria-label="Edit"]', LF).click()
    const label = 'K8S Resource Memory'
    const err = `Incorrect "${label}"! It must be an integer higher than or equal to 1 and less than or equal to 32 with a "Gi" at the end!`
    cy.checkErr({ err, next_to: 'field', label })
}

function oohl__dss_dep_k8s_ram__test() {
    // Configure common. TEST, PROD: disable. DEV: enable and configure.
    configure_common({ dc: 'fwcy-dc', ing: 'jdbc', conf_dc: false, conf_dss: true })
    cy.switchEnv('DEV').switch('Configure', true)
    configure_env(ENV.SHORT)

    // Navigate to the 'Data Sets' tab. DEV: configure.
    cy.navigate('Data Sets')
    cy.switchEnv('DEV')
    configure_dss({ 'fwcy-ds': { ...DS.SHORT, dep: { ...DS_DEP.SHORT, k8s_ram: '33Gi' }, ing: DS_ING.SHORT } })

    // Click the 'CREATE' button. Check the error message.
    cy.create()
    cy.navigate('Data Sets')
    cy.get('table td > button[aria-label="Edit"]', LF).click()
    const label = 'K8S Resource Memory'
    const err = `Incorrect "${label}"! It must be an integer higher than or equal to 1 and less than or equal to 32 with a "Gi" at the end!`
    cy.checkErr({ err, next_to: 'field', label })
}

function ooll__dss_dep_m__test() {
    // Configure common. TEST, PROD: disable. DEV: enable and configure.
    configure_common({ dc: 'fwcy-dc', ing: 'jdbc', conf_dc: false, conf_dss: true })
    cy.switchEnv('DEV').switch('Configure', true)
    configure_env(ENV.SHORT)

    // Navigate to the 'Data Sets' tab. DEV: configure.
    cy.navigate('Data Sets')
    cy.switchEnv('DEV')
    configure_dss({ 'fwcy-ds': { ...DS.SHORT, dep: { ...DS_DEP.SHORT, m: -1 }, ing: DS_ING.SHORT } })

    // Click the 'CREATE' button. Check the error message.
    cy.create()
    cy.navigate('Data Sets')
    cy.get('table td > button[aria-label="Edit"]', LF).click()
    const label = 'Minute - JobSchedule'
    const err = `Incorrect "${label}"! It must be an integer higher than or equal to 0 and less than or equal to 59!`
    cy.checkErr({ err, next_to: 'field', label })
}

function oohl__dss_dep_m__test() {
    // Configure common. TEST, PROD: disable. DEV: enable and configure.
    configure_common({ dc: 'fwcy-dc', ing: 'jdbc', conf_dc: false, conf_dss: true })
    cy.switchEnv('DEV').switch('Configure', true)
    configure_env(ENV.SHORT)

    // Navigate to the 'Data Sets' tab. DEV: configure.
    cy.navigate('Data Sets')
    cy.switchEnv('DEV')
    configure_dss({ 'fwcy-ds': { ...DS.SHORT, dep: { ...DS_DEP.SHORT, m: 60 }, ing: DS_ING.SHORT } })

    // Click the 'CREATE' button. Check the error message.
    cy.create()
    cy.navigate('Data Sets')
    cy.get('table td > button[aria-label="Edit"]', LF).click()
    const label = 'Minute - JobSchedule'
    const err = `Incorrect "${label}"! It must be an integer higher than or equal to 0 and less than or equal to 59!`
    cy.checkErr({ err, next_to: 'field', label })
}

function ooll__dss_dep_h__test() {
    // Configure common. TEST, PROD: disable. DEV: enable and configure.
    configure_common({ dc: 'fwcy-dc', ing: 'jdbc', conf_dc: false, conf_dss: true })
    cy.switchEnv('DEV').switch('Configure', true)
    configure_env(ENV.SHORT)

    // Navigate to the 'Data Sets' tab. DEV: configure.
    cy.navigate('Data Sets')
    cy.switchEnv('DEV')
    configure_dss({ 'fwcy-ds': { ...DS.SHORT, dep: { ...DS_DEP.SHORT, h: -1 }, ing: DS_ING.SHORT } })

    // Click the 'CREATE' button. Check the error message.
    cy.create()
    cy.navigate('Data Sets')
    cy.get('table td > button[aria-label="Edit"]', LF).click()
    const label = 'Hour - Hour'
    const err = `Incorrect "${label}"! It must be an integer higher than or equal to 0 and less than or equal to 23!`
    cy.checkErr({ err, next_to: 'field', label })
}

function oohl__dss_dep_h__test() {
    // Configure common. TEST, PROD: disable. DEV: enable and configure.
    configure_common({ dc: 'fwcy-dc', ing: 'jdbc', conf_dc: false, conf_dss: true })
    cy.switchEnv('DEV').switch('Configure', true)
    configure_env(ENV.SHORT)

    // Navigate to the 'Data Sets' tab. DEV: configure.
    cy.navigate('Data Sets')
    cy.switchEnv('DEV')
    configure_dss({ 'fwcy-ds': { ...DS.SHORT, dep: { ...DS_DEP.SHORT, h: 24 }, ing: DS_ING.SHORT } })

    // Click the 'CREATE' button. Check the error message.
    cy.create()
    cy.navigate('Data Sets')
    cy.get('table td > button[aria-label="Edit"]', LF).click()
    const label = 'Hour - Hour'
    const err = `Incorrect "${label}"! It must be an integer higher than or equal to 0 and less than or equal to 23!`
    cy.checkErr({ err, next_to: 'field', label })
}

function ooll__dss_dep_d__test() {
    // Configure common. TEST, PROD: disable. DEV: enable and configure.
    configure_common({ dc: 'fwcy-dc', ing: 'jdbc', conf_dc: false, conf_dss: true })
    cy.switchEnv('DEV').switch('Configure', true)
    configure_env(ENV.SHORT)

    // Navigate to the 'Data Sets' tab. DEV: configure.
    cy.navigate('Data Sets')
    cy.switchEnv('DEV')
    configure_dss({ 'fwcy-ds': { ...DS.SHORT, dep: { ...DS_DEP.SHORT, d: 0 }, ing: DS_ING.SHORT } })

    // Click the 'CREATE' button. Check the error message.
    cy.create()
    cy.navigate('Data Sets')
    cy.get('table td > button[aria-label="Edit"]', LF).click()
    const label = 'Day of Month - JobSchedule'
    const err = `Incorrect "${label}"! It must be an integer higher than or equal to 1 and less than or equal to 31!`
    cy.checkErr({ err, next_to: 'field', label })
}

function oohl__dss_dep_d__test() {
    // Configure common. TEST, PROD: disable. DEV: enable and configure.
    configure_common({ dc: 'fwcy-dc', ing: 'jdbc', conf_dc: false, conf_dss: true })
    cy.switchEnv('DEV').switch('Configure', true)
    configure_env(ENV.SHORT)

    // Navigate to the 'Data Sets' tab. DEV: configure.
    cy.navigate('Data Sets')
    cy.switchEnv('DEV')
    configure_dss({ 'fwcy-ds': { ...DS.SHORT, dep: { ...DS_DEP.SHORT, d: 32 }, ing: DS_ING.SHORT } })

    // Click the 'CREATE' button. Check the error message.
    cy.create()
    cy.navigate('Data Sets')
    cy.get('table td > button[aria-label="Edit"]', LF).click()
    const label = 'Day of Month - JobSchedule'
    const err = `Incorrect "${label}"! It must be an integer higher than or equal to 1 and less than or equal to 31!`
    cy.checkErr({ err, next_to: 'field', label })
}

function ooll__dss_ing_bblock_size__test() {
    // Configure common. TEST, PROD: disable. DEV: enable and configure.
    configure_common({ dc: 'fwcy-dc', ing: 'jdbc', conf_dc: false, conf_dss: true })
    cy.switchEnv('DEV').switch('Configure', true)
    configure_env(ENV.SHORT)

    // Navigate to the 'Data Sets' tab. DEV: configure.
    cy.navigate('Data Sets')
    cy.switchEnv('DEV')
    configure_dss({ 'fwcy-ds': { ...DS.SHORT, dep: DS_DEP.SHORT, ing: { ...DS_ING.SHORT, bblock: 0 } } })

    // Click the 'CREATE' button. Check the error message.
    cy.create()
    cy.navigate('Data Sets')
    cy.get('table td > button[aria-label="Edit"]', LF).click()
    const label = 'Blob block size mb'
    const err = `Incorrect "${label}"! It must be an integer higher than or equal to 1 and less than or equal to 9223372036854775807!`
    cy.checkErr({ err, next_to: 'field', label })
}

function oohl__dss_ing_bblock_size__test() {
    // Configure common. TEST, PROD: disable. DEV: enable and configure.
    configure_common({ dc: 'fwcy-dc', ing: 'jdbc', conf_dc: false, conf_dss: true })
    cy.switchEnv('DEV').switch('Configure', true)
    configure_env(ENV.SHORT)

    // Navigate to the 'Data Sets' tab. DEV: configure.
    cy.navigate('Data Sets')
    cy.switchEnv('DEV')
    configure_dss({ 'fwcy-ds': { ...DS.SHORT, dep: DS_DEP.SHORT, ing: { ...DS_ING.SHORT, bblock: '9223372036854775808' } } })

    // Click the 'CREATE' button. Check the error message.
    cy.create()
    cy.navigate('Data Sets')
    cy.get('table td > button[aria-label="Edit"]', LF).click()
    const label = 'Blob block size mb'
    const err = `Incorrect "${label}"! It must be an integer higher than or equal to 1 and less than or equal to 9223372036854775807!`
    cy.checkErr({ err, next_to: 'field', label })
}

function ooll__dss_ing_bbuff_size__test() {
    // Configure common. TEST, PROD: disable. DEV: enable and configure.
    configure_common({ dc: 'fwcy-dc', ing: 'jdbc', conf_dc: false, conf_dss: true })
    cy.switchEnv('DEV').switch('Configure', true)
    configure_env(ENV.SHORT)

    // Navigate to the 'Data Sets' tab. DEV: configure.
    cy.navigate('Data Sets')
    cy.switchEnv('DEV')
    configure_dss({ 'fwcy-ds': { ...DS.SHORT, dep: DS_DEP.SHORT, ing: { ...DS_ING.SHORT, bbuff: 0 } } })

    // Click the 'CREATE' button. Check the error message.
    cy.create()
    cy.navigate('Data Sets')
    cy.get('table td > button[aria-label="Edit"]', LF).click()
    const label = 'Blob buffer size mb'
    const err = `Incorrect "${label}"! It must be an integer higher than or equal to 1 and less than or equal to 9223372036854775807!`
    cy.checkErr({ err, next_to: 'field', label })
}

function oohl__dss_ing_bbuff_size__test() {
    // Configure common. TEST, PROD: disable. DEV: enable and configure.
    configure_common({ dc: 'fwcy-dc', ing: 'jdbc', conf_dc: false, conf_dss: true })
    cy.switchEnv('DEV').switch('Configure', true)
    configure_env(ENV.SHORT)

    // Navigate to the 'Data Sets' tab. DEV: configure.
    cy.navigate('Data Sets')
    cy.switchEnv('DEV')
    configure_dss({ 'fwcy-ds': { ...DS.SHORT, dep: DS_DEP.SHORT, ing: { ...DS_ING.SHORT, bbuff: '9223372036854775808' } } })

    // Click the 'CREATE' button. Check the error message.
    cy.create()
    cy.navigate('Data Sets')
    cy.get('table td > button[aria-label="Edit"]', LF).click()
    const label = 'Blob buffer size mb'
    const err = `Incorrect "${label}"! It must be an integer higher than or equal to 1 and less than or equal to 9223372036854775807!`
    cy.checkErr({ err, next_to: 'field', label })
}

function ooll__dss_ing_chunk_size__test() {
    // Configure common. TEST, PROD: disable. DEV: enable and configure.
    configure_common({ dc: 'fwcy-dc', ing: 'jdbc', conf_dc: false, conf_dss: true })
    cy.switchEnv('DEV').switch('Configure', true)
    configure_env(ENV.SHORT)

    // Navigate to the 'Data Sets' tab. DEV: configure.
    cy.navigate('Data Sets')
    cy.switchEnv('DEV')
    configure_dss({ 'fwcy-ds': { ...DS.SHORT, dep: DS_DEP.SHORT, ing: { ...DS_ING.SHORT, cs: 0 } } })

    // Click the 'CREATE' button. Check the error message.
    cy.create()
    cy.navigate('Data Sets')
    cy.get('table td > button[aria-label="Edit"]', LF).click()
    const label = 'Chunk Size'
    const err = `Incorrect "${label}"! It must be an integer higher than or equal to 1 and less than or equal to 9223372036854775807!`
    cy.checkErr({ err, next_to: 'field', label })
}

function oohl__dss_ing_chunk_size__test() {
    // Configure common. TEST, PROD: disable. DEV: enable and configure.
    configure_common({ dc: 'fwcy-dc', ing: 'jdbc', conf_dc: false, conf_dss: true })
    cy.switchEnv('DEV').switch('Configure', true)
    configure_env(ENV.SHORT)

    // Navigate to the 'Data Sets' tab. DEV: configure.
    cy.navigate('Data Sets')
    cy.switchEnv('DEV')
    configure_dss({ 'fwcy-ds': { ...DS.SHORT, dep: DS_DEP.SHORT, ing: { ...DS_ING.SHORT, cs: '9223372036854775808' } } })

    // Click the 'CREATE' button. Check the error message.
    cy.create()
    cy.navigate('Data Sets')
    cy.get('table td > button[aria-label="Edit"]', LF).click()
    const label = 'Chunk Size'
    const err = `Incorrect "${label}"! It must be an integer higher than or equal to 1 and less than or equal to 9223372036854775807!`
    cy.checkErr({ err, next_to: 'field', label })
}

function oth__no_envs__test() {
    // Configure common. DEV, TEST, PROD: disable.
    configure_common({ dc: 'fwcy-dc', ing: 'jdbc', conf_dc: true, conf_dss: true })
    cy.switchEnv('DEV').switch('Configure', false)
    cy.switchEnv('TEST').switch('Configure', false)
    cy.switchEnv('PROD').switch('Configure', false)

    // Click the 'CREATE' button. Check the error message.
    cy.create()
	cy.checkErr({ err: 'At least one environment must be enabled!', next_to: 'switch', label: 'Configure' })
}

function oth__no_dss__test() {
    // Configure common. DEV: enable and configure.
    configure_common({ dc: 'fwcy-dc', ing: 'jdbc', conf_dc: false, conf_dss: true })
    cy.switchEnv('DEV').switch('Configure', true)
    configure_env(ENV.SHORT)

    // Click the 'CREATE' button. Check the error message.
    cy.create()
    cy.navigate('Data Sets')
    const err = 'At least one data set must be configured!'
    cy.get('app-datasets-tab section p.fdx-u-color--error', LF).invoke('text').should('eq', err)
}

function close__test() {
	cy.exit()
	cy.checkOnWelcomePage()
}

describe(
    'Batch Ingestiong wizard ("jdbc" ingestion type) test suit.',
    () => {
        // before(() => { cy.login() })
        beforeEach(() => {
			reset_window()
            // cy.restoreLocalStorage()
            // cy.visit('/')
            // cy.open('Create Batch Ingestion')
        })
        // Create:
        it.only('(C+) Create W/ DS and DSs disabled.',            create__no_dc__no_dss__test)
        it('(C+) Create only DC.',                           create__dc__test)  // Note: it's impossible to create minimum configuration (all fields are required).
        it.only('(C+) Create only DSs W/ minimal configuration.', create__dss_min__test)
        it('(C+) Create only DSs W/ maximum configuration.', create__dss_max__test)
        it('(C+) Create DC and DSs.',                        create__dc__dss__test)
        it('(C+) Create W/ all environments configured.',    create__all_envs__test)
        // Limits:
        it('(M+) Lower limit value for the DSs "Fetch Size" field.',                          ll__dss_tab_fetch_size__test)
        it('(M+) Higher limit value for the DSs "Fetch Size" field.',                         hl__dss_tab_fetch_size__test)
        it('(M+) Lower limit value for the DSs Deploy "Job Active Deadline Seconds" field.',  ll__dss_dep_jads__test)
        it('(M+) Higher limit value for the DSs Deploy "Job Active Deadline Seconds" field.', hl__dss_dep_jads__test)
        // it('(M+) Lower limit value for the DSs Deploy "JVM Options" field.',                  ll__dss_dep_jvm__test)  // TODO: clarify limits W/ Yevheniia.
        // it('(M+) Higher limit value for the DSs Deploy "JVM Options" field.',                 hl__dss_dep_jvm__test)  // TODO: clarify limits W/ Yevheniia.
        it('(M+) Lower limit value for the DSs Deploy "K8S Resource CPU" field.',             ll__dss_dep_k8s_cpu__test)
        it('(M+) Higher limit value for the DSs Deploy "K8S Resource CPU" field.',            hl__dss_dep_k8s_cpu__test)
        it('(M+) Lower limit value for the DSs Deploy "K8S Resource Memory" field.',          ll__dss_dep_k8s_ram__test)
        it('(M+) Higher limit value for the DSs Deploy "K8S Resource Memory" field.',         hl__dss_dep_k8s_ram__test)
        it('(M+) Lower limit value for the DSs Deploy "Minute - JobSchedule" field.',         ll__dss_dep_m__test)
        it('(M+) Higher limit value for the DSs Deploy "Minute - JobSchedule" field.',        hl__dss_dep_m__test)
        it('(M+) Lower limit value for the DSs Deploy "Hour - Hour" field.',                  ll__dss_dep_h__test)
        it('(M+) Higher limit value for the DSs Deploy "Hour - Hour" field.',                 hl__dss_dep_h__test)
        it('(M+) Lower limit value for the DSs Deploy "Day of Month - JobSchedule" field.',   ll__dss_dep_d__test)
        it('(M+) Higher limit value for the DSs Deploy "Day of Month - JobSchedule" field.',  hl__dss_dep_d__test)
        it('(M+) Lower limit value for the DSs Ingestion "Blob block size mb" field.',        ll__dss_ing_bblock_size__test)
        it('(M+) Higher limit value for the DSs Ingestion "Blob block size mb" field.',       hl__dss_ing_bblock_size__test)
        it('(M+) Lower limit value for the DSs Ingestion "Blob buffer size mb" field.',       ll__dss_ing_bbuff_size__test)
        it('(M+) Higher limit value for the DSs Ingestion "Blob buffer size mb" field.',      hl__dss_ing_bbuff_size__test)
        it('(M+) Lower limit value for the DSs Ingestion "Chunk Size" field.',                ll__dss_ing_chunk_size__test)
        it('(M+) Higher limit value for the DSs Ingestion "Chunk Size" field.',               hl__dss_ing_chunk_size__test)
        // Update:
        it('(M+) Update DC.',  update__dc__test)
        it.only('(M+) Update DSs.', update__dss__test)
        // Dropdown options:
        // TODO: add wizard dropdown options tests here...
        // Blanks:
        it('(L-) Blank DC "Data Collection" field.',              blank__dc_dc__test)
        it('(L-) Blank DC "Ingestion Type" field.',               blank__dc_ing__test)
        it('(L-) Blank DC "Url" field.',                          blank__dc_url__test)
        it('(L-) Blank DC "Username" field.',                     blank__dc_username__test)
        it('(L-) Blank DSs "DataSet" field.',                     blank__dss_ds__test)
        it('(L-) Blank DSs Table "Table Name" field.',            blank__dss_tab_tab_nm__test)
        it('(L-) Blank DSs Table "Columns" field.',               blank__dss_tab_cols__test)
        it('(L-) Blank DSs Table "Fetch Size" field.',            blank__dss_tab_fetch_size__test)
        it('(L-) Blank DSs Deploy "JVM Options" field',           blank__dss_dep_jvm__test)
        it('(L-) Blank DSs Ingestion "Blob block size mb" field', blank__dss_ing_bblock_size__test)
        it('(L-) Blank DSs Ingestion "Chunk Size" field',         blank__dss_ing_chunk_size__test)
        // Invalid values:
        it('(L-) Invalid value for the DC "Data Collection" field.',                        invalid__dc_dc__test)
        it('(L-) Invalid value for the DC "Url" field.',                                    invalid__dc_url__test)
        // it('(L-) Invalid value for the "Username" field.',                                  invalid__dc_username__test)                // TODO: Ask Yevheniia is there any validation at all.
        it('(L-) Invalid value for the DSs "DataSet" field.',                               invalid__dss_ds__test)
        it('(L-) Invalid value for the DSs Table "Table Name" field.',                      invalid__dss_tab_tab_nm__test)
        // it('(L-) Invalid value for the DSs Table "Columns" field.',                         invalid__dss_tab_cols__test)            // TODO: Ask Yevheniia, what validation/regex is used here.
        // it('(L-) Invalid value for the DSs Table "Watermark Column" field.',                invalid__dss_tab_watermark_col__test)   // TODO: Ask Yevheniia, what validation/regex is used here.
        // it('(L-) Invalid value for the DSs Table "Max Timestamp Column Name" field.',       invalid__dss_tab_max_ts_col_nm__test)   // TODO: Ask Yevheniia, what validation/regex is used here.
        // it('(L-) Invalid value for the DSs Table "Where Clause" field.',                    invalid__dss_tab_wc__test)              // TODO: Ask Yevheniia is there any validation at all.
        // it('(L-) Invalid value for the DSs Table "Where clause max timestamp" field.',      invalid__dss_tab_wc_max_ts__test)       // TODO: Ask Yevheniia is there any validation at all.
        // it('(L-) Invalid value for the DSs Table "Init where clause max timestamp" field.', invalid__dss_tab_init_wc_max_ts__test)  // TODO: Ask Yevheniia is there any validation at all.
        it('(L-) Invalid value for the DSs Table "Fetch Size" field.',                      invalid__dss_tab_fetch_size__test)
        it('(L-) Invalid value for the DSs Deploy "Job Active Deadline Seconds" field.',    invalid__dss_dep_jads__test)
        // it('(L-) Invalid value for the DSs Deploy "JVM Options" field.',                    invalid__dss_dep_jvm__test)  // TODO: Ask Yevheniia about validation rules.
        it('(L-) Invalid value for the DSs Deploy "K8S Resource CPU" field.',               invalid__dss_dep_k8s_cpu__test)
        it('(L-) Invalid value for the DSs Deploy "K8S Resource Memory" field.',            invalid__dss_dep_k8s_ram__test)
        it('(L-) Invalid value for the DSs Deploy "Minute - JobSchedule" field.',           invalid__dss_dep_m__test)
        it('(L-) Invalid value for the DSs Deploy "Hour - Hour" field.',                    invalid__dss_dep_h__test)
        it('(L-) Invalid value for the DSs Deploy "Day of Month - JobSchedule" field.',     invalid__dss_dep_d__test)
        it('(L-) Invalid value for the DSs Ingestion "Blob block size mb" field.',          invalid__dss_ing_bblock_size__test)
        it('(L-) Invalid value for the DSs Ingestion "Blob buffer size mb" field.',         invalid__dss_ing_bbuff_size__test)
        it('(L-) Invalid value for the DSs Ingestion "Chunk Size" field.',                  invalid__dss_ing_chunk_size__test)
        it('(L-) Invalid value for the DSs Ingestion "Start tmstp" field.',                 invalid__dss_ing_start_ts__test)  // TODO: Ask Yevheniia is there a dt validation (can we type February 31th for instance?).
        // Out-of-limit values:
        it('(L-) Out-of-lower-limit value for the DS Table "Fetch Size" field.',                    ooll__dss_tab_fetch_size__test)
        it('(L-) Out-of-higher-limit value for the DS Table "Fetch Size" field.',                   oohl__dss_tab_fetch_size__test)
        it('(L-) Out-of-lower-limit value for the DS Deploy "Job Active Deadline Seconds" field.',  ooll__dss_dep_jads__test)
        it('(L-) Out-of-higher-limit value for the DS Deploy "Job Active Deadline Seconds" field.', oohl__dss_dep_jads__test)
        // it('(L-) Out-of-lower-limit value for the DS Deploy "JVM Options" field.',                  ooll__dss_dep_jvm__test)  // TODO: discuss limits W/ Yevheniia.
        // it('(L-) Out-of-higher-limit value for the DS Deploy "JVM Options" field.',                 oohl__dss_dep_jvm__test)  // TODO: discuss limits W/ Yevheniia.
        it('(L-) Out-of-lower-limit value for the DS Deploy "K8S Resource CPU" field.',             ooll__dss_dep_k8s_cpu__test)
        it('(L-) Out-of-higher-limit value for the DS Deploy "K8S Resource CPU" field.',            oohl__dss_dep_k8s_cpu__test)
        it('(L-) Out-of-lower-limit value for the DS Deploy "K8S Resource Memory" field.',          ooll__dss_dep_k8s_ram__test)
        it('(L-) Out-of-higher-limit value for the DS Deploy "K8S Resource Memory" field.',         oohl__dss_dep_k8s_ram__test)
        it('(L-) Out-of-lower-limit value for the DS Deploy "Minute - JobSchedule" field.',         ooll__dss_dep_m__test)
        it('(L-) Out-of-higher-limit value for the DS Deploy "Minute - JobSchedule" field.',        oohl__dss_dep_m__test)
        it('(L-) Out-of-lower-limit value for the DS Deploy "Hour - Hour" field.',                  ooll__dss_dep_h__test)
        it('(L-) Out-of-higher-limit value for the DS Deploy "Hour - Hour" field.',                 oohl__dss_dep_h__test)
        it('(L-) Out-of-lower-limit value for the DS Deploy "Day of Month - JobSchedule" field.',   ooll__dss_dep_d__test)
        it('(L-) Out-of-higher-limit value for the DS Deploy "Day of Month - JobSchedule" field.',  oohl__dss_dep_d__test)
        it('(L-) Out-of-lower-limit value for the DS Ingestion "Blob block size mb" field.',        ooll__dss_ing_bblock_size__test)
        it('(L-) Out-of-higher-limit value for the DS Ingestion "Blob block size mb" field.',       oohl__dss_ing_bblock_size__test)
        it('(L-) Out-of-lower-limit value for the DS Ingestion "Blob buffer size mb" field.',       ooll__dss_ing_bbuff_size__test)
        it('(L-) Out-of-higher-limit value for the DS Ingestion "Blob buffer size mb" field.',      oohl__dss_ing_bbuff_size__test)
        it('(L-) Out-of-lower-limit value for the DS Ingestion "Chunk Size" field.',                ooll__dss_ing_chunk_size__test)
        it('(L-) Out-of-higher-limit value for the DS Ingestion "Chunk Size" field.',               oohl__dss_ing_chunk_size__test)
        // Default:
        // TODO: add wizard default values tests here...
        // Other:
        it('(L-) No environments configured.', oth__no_envs__test)
        it('(L-) No DSs configured.',          oth__no_dss__test)
        // Close:
        it('(L+) Close.', close__test)
        afterEach(() => { cy.saveLocalStorage() })
        after(() => { })
    }
);
Leave a Comment