-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
7 changed files
with
77 additions
and
36 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,13 @@ | ||
/** | ||
* Created by User on 12/03/2017. | ||
*/ | ||
var HomePageObjects = function () { | ||
var inputName = element(by.model('yourName')); | ||
var greetingsName = element(by.binding('yourName')); | ||
|
||
this.get = function () { | ||
browser.get("https://angularjs.org/"); | ||
}; | ||
|
||
this.setName = function (name) { | ||
inputName.sendKeys('world') | ||
}; | ||
|
||
this.getGreeting = function () { | ||
return greetingsName.getText(); | ||
} | ||
} | ||
|
||
var pageHome = require('./pages/withpageobj.page.js'); | ||
var testString = 'test' | ||
describe('test with page objects',function () { | ||
it('Should get the name used with hello',function () { | ||
var page = new HomePageObjects(); | ||
var page = new pageHome(); | ||
page.get(); | ||
page.setName('test'); | ||
expect(page.getGreeting()).toEqual('Hello world!'); | ||
page.setName(testString); | ||
expect(page.getGreeting()).toEqual('Hello '+testString+'!'); | ||
}) | ||
|
||
|
||
}); |
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 |
---|---|---|
@@ -1,23 +1,50 @@ | ||
/** | ||
* Created by User on 12/03/2017. | ||
*/ | ||
var HtmlScreenshotReporter = require('protractor-jasmine2-screenshot-reporter'); | ||
|
||
var reporter = new HtmlScreenshotReporter({ | ||
dest: './target/screenshots', | ||
filename: 'test-report.html', | ||
reportTitle: "Test", | ||
showSummary: true | ||
}); | ||
|
||
exports.config={ | ||
framework: 'jasmine', | ||
beforeLaunch: function() { | ||
return new Promise(function(resolve){ | ||
reporter.beforeLaunch(resolve); | ||
}); | ||
}, | ||
framework: 'jasmine2', | ||
params:{ | ||
baseURL:'https://angularjs.org/' | ||
}, | ||
seleniumAddress: 'http://localhost:4444/wd/hub', | ||
//sauceUser:'debasisjagadev', | ||
//sauceKey:'c68d4548-a1a1-42cb-a2f1-a68eb27ba', | ||
//sauceKey:'c68d4548-a1a1-42cb-a2f1-a68eb27ba837', | ||
suites:{ | ||
//basictest:'spec.js', | ||
//othertest:'otherspec.js', | ||
basictest:'testsangular.spec.js', | ||
othertest:'otherspec.js', | ||
pagetest:'WithPageObjects.js' | ||
}, | ||
|
||
capabilities: { | ||
browserName: 'chrome' | ||
browserName: 'chrome', | ||
//deviceName:'iPhone 6s Plus Device', | ||
//platformVersion:'9.3', | ||
//platformName:'iOS', | ||
//deviceOrientation:'portrait', | ||
//name: 'basic tests' | ||
}, | ||
onPrepare:function () { | ||
browser.driver.manage().window().maximize(); | ||
jasmine.getEnv().addReporter(reporter); | ||
}, | ||
afterLaunch: function(exitCode) { | ||
return new Promise(function(resolve){ | ||
reporter.afterLaunch(resolve.bind(this, exitCode)); | ||
}); | ||
} | ||
//, | ||
//{ | ||
// browserName: 'chrome' | ||
//} | ||
|
||
}; |
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
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,7 @@ | ||
/** | ||
* Created by User on 16/03/2017. | ||
*/ | ||
module.exports = function () { | ||
this.name = element(by.model('yourName')); | ||
this.span = element(by.binding('yourName')); | ||
} |
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,19 @@ | ||
/** | ||
* Created by User on 16/03/2017. | ||
*/ | ||
module.exports = function () { | ||
var inputName = element(by.model('yourName')); | ||
var greetingsName = element(by.binding('yourName')); | ||
|
||
this.get = function () { | ||
browser.get(browser.params.baseURL); | ||
}; | ||
|
||
this.setName = function (name) { | ||
inputName.sendKeys(name); | ||
}; | ||
|
||
this.getGreeting = function () { | ||
return greetingsName.getText(); | ||
} | ||
} |
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