FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
frontend/article/test/SectionsNavigationFeatureTest.scala at master · devhttps/frontend · GitHub
devhttps
/
frontend
Public
forked from
guardian/frontend
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
frontend
/
article
/
test
/
SectionsNavigationFeatureTest.scala
Copy path
More file actions
More file actions
Latest commit
History
History
History
78 lines (54 loc) · 2.78 KB
Breadcrumbs
frontend
/
article
/
test
/
SectionsNavigationFeatureTest.scala
Copy path
File metadata and controls
78 lines (54 loc) · 2.78 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
package
test
import
org
.
scalatest
.{
DoNotDiscover
,
Matchers
,
GivenWhenThen
,
FeatureSpec
}
import
collection
.
JavaConverters
.
_
import
org
.
fluentlenium
.
core
.
filter
.
FilterConstructor
.
_
import
conf
.
Configuration
@
DoNotDiscover
class
SectionsNavigationFeatureTest
extends
FeatureSpec
with
GivenWhenThen
with
Matchers
with
ConfiguredTestSuite
{
implicit
val
config
=
Configuration
feature(
"
Section Navigation
"
) {
scenario(
"
Link to US edition
"
,
ArticleComponents
) {
Given
(
"
I am on any guardian.co.uk page
"
)
goTo(
"
/world/2012/aug/23/australia-mining-boom-end
"
) { browser
=>
Then
(
"
I should see a link to the US edition
"
)
val
editionLink
=
browser.el(
"
[data-link-name='nav2 : topbar : edition-picker: US']
"
)
editionLink.attribute(
"
href
"
) should be(
s
"
http://localhost:
${port}
/preference/edition/us
"
)
}
}
scenario(
"
Link to UK edition
"
,
ArticleComponents
) {
Given
(
"
I am on any guardiannews.com page
"
)
US
(
"
/world/2012/aug/23/australia-mining-boom-end
"
) { browser
=>
Then
(
"
I should see a link to the UK edition
"
)
val
editionLink
=
browser.el(
"
[data-link-name='nav2 : topbar : edition-picker: UK']
"
)
editionLink.attribute(
"
href
"
) should be(
s
"
http://localhost:
${port}
/preference/edition/uk
"
)
}
}
scenario(
"
Links to company information
"
,
ArticleComponents
) {
Given
(
"
I am on any guardian.co.uk page
"
)
US
(
"
/world/2012/aug/23/australia-mining-boom-end
"
) { browser
=>
Then
(
"
I should see a link to the contributors section
"
)
val
contributors
=
browser.find(
"
.l-footer li a
"
, withText().contains(
"
contributors
"
))
contributors.asScala.length should be
>
0
And
(
"
a link to the contact us page
"
)
val
contact
=
browser.find(
"
.l-footer li a
"
, withText().contains(
"
contact
"
))
contact.asScala.length should be
>
0
And
(
"
a link to the about us page
"
)
val
info
=
browser.find(
"
.l-footer li a
"
, withText().contains(
"
about us
"
))
info.asScala.length should be
>
0
And
(
"
a link to the complaints and corrections
"
)
val
complaints
=
browser.find(
"
.l-footer li a
"
, withText().contains(
"
complaints & corrections
"
))
complaints.asScala.length should be
>
0
}
}
scenario(
"
Links to legal information
"
,
ArticleComponents
) {
Given
(
"
I am on any guardian.co.uk page
"
)
US
(
"
/world/2012/aug/23/australia-mining-boom-end
"
) { browser
=>
Then
(
"
I should see a link to the terms & Conditions in the page footer
"
)
val
terms
=
browser.find(
"
.l-footer li a
"
, withText().contains(
"
terms
"
))
terms.asScala.length should be
>
0
And
(
"
a link to the privacy policy page
"
)
val
privacy
=
browser.find(
"
.l-footer li a
"
, withText().contains(
"
privacy
"
))
privacy.asScala.length should be
>
0
}
}
}
}
Back
|
FazBrowse Home
|
New Git URL