Cucumber/Behave & reading files?
Hey there,
I'm quite new to this part of sw testing, but I need to write some behave/cucumber tests to read some text files.
From all the examples I've see, there's much more in the realm of browser-based testing, so I haven't been able to find much for analyzing text files. Any code snippets/samples that I can use as a starting point?
Any help appreciated!
.
EDIT: As an example, if I wanted to read a terraform file (e.g.: main.tf, or the tfplan in json format) and scanning for something like ACL: "public-read" on an s3 bucket resource)
Posted Apr 9, 2020, 12:57 PM UTC · edited
32
You can do it as a given
the given is very much like the when above, except you would add what you need to the context
do your analysis in the when, again putting results of that in context
and then check for your expectations in the then.
oh nice, this is exactly what I was looking for to get jumpstarted, thank you!