diff options
author | ddavison <ddavison@gitlab.com> | 2019-05-21 14:21:09 -0700 |
---|---|---|
committer | ddavison <ddavison@gitlab.com> | 2019-05-21 14:21:09 -0700 |
commit | 0e20bf766dddb54bbb3b19d7c8d1bf98e293c76f (patch) | |
tree | 83d6c65bb5bf7ee9e8e8081183a22697c561bccf /qa/docs/GUIDELINES.md | |
parent | bb5bbbaa1a64d18108470132bb2ed8ed5da52ce7 (diff) | |
download | gitlab-ce-doc-qa-doc-element-guidelines.tar.gz |
Add documentation for element naming conventionsdoc-qa-doc-element-guidelines
Refactor all capital files to lowercase
Diffstat (limited to 'qa/docs/GUIDELINES.md')
-rw-r--r-- | qa/docs/GUIDELINES.md | 46 |
1 files changed, 0 insertions, 46 deletions
diff --git a/qa/docs/GUIDELINES.md b/qa/docs/GUIDELINES.md deleted file mode 100644 index 9db52cd07e6..00000000000 --- a/qa/docs/GUIDELINES.md +++ /dev/null @@ -1,46 +0,0 @@ -# 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_`. - -E.g.: - -```ruby -def click_ci_cd_pipelines - within_sidebar do - click_element :link_pipelines - end -end -``` - -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_`. - -E.g.: - -```ruby -def go_to_operations_environments - hover_operations do - within_submenu do - click_element(:operations_environments_link) - end - end -end -``` - -`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 abstract multi-step navigation. |