forked from karatelabs/karate-examples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsaucelabs.feature
18 lines (16 loc) · 1 KB
/
saucelabs.feature
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
Feature: sauce labs automation demo
Background:
# enter the values for the next few lines from your sauce labs account
* def sauceLabsBuild = ''
* def sauceLabsUser = ''
* def sauceLabsKey = ''
* def sauceLabsUrl = 'https://ondemand.eu-central-1.saucelabs.com:443/wd/hub'
* def sauceOptions = { build: '#(sauceLabsBuild)', name: '#(karate.feature.prefixedPath)', username: '#(sauceLabsUser)', accessKey: '#(sauceLabsKey)' }
* def session = { capabilities: { alwaysMatch: { browserName: 'chrome', browserVersion: 'latest', platformName: 'Windows 11', 'sauce:options': '#(sauceOptions)' } } }
* configure driver = { type: 'chromedriver', start: false, webDriverSession: '#(session)', webDriverUrl: '#(sauceLabsUrl)' }
Scenario: try to login to github and check for expected error message
* driver 'https://github.com/login'
* input('#login_field', 'XXXX')
* input('#password', 'world')
* submit().click("input[name=commit]")
* match html('.flash-error') contains 'Incorrect username or password.'