MasterJourney.js 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. /*global QUnit*/
  2. sap.ui.define([
  3. "sap/ui/test/opaQunit",
  4. "./pages/Master"
  5. ], function (opaTest) {
  6. "use strict";
  7. QUnit.module("Master List");
  8. opaTest("Should see the master list with all entries", function (Given, When, Then) {
  9. // Arrangements
  10. Given.iStartMyApp();
  11. // Assertions
  12. Then.onTheMasterPage.iShouldSeeTheList().
  13. and.theListShouldHaveAllEntries().
  14. and.theHeaderShouldDisplayAllEntries();
  15. });
  16. opaTest("Search for the First object should deliver results that contain the firstObject in the name", function (Given, When, Then) {
  17. var sSearch = "B";
  18. //Actions
  19. When.onTheMasterPage.iSearchFor(sSearch);
  20. // Assertions
  21. Then.onTheMasterPage.theListShowsOnlyObjectsContaining(sSearch);
  22. });
  23. opaTest("Entering something that cannot be found into search field and pressing search field's refresh should leave the list as it was", function (Given, When, Then) {
  24. //Actions
  25. When.onTheMasterPage.iSearchForNotFound()
  26. .and.iClearTheSearch();
  27. // Assertions
  28. Then.onTheMasterPage.theListHasEntries();
  29. });
  30. opaTest("Entering something that cannot be found into search field and pressing 'search' should display the list's 'not found' message", function (Given, When, Then) {
  31. //Actions
  32. When.onTheMasterPage.iSearchForNotFound();
  33. // Assertions
  34. Then.onTheMasterPage.iShouldSeeTheNoDataText().
  35. and.theListHeaderDisplaysZeroHits();
  36. });
  37. opaTest("Should display items again if the searchfield is emptied", function (Given, When, Then) {
  38. //Actions
  39. When.onTheMasterPage.iClearTheSearch();
  40. // Assertions
  41. Then.onTheMasterPage.theListShouldHaveAllEntries();
  42. });
  43. opaTest("MasterList Filtering on Shipped Orders", function(Given, When, Then) {
  44. // Action
  45. When.onTheMasterPage.iFilterTheListOn("masterFilterShipped");
  46. // Assertion
  47. Then.onTheMasterPage.theListShouldBeFilteredOnShippedOrders();
  48. });
  49. opaTest("MasterList remove filter should display all items", function(Given, When, Then) {
  50. // Action
  51. When.onTheMasterPage.iResetFilters();
  52. // Assertion
  53. Then.onTheMasterPage.theListShouldHaveAllEntries();
  54. });
  55. opaTest("MasterList grouping created group headers", function(Given, When, Then) {
  56. // Action
  57. When.onTheMasterPage.iGroupTheList();
  58. // Assertion
  59. Then.onTheMasterPage.theListShouldContainAGroupHeader();
  60. });
  61. opaTest("Remove grouping from MasterList delivers initial list", function(Given, When, Then) {
  62. // Action
  63. When.onTheMasterPage.iResetGrouping();
  64. // Assertion
  65. Then.onTheMasterPage.theListShouldNotContainGroupHeaders().
  66. and.theListShouldHaveAllEntries();
  67. // Cleanup
  68. Then.iTeardownMyApp();
  69. });
  70. });