Advice on using scenarios

What are the guidelines or rules for what kind of Ruby and/or Rails code is permitted/appropriate inside a “scenario”, and what kind of code is not appropriate?

Background:

I am just starting with cypress-on-rails.

I installed it because I’m refactoring a legacy rails app that rendered most views using erb to use react-on-rails. But now I can’t use the assert_select method to check for the presence of DOM elements, since they are rendered by React.

My question pertains to the use of scenarios. I want to set up scenarios where various types of users are logged in (normally this is done with Devise/OAuth).

For integration tests written in Ruby, I was able to do this easily with methods from https://www.rubydoc.info/gems/devise/Devise/Test/IntegrationHelpers.

However, when I try to include that file in a scenario, I get a variety of errors.

This leads me to believe that I have a misunderstanding about how to go about setting up state for my tests using Ruby code.

Does anyone have any suggestions?

@pconrad, please take a look at this article below. I’m guessing the devise test integration helpers won’t work because they modify the Rails server in the context of the test. When writing cypress-on-rails tests, the Rails server is very independent. The cypress-on-rails gem allows you to invoke some method on the Rails server. That may or may not work in the context of Gems that are made to work with normal Rails system tests.

Here’s the article with details on logging in: