-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBanking.js
More file actions
36 lines (32 loc) · 1.29 KB
/
Banking.js
File metadata and controls
36 lines (32 loc) · 1.29 KB
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
describe("Test Automation of a banking app", function() {
it("Validates customer login test", function() {
browser.get("http://www.way2automation.com/angularjs-protractor/banking/#/login");
element(by.buttonText("Customer Login")).click();
expect(browser.getTitle()).toContain("Protractor practice");
element.all(by.css("#userSelect option")).then(function(items){
// Printing values from dropdown list
console.log("----- Printing values from dropdown list -----");
console.log("Total values in dropdown are: " + items.length);
console.log("List of values:");
for(i=0; i<items.length; i++){
items[i].getText().then(function(text){
console.log(text);
});
}
console.log("----- Printing value attributes from dropdown list -----");
for(i=0; i<items.length; i++){
items[i].getAttribute("value").then(function(value){
console.log(value);
});
}
element(by.model("custId")).$("[value='2']").click();
var selection = element(by.model("custId")).$("[value='2']").getText();
element(by.buttonText("Login")).click();
// element(by.binding("user")).getText().then(function(text){
// console.log(text);
// });
expect(element(by.binding("user")).getText()).toEqual(selection);
});
browser.sleep(3000);
})
})