diff --git a/examples/lib/defaultHtmlStepUi.js b/examples/lib/defaultHtmlStepUi.js index 9415a8ac..ad61cf9a 100644 --- a/examples/lib/defaultHtmlStepUi.js +++ b/examples/lib/defaultHtmlStepUi.js @@ -108,7 +108,7 @@ function DefaultHtmlStepUi(_sequencer, options) { if (inputDesc.id == 'color-picker') { // Separate input field for color-picker html += '
' + - ' { + path = fs.realpathSync('file://../examples/index.html'); + await page.goto('file://' + path, {waitUntil: 'domcontentloaded'}); +}); + +describe('Color Picker', () => { + test('Color Picker is not breaking other input fields', async () => { + // Wait for .step to load + await page.waitForSelector('.step'); + // Click and select crop step + await page.click('[data-value=\'crop\']'); + // Check to see of color picker input is present + await page.waitForSelector('#color-picker'); + // Click color picker input + await page.click('#color-picker span.input-group-addon'); + + try { + // Wait to see if colorpicker dialog is appearing + await page.waitForSelector('.colorpicker'); + } catch (error) { + // If colorpicker dialog didn't appear display error + console.log('The ColorPicker didn\'t appear.', error); + } + // Click height input of crop 3 times to select whole text in it + await page.click('input[name=h]', { clickCount: 3 }); + // Type its value to 100 + await page.type('input[name=h]', '100'); + // Evaluate input value of height input of crop + const heightInput = await page.evaluate(() => document.querySelector('input[name=h]').value); + // Check if value is changed or not + expect(heightInput).toEqual('100'); + + }, timeout); +}); \ No newline at end of file