Skip to content

Instantly share code, notes, and snippets.

@CITGuru
Last active April 16, 2020 05:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save CITGuru/0b7dab7c21e8233250093bd9e129ebd1 to your computer and use it in GitHub Desktop.
Save CITGuru/0b7dab7c21e8233250093bd9e129ebd1 to your computer and use it in GitHub Desktop.
const webdriver = require('selenium-webdriver');
const { until } = require('selenium-webdriver');
const { By } = require('selenium-webdriver');
const assert = require('assert');
describe('webdriver', () => {
let driver;
before(async () => {
driver = new webdriver.Builder().forBrowser('chrome')
.build();
await driver.get(`https://google.com`);
}, 30000);
after(async () => {
await driver.quit();
}, 40000);
it('test google search', async () => {
await driver.findElement(webdriver.By.name('q')).sendKeys('webdriver\n')
const title = await driver.getTitle()
console.log(title)
assert.equal(title, "webdriver - Google Search")
}, 35000);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment