UNPKG

valence-test

Version:

Test applications running in Valence and 5250 screens with Fusion5250

59 lines (51 loc) 1.66 kB
/** * Example simple test on Nitro File Editor */ Feature('Nitro File Editor'); Scenario('Load DEMOCMAST', async (I) => { /** * launch the application in the portal * params * appId - required * userId - override the user id to log into the portal with. Defaults to config.json user * password - override the user password to log into the portal with. Defaults to config.json password */ await I.launchApp(88); I.wait(1); const fileValidatorInfo = await I.executeScript(() => { // validate we can see the file validator and get the open button id // try { const cmp = Ext.ComponentQuery.query('filevalidator')[0], rsp = {}; Object.assign(rsp, { id : cmp.id, open : cmp.down(`button[text=${Valence.lang.lit.open.toUpperCase()}]`).id }); return rsp; } catch (e) { return {}; } }); if (!fileValidatorInfo.id) { throw TypeError('File validator not found'); } else { /** * Open Table DEMOCMAST */ I.fillField('input[name=file]', 'DEMOCMAST'); I.click({id : fileValidatorInfo.open}); I.wait(3); /** * validate the grid has at least one record */ await I.executeScript(async () => { const cmp = Ext.ComponentQuery.query('app-editor')[0], store = cmp.getStore(); if (store.getCount() < 1) { throw TypeError('Editor grid has no records'); } }); } I.logout(); });