Commit 93c649db authored by Walmyr Lima's avatar Walmyr Lima

Document click_ vs. go_to_ standard for e2e tests

parent 9763c9cc
......@@ -48,6 +48,7 @@ will need to [modify your GDK setup](
### Writing tests
1. [Using page objects](qa/page/
2. [Style guide](
### Running specific tests
# Style guide for writing GUI tests
This document describes the conventions used at GitLab for writing GUI tests using the GitLab QA project.
## `click_` versus `go_to_`
### When to use `click_`?
When clicking in a single link to navigate, use `click_`.
def click_ci_cd_pipelines
within_sidebar do
click_element :link_pipelines
From a testing perspective, if we want to check that clicking a link, or a button (a single interaction) is working as intended, we would want the test to read as:
- Click a certain element
- Verify the action took place
### When to use `go_to_`?
When interacting with multiple elements to go to a page, use `go_to_`.
def go_to_operations_environments
hover_operations do
within_submenu do
`go_to_` fits the definition of interacting with multiple elements very well given it's more of a meta-navigation action that includes multiple interactions.
Notice that in the above example, before clicking the `:operations_environments_link`, another element is hovered over.
> We can create these methods as helpers to abstrac multi-step navigation.
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment