FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
frontend/sport/test/LeagueTablesFeatureTest.scala at test-code-owners · 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
/
sport
/
test
/
LeagueTablesFeatureTest.scala
Copy path
More file actions
More file actions
Latest commit
History
History
History
73 lines (57 loc) · 2.22 KB
Breadcrumbs
frontend
/
sport
/
test
/
LeagueTablesFeatureTest.scala
Copy path
File metadata and controls
73 lines (57 loc) · 2.22 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
package
test
import
football
.
controllers
.
LeagueTableController
import
play
.
api
.
test
.
_
import
play
.
api
.
test
.
Helpers
.
_
import
org
.
scalatest
.
_
@
DoNotDiscover
class
LeagueTablesFeatureTest
extends
FeatureSpec
with
GivenWhenThen
with
Matchers
with
ConfiguredTestSuite
with
FootballTestData
with
WithTestExecutionContext
with
WithTestFootballClient
with
BeforeAndAfterAll
with
WithMaterializer
with
WithTestApplicationContext
with
WithTestWsClient
{
feature(
"
League Tables
"
) {
scenario(
"
Visit 'all tables' page
"
) {
Given
(
"
I visit the a all tables page
"
)
goTo(
"
/football/tables
"
) { browser
=>
import
browser
.
_
Then
(
"
I should see the 4 few entries of each table
"
)
val
teams
=
$(
"
.team-name__long
"
).texts
teams should contain(
"
Arsenal
"
)
teams should contain(
"
Man U
"
)
teams should contain(
"
Man C
"
)
teams should contain(
"
Chelsea
"
)
teams should not contain
"
Wigan
"
//
5th in prem league not visible
And
(
"
I should have a generic H1, with league name H2s
"
)
Then
(
"
The <h1> Should be tables
"
)
val
h2
=
$(
"
h2
"
)
$(
"
h1
"
).texts should contain(
"
Football tables
"
)
h2.texts should contain(
"
Premier League
"
)
h2.texts should contain(
"
Champions League
"
)
}
}
scenario(
"
Visit 'competition table' page
"
) {
Given
(
"
I visit the a competition league table page
"
)
goTo(
"
/football/premierleague/table
"
) { browser
=>
import
browser
.
_
Then
(
"
I should see all the teams in this league
"
)
val
teams
=
$(
"
.team-name__long
"
).texts
teams should contain(
"
Arsenal
"
)
teams should contain (
"
Wigan
"
)
//
I can now see all items
And
(
"
I should see a nice SEO h1 el on the page, describing the current competition
"
)
$(
"
h1
"
).texts should contain(
"
Premier League
"
)
$(
"
h1
"
).texts should not contain
"
Championship League
"
}
}
scenario(
"
Should redirect when no competition table data found
"
) {
val
leagueTableController
=
new
LeagueTableController
(testCompetitionsService, play.api.test.
Helpers
.stubControllerComponents())
val
result
=
leagueTableController.renderCompetition(
"
sfgsfgsfg
"
)(
FakeRequest
())
status(result) should be(
303
)
}
}
}
Back
|
FazBrowse Home
|
New Git URL