-
-
Notifications
You must be signed in to change notification settings - Fork 13
/
visibility.feature
85 lines (78 loc) · 3.58 KB
/
visibility.feature
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
@visibility @skipped
Feature: Check that VisibilityTrait works
@api @javascript
Scenario: Assert step definition "Then /^(?:|I )should see a visible "(?P<selector>[^"]*)" element" succeeds as expected
Given I am an anonymous user
When I visit "/sites/default/files/relative.html"
Then I should see a visible "#top" element
@trait:VisibilityTrait
Scenario: Assert step definition "Then /^(?:|I )should see a visible "(?P<selector>[^"]*)" element" fails as expected
Given some behat configuration
And scenario steps tagged with "@api @javascript":
"""
Given I am an anonymous user
When I visit "/sites/default/files/relative.html"
Then I should see a visible "#hidden" element
"""
When I run "behat --no-colors"
Then it should fail with an error:
"""
Element defined by "#hidden" selector is not visible on the page.
"""
@api @javascript
Scenario: Assert step definition "Then /^(?:|I )should not see a visible "(?P<selector>[^"]*)" element" succeeds as expected
Given I am an anonymous user
When I visit "/sites/default/files/relative.html"
Then I should not see a visible "#hidden" element
@trait:VisibilityTrait
Scenario: Assert step definition "Then /^(?:|I )should not see a visible "(?P<selector>[^"]*)" element" fails as expected
Given some behat configuration
And scenario steps tagged with "@api @javascript":
"""
Given I am an anonymous user
When I visit "/sites/default/files/relative.html"
Then I should not see a visible "#top" element
"""
When I run "behat --no-colors"
Then it should fail with an error:
"""
Element defined by "#top" selector is visible on the page, but should not be.
"""
@api @javascript
Scenario: Assert step definition "Then /^(?:|I )should see a visually visible "(?P<selector>[^"]*)" element" and "Then /^(?:|I )should not see a visually hidden "(?P<selector>[^"]*)" element" succeeds as expected
Given I am an anonymous user
When I visit "/sites/default/files/relative.html"
Then I should see a visually visible "#top" element
# Accessibility element visible to screen reader are visible to normal
# visibility assertion, but visually hidden.
And I should see a visible "#sr-only" element
And I should not see a visually hidden "#sr-only" element
And I should not see a visually hidden "#sr-only-focusable" element
@trait:VisibilityTrait
Scenario: Assert step definition "Then /^(?:|I )should see a visually visible "(?P<selector>[^"]*)" element" fails as expected
Given some behat configuration
And scenario steps tagged with "@api @javascript":
"""
Given I am an anonymous user
When I visit "/sites/default/files/relative.html"
Then I should see a visually visible "#sr-only" element
"""
When I run "behat --no-colors"
Then it should fail with an error:
"""
Element(s) defined by "#sr-only" selector is not visually visible on the page.
"""
@trait:VisibilityTrait
Scenario: Assert step definition "Then /^(?:|I )should not see a visually hidden "(?P<selector>[^"]*)" element" fails as expected
Given some behat configuration
And scenario steps tagged with "@api @javascript":
"""
Given I am an anonymous user
When I visit "/sites/default/files/relative.html"
Then I should not see a visually hidden "#top" element
"""
When I run "behat --no-colors"
Then it should fail with an error:
"""
Element(s) defined by "#top" selector is visually visible on the page, but should not be.
"""