Skip to content

Commit 59834e7

Browse files
committed
Updated protractor tests and fixed proxy re SchizoDuckie#248
1 parent 91f029c commit 59834e7

File tree

3 files changed

+35
-2
lines changed

3 files changed

+35
-2
lines changed

tests/Favorites.js

+10-1
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,21 @@ function Favorites() {
1212
return element(by.css('series-list'));
1313
};
1414

15-
this.getSearchResults = function(cb) {
15+
this.getSearchResults = function() {
1616
return element.all(by.css('series-list serieheader')).then(function(elements) {
1717
return elements;
1818
});
1919
};
2020

21+
this.getDoctorWhoAddingEarmark = function() {
22+
return element(by.css('series-list serieheader:nth-child(3) em.earmark.adding'));
23+
};
24+
25+
26+
this.getDoctorWhoAddedEarmark = function() {
27+
return element(by.cssContainingText('series-list serieheader:nth-child(3) em.earmark', '✓'));
28+
};
29+
2130
/*
2231
2332
this.getAddSampleButton = function() {

tests/proxy.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010

1111
// if there's a cached version of this request in fixtures, serve it.
12-
$cache = dirname(__FILE__).'/tests/fixtures/'.sha1($_GET['url']).'.json';
12+
$cache = dirname(__FILE__).'/fixtures/'.sha1($_GET['url']).'.json';
1313
if(file_exists($cache)) {
1414
$out = json_decode(file_get_contents($cache),true);
1515
foreach($out['headers'] as $key=>$val) {

tests/test-main.js

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
var allTestFiles = [];
2+
var TEST_REGEXP = /(spec|test)\.js$/i;
3+
4+
var pathToModule = function(path) {
5+
return path.replace(/^\/base\//, '').replace(/\.js$/, '');
6+
};
7+
8+
Object.keys(window.__karma__.files).forEach(function(file) {
9+
if (TEST_REGEXP.test(file)) {
10+
// Normalize paths to RequireJS module names.
11+
allTestFiles.push(pathToModule(file));
12+
}
13+
});
14+
15+
require.config({
16+
// Karma serves files under /base, which is the basePath from your config file
17+
baseUrl: '/base',
18+
19+
// dynamically load all test files
20+
deps: allTestFiles,
21+
22+
// we have to kickoff jasmine, as it is asynchronous
23+
callback: window.__karma__.start
24+
});

0 commit comments

Comments
 (0)