-
Notifications
You must be signed in to change notification settings - Fork 66
Expand file tree
/
Copy pathLocatorTest.js
More file actions
31 lines (29 loc) · 905 Bytes
/
LocatorTest.js
File metadata and controls
31 lines (29 loc) · 905 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
25
26
27
28
29
30
31
// filename: test/LocatorTest.js
// ...
const { Builder, By } = require('selenium-webdriver')
const path = require('path')
//The Test
describe('Locate', function() {
this.timeout(30000)
let driver
beforeEach(async function() {
driver = await new Builder().forBrowser('firefox').build()
})
afterEach(async function() {
await driver.quit()
})
it('check red button text' , async function() {
await driver.get('https://the-internet.herokuapp.com/challenging_dom')
await driver
.findElement( By.css('.button') )
.click()
await driver
.findElement( By.css('.button.success') )
.click()
// Return the text of the red button id=button alert contains 'foo', 'bar', 'baz', or 'qux'
var redButtonMessage = await driver
.findElement(By.css('.button.alert'))
.getText()
console.log(redButtonMessage)
})
})