jbehave + thucydides: how to override 300s timeout

放肆的年华 提交于 2019-12-12 14:04:18

问题


I'm using thucydides jbehave plugin to run Selenium tests. However, I can't run tests longer than 5 min in total due to jbehave timeout. I can't figure out how can thucydides/jbehave should be configured to override this limitation. Selenium tests use to be longer that 5 mins, so that should be an actual problem for many people.


回答1:


To override the timeout the user should add thucydides.properties file to the main folder of the project (if you use thucidides jbehave archetype, there is no such file by default).

set, for instance, story.timeout.in.secs=3000 and save the file. the timeout parameter will be overriden




回答2:


To overide the timeout we can use the following :

 @Override
        public Embedder configuredEmbedder(){

StoryTimeouts.TimeoutParser t=new StoryTimeouts.TimeoutParser() {
                @Override
                public boolean isValid(String timeout) {
                    return true;
                }

                @Override
                public long asSeconds(String timeout) {
                    return 500; <--- Storytimeout 
                }
            };

            embedder.useTimeoutParsers(t);
}


来源:https://stackoverflow.com/questions/16238759/jbehave-thucydides-how-to-override-300s-timeout

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!