Untitled

 avatar
unknown
plain_text
a year ago
58 kB
6
Indexable
import 'cypress-localstorage-commands'
import { LF } from '../../support/whatnot'
import { reset_window, configure_common, configure_env, configure_dss, checkYAML } from '../../support/pages/batch-ing/sftp'


const COMMON = {
    MIN:   { dc: 'fwcy-dc',     ing: 'sftp' },
    MAX:   { dc: 'fwcy-dc',     ing: 'sftp' },
    UPD:   { dc: 'fwcy-dc-upd', ing: 'sftp' },
    SHORT: { dc: 'fwcy-dc',     ing: 'sftp' }
}
const ENV = {
    MIN:   { host: 'fwcy.com',      port: null,      usr: 'fwcy-usr' },
    MAX:   { host: 'fwcy.com',      port: 25052,     usr: 'fwcy-usr' },
    UPD:   { host: 'fwcyu.com',     port: 52052,     usr: 'fwcyu-usr' },
    DEV:   { host: 'fwcy.dev.com',  port: 25152,     usr: 'fwcy-dev-usr' },
    TEST:  { host: 'fwcy.test.com', port: 25252,     usr: 'fwcy-test-usr' },
    PROD:  { host: 'fwcy.prod.com', port: 25352,     usr: 'fwcy-prod-usr' },
    SHORT: { host: 'fwcy.com',      port: undefined, usr: 'fwcy-usr' }
}
const DS = {
    MIN:   {
        DS1: { file_pattern: 'fwcy/ds1/fp/*', fetch_count: null, remote_dir: 'fwcy/ds1/rdp', data_deleted_after_transfer: true },
        DS2: { file_pattern: 'fwcy/ds2/fp/*', fetch_count: null, remote_dir: 'fwcy/ds2/rdp', data_deleted_after_transfer: true },
        DS3: { file_pattern: 'fwcy/ds3/fp/*', fetch_count: null, remote_dir: 'fwcy/ds3/rdp', data_deleted_after_transfer: false }
    },
    MAX: {
        DS1: { file_pattern: 'fwcy/ds1/fp/*', fetch_count: 10000, remote_dir: 'fwcy/ds1/rdp', data_deleted_after_transfer: true },
        DS2: { file_pattern: 'fwcy/ds2/fp/*', fetch_count: 20000, remote_dir: 'fwcy/ds2/rdp', data_deleted_after_transfer: true },
        DS3: { file_pattern: 'fwcy/ds3/fp/*', fetch_count: 30000, remote_dir: 'fwcy/ds3/rdp', data_deleted_after_transfer: false }
    },
    UPD:   {
        DS1: { file_pattern: 'fwcyu/ds1/fp/*', fetch_count: 100001, remote_dir: 'fwcyu/ds1/rdp', data_deleted_after_transfer: false },
        DS2: { file_pattern: 'fwcyu/ds2/fp/*', fetch_count: 200001, remote_dir: 'fwcyu/ds2/rdp', data_deleted_after_transfer: false },
        DS3: { file_pattern: 'fwcyu/ds3/fp/*', fetch_count: 300001, remote_dir: 'fwcyu/ds3/rdp', data_deleted_after_transfer: true }
    },
    DEV:   { file_pattern: 'fwcy/ds/dev/fp/*',  fetch_count: 10000,     remote_dir: 'fwcy/ds/dev/rdp',  data_deleted_after_transfer: true },
    TEST:  { file_pattern: 'fwcy/ds/test/fp/*', fetch_count: 20000,     remote_dir: 'fwcy/ds/test/rdp', data_deleted_after_transfer: true },
    PROD:  { file_pattern: 'fwcy/ds/prod/fp/*', fetch_count: 30000,     remote_dir: 'fwcy/ds/prod/rdp', data_deleted_after_transfer: false },
    SHORT: { file_pattern: 'fwcy/ds/fp/*',      fetch_count: undefined, remote_dir: 'fwcy/ds/rdp',      data_deleted_after_transfer: undefined }
}
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}
}

function create__min__test() {
    // Configure common. TEST, PROD: disable. DEV: enable and configure.
    let common = configure_common(COMMON.MIN)
    cy.switchEnv('TEST').switch('Configure', false)
    cy.switchEnv('PROD').switch('Configure', false)
    cy.switchEnv('DEV').switch('Configure', true)
    let env = configure_env(ENV.MIN)

    // 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 },
        'fwcy-ds2': { ...DS.MIN.DS2, dep: DS_DEP.MIN.DS2 },
        'fwcy-ds3': { ...DS.MIN.DS3, dep: DS_DEP.MIN.DS3 }
    })

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

function create__max__test() {
    // Configure common. TEST, PROD: disable. DEV: enable and configure.
    let common = configure_common(COMMON.MAX)
    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 },
        'fwcy-ds2': { ...DS.MAX.DS2, dep: DS_DEP.MAX.DS2 },
        'fwcy-ds3': { ...DS.MAX.DS3, dep: DS_DEP.MAX.DS3 }
    })

    // Click the 'CREATE' button. DEV: check YAML. TEST, PROD: check on YAML.
    cy.create()
    cy.switchEnv('DEV')
    checkYAML({ common, env, dss })
    // 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(COMMON.MIN)
    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-ds-dev': { ...DS.DEV, dep: DS_DEP.DEV } }, 'DEV')
    cy.switchEnv('TEST')
    test.dss = configure_dss({ 'fwcy-ds-test': { ...DS.TEST, dep: DS_DEP.TEST } }, 'TEST')
    cy.switchEnv('PROD')
    prod.dss = configure_dss({ 'fwcy-ds-prod': { ...DS.PROD, dep: DS_DEP.PROD } }, 'PROD')

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

function ll__dc_port__test() {
    // Configure common. DEV: enable and configure.
    configure_common(COMMON.SHORT)
    cy.switchEnv('DEV').switch('Configure', true)
    configure_env({ ...ENV.SHORT, port: 1 })

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

    // Click the 'CREATE' button. Check the limit value in the config.
    cy.create()
    cy.switchEnv('DEV')
    cy.dropdown({ select: 'Data Collection Config', from : 'Select Batch Ingestion Config' })
    cy.checkYAML((raw, conf) => { expect(conf['source']['sftp']['port']).to.equal(1) })
}

function hl__dc_port__test() {
    // Configure common. DEV: enable and configure.
    configure_common(COMMON.SHORT)
    cy.switchEnv('DEV').switch('Configure', true)
    configure_env({ ...ENV.SHORT, port: 65535 })

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

    // Click the 'CREATE' button. Check the limit value in the config.
    cy.create()
    cy.switchEnv('DEV')
    cy.dropdown({ select: 'Data Collection Config', from : 'Select Batch Ingestion Config' })
    cy.checkYAML((raw, conf) => { expect(conf['source']['sftp']['port']).to.equal(65535) })
}

function ll__dss_files_to_fetch_cnt__test() {
    // Configure common. DEV: enable and configure.
    configure_common(COMMON.SHORT)
    cy.switchEnv('DEV').switch('Configure', true)
    configure_env(ENV.SHORT)

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

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

function hl__dss_files_to_fetch_cnt__test() {
    // Configure common. DEV: enable and configure.
    configure_common(COMMON.SHORT)
    cy.switchEnv('DEV').switch('Configure', true)
    configure_env(ENV.SHORT)

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

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

function ll__dss_dep_jads__test() {
    // Configure common. DEV: enable and configure.
    configure_common(COMMON.SHORT)
    cy.switchEnv('DEV').switch('Configure', true)
    configure_env(ENV.SHORT)

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

    // Click the 'CREATE' button. Check the limit value in the config.
    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. DEV: enable and configure.
    configure_common(COMMON.SHORT)
    cy.switchEnv('DEV').switch('Configure', true)
    configure_env(ENV.SHORT)

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

    // Click the 'CREATE' button. Check the limit value in the config.
    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. DEV: enable and configure.
    configure_common(COMMON.SHORT)
    cy.switchEnv('DEV').switch('Configure', true)
    configure_env(ENV.SHORT)

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

    // Click the 'CREATE' button. Check the limit value in the config.
    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. DEV: enable and configure.
    configure_common(COMMON.SHORT)
    cy.switchEnv('DEV').switch('Configure', true)
    configure_env(ENV.SHORT)

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

    // Click the 'CREATE' button. Check the limit value in the config.
    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. DEV: enable and configure.
    configure_common(COMMON.SHORT)
    cy.switchEnv('DEV').switch('Configure', true)
    configure_env(ENV.SHORT)

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

    // Click the 'CREATE' button. Check the limit value in the config.
    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. DEV: enable and configure.
    configure_common(COMMON.SHORT)
    cy.switchEnv('DEV').switch('Configure', true)
    configure_env(ENV.SHORT)

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

    // Click the 'CREATE' button. Check the limit value in the config.
    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. DEV: enable and configure.
    configure_common(COMMON.SHORT)
    cy.switchEnv('DEV').switch('Configure', true)
    configure_env(ENV.SHORT)

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

    // Click the 'CREATE' button. Check the limit value in the config.
    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. DEV: enable and configure.
    configure_common(COMMON.SHORT)
    cy.switchEnv('DEV').switch('Configure', true)
    configure_env(ENV.SHORT)

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

    // Click the 'CREATE' button. Check the limit value in the config.
    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. DEV: enable and configure.
    configure_common(COMMON.SHORT)
    cy.switchEnv('DEV').switch('Configure', true)
    configure_env(ENV.SHORT)

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

    // Click the 'CREATE' button. Check the limit value in the config.
    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. DEV: enable and configure.
    configure_common(COMMON.SHORT)
    cy.switchEnv('DEV').switch('Configure', true)
    configure_env(ENV.SHORT)

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

    // Click the 'CREATE' button. Check the limit value in the config.
    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. DEV: enable and configure.
    configure_common(COMMON.SHORT)
    cy.switchEnv('DEV').switch('Configure', true)
    configure_env(ENV.SHORT)

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

    // Click the 'CREATE' button. Check the limit value in the config.
    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. DEV: enable and configure.
    configure_common(COMMON.SHORT)
    cy.switchEnv('DEV').switch('Configure', true)
    configure_env(ENV.SHORT)

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

    // Click the 'CREATE' button. Check the limit value in the config.
    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 update__test() {
    // Configure common. TEST, PROD: disable. DEV: enable and configure.
    configure_common(COMMON.MAX)
    cy.switchEnv('TEST').switch('Configure', false)
    cy.switchEnv('PROD').switch('Configure', false)
    cy.switchEnv('DEV').switch('Configure', true)
    configure_env(ENV.MAX)

    // 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 },
        'fwcy-ds1': { ...DS.MAX.DS1, dep: DS_DEP.MAX.DS1 },
        'fwcy-ds2': { ...DS.MAX.DS2, dep: DS_DEP.MAX.DS2 }
    })

    // 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(COMMON.UPD)
    cy.switchEnv('DEV')
    let env = configure_env(ENV.UPD)
    
    // Navigate to the 'Data Sets' tab. DEV: reconfigure.
    cy.navigate('Data Sets')
    cy.switchEnv('DEV')
    let dss = configure_dss({  // 0 - drop, 1 - no changes, 2 - update (including renmaing), 3 - add.
        'fwcy-ds0': null,
        'fwcy-ds2': { ds: 'fwcyu-ds2', ...DS.UPD.DS2, dep: DS_DEP.UPD.DS2 },
        'fwcy-ds3': { ...DS.MAX.DS3, dep: DS_DEP.MAX.DS3 }
    })

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

function blank__dc_dc__test() {
    // Configure common. DEV: enable and configure.
    configure_common({ ...COMMON.SHORT, dc: null })
    cy.switchEnv('DEV').switch('Configure', true)
    configure_env(ENV.SHORT)

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

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

function blank__dc_ing__test() {
    // Configure common. DEV: enable and configure.
    configure_common({ ...COMMON.SHORT, ing: undefined })

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

function blank__dc_host__test() {
    // Configure common. DEV: enable and configure.
    configure_common(COMMON.SHORT)
    cy.switchEnv('DEV').switch('Configure', true)
    configure_env({ ...ENV.SHORT, host: null })

    // 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 } })

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

function blank__dc_username__test() {
    // Configure common. DEV: enable and configure.
    configure_common(COMMON.SHORT)
    cy.switchEnv('DEV').switch('Configure', true)
    configure_env({ ...ENV.SHORT, usr: null })

    // 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 } })

    // 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(COMMON.SHORT)
    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({ _: { ds: null, ...DS.SHORT, dep: DS_DEP.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_file_pattern__test() {
    // Configure common. DEV: enable and configure.
    configure_common(COMMON.SHORT)
    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, file_pattern: null, dep: DS_DEP.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 = 'File Pattern'
	cy.checkErr({ err: `"${label}" is required!`, next_to: 'field', label })
}

function blank__dss_remote_dir_path__test() {
    // Configure common. DEV: enable and configure.
    configure_common(COMMON.SHORT)
    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, remote_dir: null, dep: DS_DEP.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 = 'Remote Dir Path'
	cy.checkErr({ err: `"${label}" is required!`, next_to: 'field', label })
}

function blank__dss_dep_jvm__test() {
    // Configure common. DEV: enable and configure.
    configure_common(COMMON.SHORT)
    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, jvm: 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 = 'JVM Options'
	cy.checkErr({ err: `"${label}" is required!`, next_to: 'field', label })
}

function invalid__dc_dc__test() {
    // Configure common. DEV: enable and configure.
    configure_common({ ...COMMON.SHORT, dc: undefined })
    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 } })

    // Click the 'CREATE' button. Check the error message for every incorrect DC.
    cy.navigate('Ingestion')
    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_host__test() {
    // Configure common. DEV: enable and configure.
    configure_common(COMMON.SHORT)
    cy.switchEnv('DEV').switch('Configure', true)
    configure_env({ ...ENV.SHORT, host: 'fwcy-invalid.com.' })

    // 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 } })

    // Click the 'CREATE' button. Check the error message.
    cy.create()
    cy.navigate('Ingestion')
    const label = 'Host'
    const err = `Incorrect "${label}". It must be an alpha-numeric string (dashes are allowed). Optionally it can be separated with a dot several times (note: the dot cannot be placed by a dash)!`
	cy.checkErr({ err, next_to: 'field', label })
}

function invalid__dc_port__test() {
    // Configure common. TEST, PROD: disable. DEV: enable and configure.
    configure_common(COMMON.SHORT)
    cy.switchEnv('TEST').switch('Configure', false)
    cy.switchEnv('PROD').switch('Configure', false)
    cy.switchEnv('DEV').switch('Configure', true)
    configure_env({ ...ENV.SHORT, port: 32000.5 })

    // 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 } })

    // Click the 'CREATE' button. Check the error message.
    cy.create()
    cy.navigate('Ingestion')
    const label = 'Port'
    const err = `Incorrect "${label}". It must be an integer higher than or equal to 1 and less than or equal to 65535!`
	cy.checkErr({ err, next_to: 'field', label })
}

function invalid__dc_username__test() {
    // Configure common. TEST, PROD: disable. DEV: enable and configure.
    configure_common(COMMON.SHORT)
    cy.switchEnv('TEST').switch('Configure', false)
    cy.switchEnv('PROD').switch('Configure', false)
    cy.switchEnv('DEV').switch('Configure', true)
    configure_env({ ...ENV.SHORT, usr: '-fwcy--usr--invalid-' })

    // 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 } })

    // Click the 'CREATE' button. Check the error message.
    cy.create()
    cy.navigate('Ingestion')
    const label = 'Username'
    const err = `Incorrect "${label}". It must be an alpha-numeric 3+ characters string with single dashes allowed in the middle of it!`
	cy.checkErr({ err, next_to: 'field', label })
}

function invalid__dss_ds__test() {
    // Configure common. DEV: enable and configure.
    configure_common(COMMON.SHORT)
    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 } })

    // Click the 'CREATE' button. Check the error message for every incorrect DC.
    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.get('mat-dialog-container', LF).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_files_to_fetch_count__test() {
    // Configure common. TEST, PROD: disable. DEV: enable and configure.
    configure_common(COMMON.SHORT)
    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-ds': { ...DS.SHORT, fetch_cnt: 1000.5, dep: DS_DEP.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 = 'Files to Fetch Count'
    const err = `Incorrect "${label}". It must be an integer higher than or equal to -1 (for all files) and less than or equal to 9223372036854775807!`
	cy.checkErr({ err, next_to: 'field', label })
}

function invalid__dss_dep_jads__test() {
    // Configure common. DEV: enable and configure.
    configure_common(COMMON.SHORT)
    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 } } })

    // 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(COMMON.SHORT)
    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 } } })

    // 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(COMMON.SHORT)
    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' } } })

    // 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(COMMON.SHORT)
    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 } } })

    // 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(COMMON.SHORT)
    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 } } })

    // 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(COMMON.SHORT)
    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 } } })

    // 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__dc_port__test() {
    // Configure common. DEV: enable and configure.
    configure_common(COMMON.SHORT)
    cy.switchEnv('DEV').switch('Configure', true)
    configure_env({ ...ENV.SHORT, port: 0 })

    // 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 } })

    // Click the 'CREATE' button. Check the error message.
    cy.create()
    cy.navigate('Ingestion')
    const label = 'Port'
    const err = `Incorrect "${label}"! It must be an integer higher than or equal to 1 and less than or equal to 65535!`
	cy.checkErr({ err, next_to: 'field', label })
}

function oohl__dc_port__test() {
    // Configure common. DEV: enable and configure.
    configure_common(COMMON.SHORT)
    cy.switchEnv('DEV').switch('Configure', true)
    configure_env({ ...ENV.SHORT, port: 65536 })

    // 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 } })

    // Click the 'CREATE' button. Check the error message.
    cy.create()
    cy.navigate('Ingestion')
    const label = 'Port'
    const err = `Incorrect "${label}"! It must be an integer higher than or equal to 1 and less than or equal to 65535!`
	cy.checkErr({ err, next_to: 'field', label })
}

function ooll__dss_files_to_fetch_cnt__test() {
    // Configure common. DEV: enable and configure.
    configure_common(COMMON.SHORT)
    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_cnt: -2, dep: DS_DEP.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 = 'Files to Fetch Count'
    const err = `Incorrect "${label}"! It must be an integer higher than or equal to -1 (for all files) and less than or equal to 9223372036854775807!`
	cy.checkErr({ err, next_to: 'field', label })
}

function oohl__dss_files_to_fetch_cnt__test() {
    // Configure common. DEV: enable and configure.
    configure_common(COMMON.SHORT)
    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_cnt: '9223372036854775808', dep: DS_DEP.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 = 'Files to Fetch Count'
    const err = `Incorrect "${label}"! It must be an integer higher than or equal to -1 (for all files) and less than or equal to 9223372036854775807!`
	cy.checkErr({ err, next_to: 'field', label })
}

function ooll__dss_dep_jads__test() {
    // Configure common. DEV: enable and configure.
    configure_common(COMMON.SHORT)
    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 } } })

    // 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. DEV: enable and configure.
    configure_common(COMMON.SHORT)
    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' } } })

    // 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. DEV: enable and configure.
    configure_common(COMMON.SHORT)
    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 } } })

    // 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. DEV: enable and configure.
    configure_common(COMMON.SHORT)
    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' } } })

    // 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. DEV: enable and configure.
    configure_common(COMMON.SHORT)
    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' } } })

    // 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. DEV: enable and configure.
    configure_common(COMMON.SHORT)
    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' } } })

    // 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. DEV: enable and configure.
    configure_common(COMMON.SHORT)
    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 } } })

    // 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. DEV: enable and configure.
    configure_common(COMMON.SHORT)
    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 } } })

    // 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. DEV: enable and configure.
    configure_common(COMMON.SHORT)
    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 } } })

    // 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. DEV: enable and configure.
    configure_common(COMMON.SHORT)
    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 } } })

    // 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. DEV: enable and configure.
    configure_common(COMMON.SHORT)
    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 } } })

    // 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. DEV: enable and configure.
    configure_common(COMMON.SHORT)
    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 } } })

    // 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 oth__no_envs__test() {
    // Configure common. DEV, TEST, PROD: disable.
    configure_common(COMMON.SHORT)
    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.navigate('Ingestion')
	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(COMMON.SHORT)
    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 ("sftp" ingestion type) test suit.',
    () => {
        // before(() => { cy.login() })
        beforeEach(() => {
			reset_window()
            // cy.restoreLocalStorage()
            // cy.visit('/')
            // cy.open('Create Batch Ingestion')
        })
        // Create:
        it('(C+) Create W/ minimal configuration.',       create__min__test)
        it('(C+) Create W/ maximum configuration.',       create__max__test)
        it.only('(C+) Create W/ all environments configured.', create__all_envs__test)
        // Limit values:
        it('(M+) Lower limit value for the DC "Port" field.',                                 ll__dc_port__test)
        it('(M+) Higher limit value for the DC "Port" field.',                                hl__dc_port__test)
        it('(M+) Lower limit value for the DSs "Files to Fetch Count" field.',                ll__dss_files_to_fetch_cnt__test)
        it('(M+) Higher limit value for the DSs "Files to Fetch Count" field.',               hl__dss_files_to_fetch_cnt__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: discuss limits W/ Yevheniia.
        // it('(M+) Higher limit value for the DSs Deploy "JVM Options" field.',                 hl__dss_dep_jvm__test)  // TODO: discuss 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)
        // Update:
        it.only('(M+) Update.', update__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" dropdown.',   blank__dc_ing__test)
        it('(L-) Blank DC "Host" field.',                blank__dc_host__test)
        it('(L-) Blank DC "Username" field.',            blank__dc_username__test)
        it('(L-) Blank DSs "Data Set" field.',           blank__dss_ds__test)
        it('(L-) Blank DSs "File Pattern" field.',       blank__dss_file_pattern__test)
        it('(L-) Blank DSs "Remote Dir Path" field.',    blank__dss_remote_dir_path__test)
        it('(L-) Blank DSs Deploy "JVM Options" field.', blank__dss_dep_jvm__test)
        // Invalid values:
        it('(L-) Invalid value for the DC "Data Collection" field.',                     invalid__dc_dc__test)
        it('(L-) Invalid value for the DC "Host" field.',                                invalid__dc_host__test) 
        it('(L-) Invalid value for the DC "Port" field.',                                invalid__dc_port__test)
        it('(L-) Invalid value for the DC "Username" field.',                            invalid__dc_username__test)
        it('(L-) Invalid value for the DSS "DataSet" field.',                            invalid__dss_ds__test)
        // it('(L-) Invalid value for the DSs "File Pattern" field.',                       invalid__dss_file_pattern__test)  // TODO: try to find invalid glob pattern (ask Anton/Vadym/Andrei, probably they can provide an example).
        it('(L-) Invalid value for the DSs "Files to Fetch Count" field.',               invalid__dss_files_to_fetch_count__test)
        // it('(L-) Invalid value for the DSs "Remote Dir Path" field.',                    invalid__dss_remote_dir_path__test)  // TODO: discuss W/ Yevheniia (the question about the format (datetime) pls see the doc).
        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: discuss invalid values W/ Yevheniia.
        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)
        // Out of limits values.
        it('(L-) Out-of-lower-limit value for the DC "Port" field.',                                 ooll__dc_port__test)
        it('(L-) Out-of-higher-limit value for the DC "Port" field.',                                oohl__dc_port__test)
        it('(L-) Out-of-lower-limit value for the DSs "Files to Fetch Count" field.',                ooll__dss_files_to_fetch_cnt__test)
        it('(L-) Out-of-higher-limit value for the DSs "Files to Fetch Count" field.',               oohl__dss_files_to_fetch_cnt__test)
        it('(L-) Out-of-lower-limit value for the DSs Deploy "Job Active Deadline Seconds" field.',  ooll__dss_dep_jads__test)
        it('(L-) Out-of-higher-limit value for the DSs Deploy "Job Active Deadline Seconds" field.', oohl__dss_dep_jads__test)
        // it('(L-) Out-of-lower-limit value for the DSs Deploy "JVM Options" field.',                  ooll__dss_dep_jvm__test)  // TODO: discuss limits W/ Yevheniia.
        // it('(L-) Out-of-higher-limit value for the DSs Deploy "JVM Options" field.',                 oohl__dss_dep_jvm__test)  // TODO: discuss limits W/ Yevheniia.
        it('(L-) Out-of-lower-limit value for the DSs Deploy "K8S Resource CPU" field.',             ooll__dss_dep_k8s_cpu__test)
        it('(L-) Out-of-higher-limit value for the DSs Deploy "K8S Resource CPU" field.',            oohl__dss_dep_k8s_cpu__test)
        it('(L-) Out-of-lower-limit value for the DSs Deploy "K8S Resource Memory" field.',          ooll__dss_dep_k8s_ram__test)
        it('(L-) Out-of-higher-limit value for the DSs Deploy "K8S Resource Memory" field.',         oohl__dss_dep_k8s_ram__test)
        it('(L-) Out-of-lower-limit value for the DSs Deploy "Minute - JobSchedule" field.',         ooll__dss_dep_m__test)
        it('(L-) Out-of-higher-limit value for the DSs Deploy "Minute - JobSchedule" field.',        oohl__dss_dep_m__test)
        it('(L-) Out-of-lower-limit value for the DSs Deploy "Hour - Hour" field.',                  ooll__dss_dep_h__test)
        it('(L-) Out-of-higher-limit value for the DSs Deploy "Hour - Hour" field.',                 oohl__dss_dep_h__test)
        it('(L-) Out-of-lower-limit value for the DSs Deploy "Day of Month - JobSchedule" field.',   ooll__dss_dep_d__test)
        it('(L-) Out-of-higher-limit value for the DSs Deploy "Day of Month - JobSchedule" field.',  oohl__dss_dep_d__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)  // TODO: the requirements were changed. Ask Yevheniia, do we still need this test.
        // Close:
        it('(L+) Close.', close__test)
        afterEach(() => { cy.saveLocalStorage() })
        after(() => { })
    }
);
Editor is loading...
Leave a Comment