How to use the selenium-webdriver.By.css 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-e2e-tests / lib / pages / signup / about-page.js View on Github external
// Wait before click and unset checkbox
		await driverHelper.waitForFieldClearable( this.driver, By.css( '#siteTitle' ) );
		if ( showcase === true ) {
			await driverHelper.unsetCheckbox( this.driver, By.css( '#showcase' ) );
		}
		if ( share === true ) {
			await driverHelper.unsetCheckbox( this.driver, By.css( '#share' ) );
		}
		if ( sell === true ) {
			await driverHelper.unsetCheckbox( this.driver, By.css( '#sell' ) );
		}
		if ( educate === true ) {
			await driverHelper.unsetCheckbox( this.driver, By.css( '#educate' ) );
		}
		if ( promote === true ) {
			await driverHelper.unsetCheckbox( this.driver, By.css( '#promote' ) );
		}
	}
}
github Automattic / wp-calypso / test / e2e / lib / gutenberg / gutenberg-editor-component.js View on Github external
break;
			case 'Buttons':
			case 'Click to Tweet':
			case 'Hero':
			case 'Logos':
			case 'Pricing Table':
				prefix = 'coblocks-';
				break;
			case 'Dynamic HR':
				prefix = 'coblocks-';
				blockClass = 'dynamic-separator';
				break;
		}
		const inserterToggleSelector = By.css( '.edit-post-header .editor-inserter__toggle' );
		const inserterMenuSelector = By.css( '.editor-inserter__menu' );
		const inserterSearchInputSelector = By.css( 'input.editor-inserter__search' );
		const inserterBlockItemSelector = By.css(
			`li.editor-block-types-list__list-item button.editor-block-list-item-${ prefix }${ blockClass
				.replace( /\s+/g, '-' )
				.toLowerCase() }`
		);
		const insertedBlockSelector = By.css(
			`.block-editor-block-list__block.is-selected[aria-label*='Block: ${ name }']`
		);

		await driverHelper.scrollIntoView( this.driver, By.css( '.editor-writing-flow' ), 'start' );
		await driverHelper.waitTillPresentAndDisplayed( this.driver, inserterToggleSelector );
		await driverHelper.clickWhenClickable( this.driver, inserterToggleSelector );
		await driverHelper.waitTillPresentAndDisplayed( this.driver, inserterMenuSelector );
		await driverHelper.setWhenSettable( this.driver, inserterSearchInputSelector, name );
		// Using a JS click here since the Webdriver click wasn't working
		const button = await this.driver.findElement( inserterBlockItemSelector );
github brave / ethereum-remote-client / test / e2e / metamask.spec.js View on Github external
it('shows phishing notice', async () => {
      const noticeHeader = await driver.findElement(By.css('.terms-header')).getText()
      assert.equal(noticeHeader, 'PHISHING WARNING', 'shows phishing warning')
      const element = await driver.findElement(By.css('.markdown'))
      await driver.executeScript('arguments[0].scrollTop = arguments[0].scrollHeight', element)
      await delay(300)
      await driver.findElement(By.css('button')).click()
      await delay(300)
    })
github Automattic / wp-calypso / test / e2e / lib / components / notices-component.js View on Github external
async getNoticeContent() {
		const selector = By.css( '.notice .notice__text' );
		await driverHelper.waitTillPresentAndDisplayed( this.driver, selector );
		return await this.driver.findElement( selector ).getText();
	}
github Automattic / wp-e2e-tests / lib / pages / signup / checkout-page.js View on Github external
async submitForm() {
		return await driverHelper.clickWhenClickable( this.driver, By.css( 'button[type="submit"]' ) );
	}
}
github Automattic / wp-calypso / test / e2e / lib / components / post-editor-sidebar-component.js View on Github external
async openFeaturedImageDialog() {
		const setButtonSelector = By.css(
			'[data-e2e-title="featured-image"] .editor-drawer-well__placeholder'
		);
		await driverHelper.waitTillPresentAndDisplayed( this.driver, setButtonSelector );
		return await driverHelper.clickWhenClickable( this.driver, setButtonSelector );
	}
github Automattic / wp-e2e-tests / lib / pages / signup / checkout-thankyou-page.js View on Github external
constructor( driver ) {
		super( driver, By.css( '.checkout-thank-you' ) );
	}
github MoveOnOrg / Spoke / __test__ / e2e / page-objects / people.js View on Github external
import { By } from 'selenium-webdriver'

export const people = {
  add: By.css('[data-test=addPerson]'),
  invite: {
    joinUrl: By.css('[data-test=joinUrl]'),
    ok: By.css('[data-test=inviteOk]')
  },
  getRowByName(name) { return By.xpath(`//td[contains(text(),'${name}')]/ancestor::tr`) },
  editButtonByName(name) { return By.xpath(`//td[contains(text(),'${name}')]/ancestor::tr/descendant::button[@data-test='editPerson']`) },
  edit: {
    editButton: By.css('[data-test=editPerson]'),
    firstName: By.css('[data-test=firstName]'),
    lastName: By.css('[data-test=lastName]'),
    email: By.css('[data-test=email]'),
    cell: By.css('[data-test=cell]'),
    save: By.css('[type=submit]')
  }
}
github team-jwd / Draw-Together / cold-brew-demo.js View on Github external
['sendKeys', 'input#username', {}, 'dking1287'],
      ['sendKeys', 'input#email', {}, 'daniel.oliver.schming@gmail.com'],
      ['sendKeys', 'input#password', {}, 'helloscmorld'],
      ['click', '#signup-form button']
    ])

    client2.wait(until.elementLocated(By.css('#profile-card')))

    client2.do([
      ['click', 'button.login-btn'],
      ['sendKeys', '.joinroomname', {}, 'testroom'],
      ['sendKeys', '.joinroompassword', {}, 'password'],
      ['click', '#join-form button']
    ])

    client2.wait(until.elementLocated(By.css('canvas')))
      .then(() => done())
  })
github influxdata / influxdb / e2e / src / pages / dashboards / dashboardPage.js View on Github external
async getPresentationModeButton(){
        return await this.driver.findElement(By.css(presentationModeButton));
    }