Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
c66fdf0f
Commit
c66fdf0f
authored
Aug 25, 2020
by
Désirée Chevalier
Committed by
Mike Jang
Aug 25, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update E2E best practices for blurring elements
parent
e6184680
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
1 deletion
+24
-1
doc/development/testing_guide/end_to_end/best_practices.md
doc/development/testing_guide/end_to_end/best_practices.md
+24
-1
No files found.
doc/development/testing_guide/end_to_end/best_practices.md
View file @
c66fdf0f
# End-to-end testing Best Practices
# End-to-end testing Best Practices
NOTE:
**Note:**
NOTE:
**Note:**
This is a
n
tailored extension of the Best Practices
[
found in the testing guide
](
../best_practices.md
)
.
This is a tailored extension of the Best Practices
[
found in the testing guide
](
../best_practices.md
)
.
## Prefer API over UI
## Prefer API over UI
...
@@ -166,3 +166,26 @@ end
...
@@ -166,3 +166,26 @@ end
NOTE:
**Note:**
NOTE:
**Note:**
A few exceptions for using a
`ProjectPush`
would be when your test calls for testing SSH integration or
A few exceptions for using a
`ProjectPush`
would be when your test calls for testing SSH integration or
using the Git CLI.
using the Git CLI.
## Preferred method to blur elements
To blur an element, the preferred method is to click another element that does not alter the test state.
If there's a mask that blocks the page elements, such as may occur with some dropdowns,
use WebDriver's native mouse events to simulate a click event on the coordinates of an element. Use the following method:
`click_element_coordinates`
.
Avoid clicking the
`body`
for blurring elements such as inputs and dropdowns because it clicks the center of the viewport.
This action can also unintentionally click other elements, altering the test state and causing it to fail.
```
ruby
# Clicking another element to blur an input
def
add_issue_to_epic
(
issue_url
)
find_element
(
:issue_actions_split_button
).
find
(
'button'
,
text:
'Add an issue'
).
click
fill_element
:add_issue_input
,
issue_url
# Clicking the title blurs the input
click_element
:title
click_element
:add_issue_button
end
# Using native mouse click events in the case of a mask/overlay
click_element_coordinates
(
:title
)
```
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment