Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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 {
await this.teleTab.getTelegrafCardDescrInput(name).then(async elem => {
await elem.sendKeys(descr + Key.ENTER).then(async () => {
await this.driver.sleep(500); // todo better wait
});
});
}
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)
})
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);
});
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 {
async executeCommand(command: string): Promise {
const input = await this.findElement(TerminalView.locators.TerminalView.textArea);
await input.sendKeys(command, Key.ENTER);
}
it('should select the highlighted item', () => {
page.getInput().sendKeys(Key.ENTER);
expect(getSelectedItem()).toBe(toJson(heroesFiltered[1]));
});
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
};
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
});
});
}
async pressEnter() {
return this.type(Key.ENTER);
}