-
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.
Added everything for Step 13: Testing User Interaction
- Loading branch information
Showing
2 changed files
with
78 additions
and
48 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 |
---|---|---|
@@ -1,41 +1,65 @@ | ||
sap.ui.define([ | ||
'sap/ui/test/Opa5', | ||
'sap/ui/test/matchers/Properties', | ||
'sap/ui/test/actions/Press' | ||
], function (Opa5, Properties, Press) { | ||
"use strict"; | ||
var sViewName = "Post"; | ||
Opa5.createPageObjects({ | ||
onThePostPage: { | ||
actions: { | ||
iPressTheBackButton: function () { | ||
return this.waitFor({ | ||
id: "page", | ||
viewName: sViewName, | ||
actions: new Press(), | ||
errorMessage: "Did not find the nav button on object page" | ||
}); | ||
} | ||
}, | ||
assertions: { | ||
theTitleShouldDisplayTheName: function (sName) { | ||
return this.waitFor({ | ||
success: function () { | ||
return this.waitFor({ | ||
id: "objectHeader", | ||
viewName: sViewName, | ||
matchers: new Properties({ | ||
title: sName | ||
}), | ||
success: function (oPage) { | ||
Opa5.assert.ok(true, "was on the remembered detail page"); | ||
}, | ||
errorMessage: "The Post " + sName + " is not shown" | ||
}); | ||
} | ||
}); | ||
} | ||
} | ||
} | ||
}); | ||
}); | ||
sap.ui.define( | ||
[ | ||
"sap/ui/test/Opa5", | ||
"sap/ui/test/matchers/Properties", | ||
"sap/ui/test/actions/Press", | ||
], | ||
function (Opa5, Properties, Press) { | ||
"use strict"; | ||
var sViewName = "Post"; | ||
Opa5.createPageObjects({ | ||
onThePostPage: { | ||
actions: { | ||
iPressTheBackButton: function () { | ||
return this.waitFor({ | ||
id: "page", | ||
viewName: sViewName, | ||
actions: new Press(), | ||
errorMessage: "Did not find the nav button on object page", | ||
}); | ||
}, | ||
iPressOnTheTabWithTheKey: function (sKey) { | ||
return this.waitFor({ | ||
controlType: "sap.m.IconTabFilter", | ||
viewName: sViewName, | ||
matchers: new Properties({ | ||
key: sKey, | ||
}), | ||
actions: new Press(), | ||
errorMessage: "Cannot find the icon tab bar", | ||
}); | ||
}, | ||
}, | ||
assertions: { | ||
theTitleShouldDisplayTheName: function (sName) { | ||
return this.waitFor({ | ||
success: function () { | ||
return this.waitFor({ | ||
id: "objectHeader", | ||
viewName: sViewName, | ||
matchers: new Properties({ | ||
title: sName, | ||
}), | ||
success: function (oPage) { | ||
Opa5.assert.ok(true, "was on the remembered detail page"); | ||
}, | ||
errorMessage: "The Post " + sName + " is not shown", | ||
}); | ||
}, | ||
}); | ||
}, | ||
iShouldSeeTheViewCounter: function () { | ||
return this.waitFor({ | ||
id: "viewCounter", | ||
viewName: sViewName, | ||
success: function () { | ||
Opa5.assert.ok(true, "The view counter was visible"); | ||
}, | ||
errorMessage: "The view counter could not be found", | ||
}); | ||
}, | ||
}, | ||
}, | ||
}); | ||
} | ||
); |