forked from karatelabs/karate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
demo-01.feature
26 lines (20 loc) · 925 Bytes
/
demo-01.feature
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
Feature: browser automation
Background:
# * configure driver = { type: 'chrome' }
# * configure driver = { type: 'chromedriver', showDriverLog: true }
* configure driver = { type: 'geckodriver', showDriverLog: true }
# * configure driver = { type: 'safaridriver' }
# * configure driver = { type: 'mswebdriver' }
Scenario: try to login to github
and then do a google search
Given driver 'https://github.com/login'
And driver.input('#login_field', 'hello')
And driver.input('#password', 'world')
When driver.submit("input[name=commit]")
Then match driver.html('#js-flash-container') contains 'Incorrect username or password.'
Given driver 'https://google.com'
And driver.input("input[name=q]", 'karate dsl')
When driver.submit("input[name=btnI]")
Then match driver.location == 'https://github.com/intuit/karate'
* def bytes = driver.screenshot()
* karate.embed(bytes, 'image/png')