syntax - Specflow Given When Then BUT? -


i have been using specflow while, without making use of "but" logic.

considering following scenario:

scenario: kiran logs system doesn't click remember me given have username of 'kiran' , password of 'password' when chose login don't chose remember me should logged in , taken home screen username should not remembered 

couldn't "but" steps interchanged "and"?

is there advantage using "but"?

am right in thinking purely readability purposes?

i forward hearing thoughts on this.

many thanks, kiran

yes right, "and" , "but" inter-changeable in gherkin syntax.

however in experience "and" used when indicating user should carry out action, whereas "but" best suited when want highlight user should not perform action; because "but" in english language used in negative context.

hence in example:

but don't chose remember me

is use of "but" not performing action. additionally using "but" makes intent of test explicit , removes possible ambiguities.


Comments

Popular posts from this blog

javascript - gulp-nodemon - nodejs restart after file change - Error: listen EADDRINUSE events.js:85 -

Fatal Python error: Py_Initialize: unable to load the file system codec. ImportError: No module named 'encodings' -

javascript - oscilloscope of speaker input stops rendering after a few seconds -