I want to run an E2E test (simple string return) on a web application created with Rails.Environment
Rails version: 5.2.3
Ruby version: 2.5.7p206
The test was executed with the following contents.spec/support/capybara.rb
The following are Capybara settings
The following is the test definition
require 'rails_helper' describe 'Postpage', js: true do specify 'DisplayGreeting' do visit root_path expect (page) .to have_css ('p', text: 'HelloWorld') end end
The following command returns an error like this
docker-compose run web bin/rspec
- Set URL in
Capybara.app_host->The error did not change.
- Set URL in
Capybara.server_host->The error did not change.
- Manual test with Chrome browser->You can get the string HelloWorld as expected.
- `docker-compose run web bin/rspec '
Answer # 1
Please set the test target URL only with
Capybara :: Selenium :: DriverThe URL specified when creating is not the URL to be tested, but the Selenium WebDriver relay server.
The POST/session request that should not have been specified in the test runs
This is due to 8.1 New Session which is the Selenium WebDriver specification.
Answer # 2
In spine reflexes from error messages
I went to the page where access management is being done, and was redirected to the login relationship from there.
So I went to see if I was going to see the same place as the browser and test.
As a result, the same place. And I do n’t know! ! !
Let's test with controllers before features to check the behavior.
- ruby - i added a rails column, but i can't associate it with the user table
- ruby - [rails] posts added to favorites are not saved
- ruby on rails - when a photo is added to a folder on the pc, i want to display it on the browser of the web application!
- ruby - the last db setting doesn't work when deploying rails app on aws
- ruby on rails 5 - actioncontroller :: invalidauthenticitytoken cannot be resolved
- ruby on rails - cart function routing error cannot be resolved
- ruby on rails - rails s can't
- ruby on rails - how to transition from the top page
- ruby on rails - i want to implement a function for administrator users to register luggage for general users in rails
- ruby on rails - things associated with a foreign key cannot be called in view
- ruby on rails 6 - environment construction of ruby on rails
- ruby on rails - error in controller when transitioning with rails6 destory action
- ruby - rails tutorial chapter 2 (6th edition)
- ruby on rails - access fails after seed after deploying to heroku
- ruby on rails runtime error cannot be resolved
- ruby on rails - missing required keys: i'm having trouble resolving the [: id] error
- ruby on rails 5 - some items are not saved in db when posting from rails form
- bootstrap display in ruby on rails is broken
- ruby - [rails] i can't install the add favorite button
- ruby on rails - dealing with wrong number of arguments (given 1, expected 2)
- ruby on rails - how to resolve lib/rack/session/abstract/idrb: 375: in'commit_sesion' that occurs in rspec
- ruby on rails - about request spec of rspec about test code at login
- ruby on rails - how to test that a specific element has a class name using rspec/capybara
- ruby - [rails] unable to resolve "name error in affiliates controller # show" error
- ruby on rails - rails rspec argumenterror occurs when the mock under test has arguments
- [ruby + selenium] how to get the number of characters for each individual page
- ruby on rails - i want to set responsestatus to 200, but it becomes 401
- ruby on rails - i want to write a rails tutorial test in rspec
- ruby on rails - phenomenon that the test that should be an "rspec" error passes
- ruby - i can't install ffi with everyday rails setup