queue.enqueue(function(cb){ //check clipboard data if(checkClipboard()){ self.sendKeys(webdriver.Key.chord(webdriver.Key.CONTROL, 'v')); cb(null); }else{ cb(new Error('nothing in clipboard')); } });
test.it('allows backspacing words to delete just the year', function() { helpers.setInput('11/14|', input); input.sendKeys(Key.chord(Key.ALT, Key.BACK_SPACE)); return helpers.getFieldKitValues() .then(function(values) { expect(values.raw).to.equal('11/'); }); });
test.it('number at the end', function() { helpers.setInput('-411-1|1', leadingInput); leadingInput.sendKeys(Key.chord(Key.ALT, Key.BACK_SPACE)); return helpers.getFieldKitValues('leadingField') .then(function(values) { expect(values.raw).to.equal('-411-1'); }); });
ariaTest('CTRL+END moves focus', exampleFile, 'key-control-end', async (t) => { t.plan(2); await openAllThreads(t); const emailRows = await t.context.session.findElements(By.css(ex.emailRowSelector)); // Send CTRL+END to the first row await emailRows[0].sendKeys(Key.chord(Key.CONTROL, Key.END)); t.true( await checkFocus(t, ex.emailRowSelector, ex.lastRowIndex), 'Sending CTRL+END to first row should result on focus on last row' ); // Sending CTRL+END to the first gridcell await putFocusOnRow1Gridcell(t, 0); await sendKeyToGridcellAndWait(t, 0, 0, Key.chord(Key.CONTROL, Key.END)); t.true( await checkFocusOnGridcell(t, ex.lastRowIndex, 0), 'Sending CTRL+END to first row\'s first gridcell should move focus to last row\'s first gridcell' ); });
ariaTest('SHIFT+TAB moves focus from wigets in row to row', exampleFile, 'key-shift-tab', async (t) => { t.plan(1); await putFocusOnRow1Gridcell(t, 2); // Send shift tab to the link in the last gridcell of the first row await sendKeyToGridcellAndWait(t, 0, 2, Key.chord(Key.SHIFT, Key.TAB)); t.true( await checkFocus(t, ex.emailRowSelector, 0), 'Sending SHIFT+TAB to the interative widget in the last cell of the first row should move focus to the first row.' ); });
/** * @author Mario Kurzweil */ var webdriver = require('selenium-webdriver'); var assert = require('assert'); var driver = new webdriver.Builder(). withCapabilities(webdriver.Capabilities.chrome()). build(); driver.get('http://localhost/web/flightgraph-web'); driver.findElement(webdriver.By.name('search-term')).sendKeys('PGT322'); driver.findElement(webdriver.By.name('search-term')).sendKeys(webdriver.Key.chord(webdriver.Key.RETURN)); driver.quit();