Understanding Navigating
Let’s understand Navigating. But before we understand navigating, let’s have a look at Capybara. It provides developers to simulate a user on a web page as well as make assertions based on the content and environment of the page. It also offers an API to interact with the web page. Also, let’s check out DSL.
DSL stands for Digital Subscriber Line. Moreover, users get a high-speed bandwidth connection from a phone wall jack on an existing telephone network. Not to mention, it also works within the frequencies that the telephone doesn’t so you can use the Internet while making phone calls. DSL utilizes telephone wires, which makes sense that the biggest providers are telephone companies.
You can use the visit method to navigate to other pages:
visit(‘/projects’)
visit(post_comments_path(post))
The visit method only takes a single parameter, the request method is always GET.
You can get the current path of the browsing session for test assertions:
expect(current_path).to eq(post_comments_path(post))
We hope, from the above example you must have a clear idea about navigating the DSL.
Make your resume stand out and become a Certified Capybara Testing Professional. So, Try free practice tests here!
A great career is just a certification away. So, practice and validate your skills to become Certified Capybara Testing Professional