How to use the selenium-webdriver.Key.ENTER function in selenium-webdriver

To help you get started, we’ve selected a few selenium-webdriver examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Automattic / wp-calypso / test / e2e / lib / pages / login-page.js View on Github external
async login( username, password, emailSSO = false, { retry = true } = {} ) {
		const driver = this.driver;
		const userNameSelector = By.css( '#usernameOrEmail' );
		const passwordSelector = By.css( '#password' );

		await driverHelper.waitTillPresentAndDisplayed( driver, userNameSelector );
		// await driverHelper.waitTillFocused( driver, userNameSelector );
		await driverHelper.setWhenSettable( driver, userNameSelector, username );
		await this.driver.sleep( 1000 );
		await driver.findElement( userNameSelector ).sendKeys( Key.ENTER );

		if ( emailSSO === false ) {
			await driverHelper.waitTillPresentAndDisplayed( driver, passwordSelector );
			await driverHelper.waitTillFocused( driver, passwordSelector );
			await driverHelper.setWhenSettable( driver, passwordSelector, password, {
				secureValue: true,
			} );

			await this.driver.sleep( 1000 );
			await driver.findElement( passwordSelector ).sendKeys( Key.ENTER );
		}

		await this.driver.sleep( 1000 );

		if ( retry === true ) {
			try {
github influxdata / influxdb / e2e / src / steps / loadData / telegrafsSteps.js View on Github external
await this.teleTab.getTelegrafCardDescrInput(name).then(async elem => {
            await elem.sendKeys(descr + Key.ENTER).then(async () => {
                await this.driver.sleep(500); // todo better wait
            });
        });
    }
github brave / ethereum-remote-client / test / e2e / metamask.spec.js View on Github external
it('accepts account password after lock', async () => {
      await delay(500)
      await driver.findElement(By.id('password-box')).sendKeys('123456789')
      await driver.findElement(By.id('password-box')).sendKeys(Key.ENTER)
      await delay(500)
    })
github microsoft / BotFramework-WebChat / __tests__ / input.js View on Github external
test('textarea input shift enter', async () => {
  const { driver } = await setupWebDriver({ props: { styleOptions } });

  const textarea = await driver.findElement(By.tagName('textarea'));

  await textarea.sendKeys('Lorem ipsum dolor sit amet, consectetur adipiscing elit,');
  await textarea.sendKeys(Key.chord([Key.SHIFT, Key.ENTER]));
  await textarea.sendKeys('sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.');

  const base64PNG = await driver.takeScreenshot();

  expect(base64PNG).toMatchImageSnapshot(imageSnapshotOptions);
});
github Automattic / wp-e2e-tests / lib / pages / login-page.js View on Github external
async login( username, password, emailSSO = false, { retry = true } = {} ) {
		const driver = this.driver;
		const userNameSelector = By.css( '#usernameOrEmail' );
		const passwordSelector = By.css( '#password' );

		await driverHelper.waitTillPresentAndDisplayed( driver, userNameSelector );
		await driverHelper.waitTillFocused( driver, userNameSelector );
		await driverHelper.setWhenSettable( driver, userNameSelector, username );
		await this.driver.sleep( 1000 );
		await driver.findElement( userNameSelector ).sendKeys( Key.ENTER );

		if ( emailSSO === false ) {
			await driverHelper.waitTillPresentAndDisplayed( driver, passwordSelector );
			await driverHelper.waitTillFocused( driver, passwordSelector );
			await driverHelper.setWhenSettable( driver, passwordSelector, password, {
				secureValue: true,
			} );

			await this.driver.sleep( 1000 );
			await driver.findElement( passwordSelector ).sendKeys( Key.ENTER );
		}

		await this.driver.sleep( 1000 );

		if ( retry === true ) {
			try {
github redhat-developer / vscode-extension-tester / src / webdriver / components / bottomBar / Views.ts View on Github external
async executeCommand(command: string): Promise {
        const input = await this.findElement(TerminalView.locators.TerminalView.textArea);
        await input.sendKeys(command, Key.ENTER);
    }
github timdeschryver / frontal / e2e / simple / simple.e2e-spec.ts View on Github external
it('should select the highlighted item', () => {
      page.getInput().sendKeys(Key.ENTER);
      expect(getSelectedItem()).toBe(toJson(heroesFiltered[1]));
    });
github influxdata / influxdb / e2e / src / steps / baseSteps.js View on Github external
const fs = require('fs');
const chai = require('chai');
chai.use(require('chai-match'));

const expect = require('chai').expect;
const assert = require('chai').assert;

const { By, Key, until, logging } = require('selenium-webdriver');
const influxUtils = require(__srcdir + '/utils/influxUtils.js');

const basePage = require (__srcdir + '/pages/basePage.js');

const keyMap = {'enter': Key.ENTER,
    'tab': Key.TAB,
    'backspace': Key.BACK_SPACE,
    'bksp': Key.BACK_SPACE,
    'space': Key.SPACE,
    'escape': Key.ESCAPE,
    'esc': Key.ESCAPE,
    'ctrl': Key.CONTROL,
    'end': Key.END,
    'shift': Key.SHIFT,
    'del': Key.DELETE,
    'alft': Key.ARROW_LEFT,
    'arght': Key.ARROW_RIGHT,
    'aup': Key.ARROW_UP,
    'adown': Key.ARROW_DOWN
};
github influxdata / influxdb / e2e / src / steps / loadData / scrapersSteps.js View on Github external
await this.scrapeTab.getScraperCardNameEditField(oldName).then(async input => {
            await input.sendKeys(newName + Key.ENTER).then(async () => {
                await this.driver.sleep(100); //todo implement better wait
            });
        });
    }
github KnowledgeExpert / selenidejs / lib / element.ts View on Github external
async pressEnter() {
        return this.type(Key.ENTER);
    }