@@ -37,15 +37,6 @@ exports.login = function(loginPageAlreadyLoaded) {
37
37
} , 5000 ) ;
38
38
} ;
39
39
40
- exports . setInputValue = function ( name , value ) {
41
- var input = element ( by . model ( name ) ) ;
42
- expect ( input ) . toBeTruthy ( ) ;
43
- input . clear ( ) ;
44
- input . sendKeys ( value ) ;
45
- expect ( input . getAttribute ( "value" ) ) . toBe ( value ) ;
46
- return input ;
47
- } ;
48
-
49
40
exports . clickAndGo = function ( buttonText , uri ) {
50
41
var button = element ( by . buttonText ( buttonText ) ) ;
51
42
browser . wait ( EC . elementToBeClickable ( button ) , 2000 ) ;
@@ -70,13 +61,15 @@ exports.waitForUri = waitForUri;
70
61
// example:
71
62
// waitForElement(element(by.css('.foo'))); // success
72
63
// waitForElement(element.all(by.css('.foos'))); // fail, incorrect element.all
73
- exports . waitForElem = function ( elem , timeout ) {
64
+ var waitForElem = function ( elem , timeout ) {
74
65
return browser . wait ( EC . presenceOf ( elem ) , timeout || 5000 , 'Element not found' ) ;
75
66
} ;
67
+ exports . waitForElem = waitForElem ;
76
68
77
- exports . waitForElemRemoval = function ( elem , timeout ) {
69
+ var waitForElemRemoval = function ( elem , timeout ) {
78
70
return browser . wait ( EC . not ( EC . presenceOf ( elem ) ) , timeout || 5000 , 'Element did not disappear' ) ;
79
71
} ;
72
+ exports . waitForElemRemoval = waitForElemRemoval ;
80
73
81
74
// an alt to waitForElem()
82
75
// waitForElem() does not use protractor.ExpectConditions, which can occasionally flake
@@ -115,3 +108,12 @@ exports.waitFor = function(item, timeout, msg) {
115
108
msg = msg || '' ;
116
109
return browser . wait ( item , timeout , msg ) ;
117
110
} ;
111
+
112
+ exports . setInputValue = function ( name , value ) {
113
+ var input = element ( by . model ( name ) ) ;
114
+ waitForElem ( input ) ;
115
+ input . clear ( ) ;
116
+ input . sendKeys ( value ) ;
117
+ expect ( input . getAttribute ( "value" ) ) . toBe ( value ) ;
118
+ return input ;
119
+ } ;
0 commit comments