diff --git a/test/integration/examples.test.js b/test/integration/examples.test.js index 377413c508e50bde6b4f0c67915fc721cb8c5edd..3299fb27c532df3838a82dd5cfa04528aa3c287b 100644 --- a/test/integration/examples.test.js +++ b/test/integration/examples.test.js @@ -4,7 +4,10 @@ import path from 'path'; import SeleniumHelper from '../helpers/selenium-helper'; const { + clickButton, + clickText, clickXpath, + findByXpath, getDriver, getLogs } = new SeleniumHelper(); @@ -59,4 +62,26 @@ describe('blocks example', () => { const logs = await getLogs(errorWhitelist); await expect(logs).toEqual([]); }); + + test('Change categories', async () => { + await driver.get(`file://${uri}`); + await clickText('Looks'); + await clickText('Sound'); + await clickText('Pen'); + await clickText('Events'); + await clickText('Control'); + await clickText('Sensing'); + await clickText('Operators'); + await clickText('Data'); + await clickText('Create variable...'); + let el = await findByXpath("//input[@placeholder='']"); + await el.sendKeys('score'); + await clickButton('OK'); + await clickText('Create variable...'); + el = await findByXpath("//input[@placeholder='']"); + await el.sendKeys('second variable'); + await clickButton('OK'); + const logs = await getLogs(errorWhitelist); + await expect(logs).toEqual([]); + }); });