forked from karatelabs/karate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
demo-01.feature
24 lines (20 loc) · 1.09 KB
/
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
Feature: browser automation 1
Background:
* configure driver = { type: 'chrome', showDriverLog: true }
# * configure driverTarget = { docker: 'justinribeiro/chrome-headless', showDriverLog: true }
# * configure driverTarget = { docker: 'ptrthomas/karate-chrome', showDriverLog: true }
# * configure driver = { type: 'chromedriver', showDriverLog: true }
# * configure driver = { type: 'geckodriver', showDriverLog: true }
# * configure driver = { type: 'safaridriver', showDriverLog: true }
# * configure driver = { type: 'iedriver', showDriverLog: true, httpConfig: { readTimeout: 120000 } }
Scenario: try to login to github
and then do a google search
Given driver 'https://github.com/login'
And input('#login_field', 'dummy')
And input('#password', 'world')
When submit().click("input[name=commit]")
Then match html('.flash-error') contains 'Incorrect username or password.'
Given driver 'https://google.com'
And input("textarea[name=q]", 'karate dsl')
When submit().click("input[name=btnI]")
Then waitForUrl('https://github.com/karatelabs/karate')