-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbaseTest.js
More file actions
24 lines (20 loc) · 941 Bytes
/
baseTest.js
File metadata and controls
24 lines (20 loc) · 941 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
require("chromedriver");
const assert = require("assert");
const {Builder, Key, By, until} = require("selenium-webdriver");
const queries = ["Beeline", "Интернет-магазин Beeline", "Билайн"];
queries.forEach((query) => {
describe("Checkout Google", () => {
before(async function () {
driver = await new Builder().forBrowser("chrome").build();
});
it("Search on Google: Title", async function () {
await driver.get("https://google.com");
await driver.findElement(By.xpath("//input[@name='q']")).click();
await driver.findElement(By.xpath("//input[@name='q']")).sendKeys(query, Key.RETURN);
await driver.wait(until.elementLocated(By.id('rcnt')), 10000);
let title = await driver.getTitle();
assert.equal(title, `${query} - Google Search`);
});
after(() => driver.quit());
});
});