Is there a a way to set a port to my desired one when I am starting a mock serve with karate.start
so instead of getting the port like this, which will start server in some port and return it:
def startMockServer = () => karate.start('path.feature').port
Have a possibility similar to this:
def startMockServer = () => karate.start('path.feature', '8080')
>Solution :
Yes, try this:
* karate.start({ mock: 'mock.feature', port: 8080 })
This is mentioned in the docs: https://github.com/karatelabs/karate/tree/master/karate-netty#within-a-karate-test