-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7046 from LeeDr/newShieldLogin
Minimal changes to support Shield Login.
- Loading branch information
Showing
2 changed files
with
53 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// in test/support/pages/shield_page.js | ||
define(function (require) { | ||
var config = require('intern').config; | ||
var defaultTimeout = config.timeouts.default; | ||
|
||
// the page object is created as a constructor | ||
// so we can provide the remote Command object | ||
// at runtime | ||
function ShieldPage(remote) { | ||
this.remote = remote; | ||
} | ||
|
||
ShieldPage.prototype = { | ||
constructor: ShieldPage, | ||
|
||
login: function login(user, pwd) { | ||
var remote = this.remote; | ||
return remote.setFindTimeout(5000) | ||
.findById('username') | ||
.type(user) | ||
.then(function () { | ||
return remote.findById('password') | ||
.type(pwd); | ||
}) | ||
.then(function () { | ||
return remote.findByCssSelector('.btn') | ||
.click(); | ||
}); | ||
} | ||
|
||
|
||
}; | ||
|
||
return ShieldPage; | ||
}); |