FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
frontend/admin/src/test/java/com/gu/test/JasmineTest.java at events · 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
/
admin
/
src
/
test
/
java
/
com
/
gu
/
test
/
JasmineTest.java
Copy path
More file actions
More file actions
Latest commit
History
History
History
55 lines (42 loc) · 1.69 KB
Breadcrumbs
frontend
/
admin
/
src
/
test
/
java
/
com
/
gu
/
test
/
JasmineTest.java
Copy path
File metadata and controls
55 lines (42 loc) · 1.69 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
package
com
.
gu
.
test
;
import
static
org
.
junit
.
Assert
.*;
import
java
.
io
.
File
;
import
junit
.
framework
.
Assert
;
import
org
.
junit
.
After
;
import
org
.
junit
.
Before
;
import
org
.
junit
.
Test
;
import
org
.
openqa
.
selenium
.
By
;
import
org
.
openqa
.
selenium
.
WebDriver
;
import
org
.
openqa
.
selenium
.
firefox
.
FirefoxDriver
;
public
class
JasmineTest
{
private
WebDriver
driver
;
private
String
host
;
private
StringBuffer
verificationErrors
=
new
StringBuffer
();
@
Before
public
void
setUp
()
throws
Exception
{
driver
=
new
FirefoxDriver
();
File
dir1
=
new
File
(
"."
);
//locate current directory and open the url from file
driver
.
get
(
"file:///"
+
dir1
.
getCanonicalPath
() +
"/public/javascripts/spec/SpecRunner.html"
);
//check if are on the right page
assertTrue
(
"Error in opening Jasmine runner"
,
driver
.
getTitle
().
contains
(
"Jasmine"
));
}
@
Test
public
void
jasmineTest
()
throws
Exception
{
if
(
driver
.
findElements
(
By
.
cssSelector
(
"span.failingAlert.bar"
)).
size
() !=
0
) {
System
.
out
.
println
(
"=========================================================================================="
);
System
.
out
.
println
(
driver
.
findElement
(
By
.
cssSelector
(
"span.failingAlert.bar"
)).
getText
());
System
.
out
.
println
(
"=========================================================================================="
);
System
.
out
.
println
(
driver
.
findElement
(
By
.
xpath
(
"id('details')"
)).
getText
());
System
.
out
.
println
(
"=========================================================================================="
);
}
}
@
After
public
void
tearDown
()
throws
Exception
{
driver
.
quit
();
String
verificationErrorString
=
verificationErrors
.
toString
();
if
(!
""
.
equals
(
verificationErrorString
)) {
fail
(
verificationErrorString
);
}
}
}
Back
|
FazBrowse Home
|
New Git URL