-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
/
Copy pathinformation.spec.js
44 lines (32 loc) · 1.32 KB
/
information.spec.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
const {By, Builder} = require('selenium-webdriver');
const assert = require("assert");
describe('Element Information Test', function () {
let driver;
before(async function () {
driver = await new Builder().forBrowser('chrome').build();
});
beforeEach(async ()=> {
await driver.get('https://www.selenium.dev/selenium/web/inputs.html');
})
it('Check if element is displayed', async function () {
// Resolves Promise and returns boolean value
let result = await driver.findElement(By.name("email_input")).isDisplayed();
assert.equal(result,true);
});
it('Check if button is enabled', async function () {
// Resolves Promise and returns boolean value
let element = await driver.findElement(By.name("button_input")).isEnabled();
assert.equal(element, true);
});
it('Check if checkbox is selected', async function () {
// Returns true if element ins checked else returns false
let isSelected = await driver.findElement(By.name("checkbox_input")).isSelected();
assert.equal(isSelected, true);
});
it('Should return the tagname', async function () {
// Returns TagName of the element
let value = await driver.findElement(By.name('email_input')).getTagName();
assert.equal(value, "input");
});
after(async () => await driver.quit());
});