Hi all! I'm new to cypress and looking for advice....
# help
b
Hi all! I'm new to cypress and looking for advice.. I want to send the same POST requests using cypress with different variables for 'email' and 'check_in_date'. The request below is a command in the support file, postAPI() is called before each it() in the spec. I think I can create fixtures for each variable? But I'm not sure how to call those fixtures using postAPI() for each variable?
p
You can add an argument to the anonymous function passed as the second arg of the
.add()
method. Then you can call your command with an arg. For multiple variables, pack them up into an object to use as the single arg
So your test files will import the fixture data then call the cypress command with the fixture data (or whatever pieces of it) as the arg
2 Views