We have automated hundreds of API tests with Karate in the last couple of months and it is a great framework! Our teams are really impressed with it.
I am doing a poc for karate UI and need some inputs in resolving the issue that I am facing. I use karate standalone jar and on 0.9.6.RC4 and have the following configuration:
karate-config.js:
karate.configure ('driver', { type: 'chrome', showDriverLog: false, httpConfig: { readTimeout: 120000 }) karate.callSingle('classpath:ui/login.feature')
Feature A:
Scenario 1: When click('something')
When I run the test, login.feature logs the user in. The syntax (driver.url, click, input etc) within login.feature is fine.
However I get this error when scenario in Feature A runs : "click" is not defined in at line number 1
By including the login feature call in the background and removing the callSingle from karate-config.js as shown below, everything works fine:
karate-config.js:
karate.configure ('driver', { type: 'chrome', showDriverLog: false, httpConfig: { readTimeout: 120000 })
Feature A:
Background:
callonce read('classpath:ui/login.feature') Scenario 1: When click('something')
I only want to login once and run all features (even for parallel execution) and logout to save time. Is this the right approach or am I doing something wrong? This seems to work for the API world where we call the auth.feature just once from the karate-config.js