@@ -42,11 +42,7 @@ export default function({ getService, getPageObjects }) {
4242 await PageObjects . dashboard . saveDashboard ( dashboardName ) ;
4343
4444 await PageObjects . dashboard . gotoDashboardLandingPage ( ) ;
45- const countOfDashboards = await listingTable . searchAndGetItemsCount (
46- 'dashboard' ,
47- dashboardName
48- ) ;
49- expect ( countOfDashboards ) . to . equal ( 1 ) ;
45+ await listingTable . searchAndExpectItemsCount ( 'dashboard' , dashboardName , 1 ) ;
5046 } ) ;
5147
5248 it ( 'is not shown when there is a dashboard' , async function ( ) {
@@ -55,11 +51,7 @@ export default function({ getService, getPageObjects }) {
5551 } ) ;
5652
5753 it ( 'is not shown when there are no dashboards shown during a search' , async function ( ) {
58- const countOfDashboards = await listingTable . searchAndGetItemsCount (
59- 'dashboard' ,
60- 'gobeldeguck'
61- ) ;
62- expect ( countOfDashboards ) . to . equal ( 0 ) ;
54+ await listingTable . searchAndExpectItemsCount ( 'dashboard' , 'gobeldeguck' , 0 ) ;
6355
6456 const promptExists = await PageObjects . dashboard . getCreateDashboardPromptExists ( ) ;
6557 expect ( promptExists ) . to . be ( false ) ;
@@ -78,11 +70,7 @@ export default function({ getService, getPageObjects }) {
7870
7971 await PageObjects . common . expectConfirmModalOpenState ( false ) ;
8072
81- const countOfDashboards = await listingTable . searchAndGetItemsCount (
82- 'dashboard' ,
83- dashboardName
84- ) ;
85- expect ( countOfDashboards ) . to . equal ( 1 ) ;
73+ await listingTable . searchAndExpectItemsCount ( 'dashboard' , dashboardName , 1 ) ;
8674 } ) ;
8775
8876 it ( 'succeeds on confirmation press' , async function ( ) {
@@ -91,11 +79,7 @@ export default function({ getService, getPageObjects }) {
9179
9280 await PageObjects . common . clickConfirmOnModal ( ) ;
9381
94- const countOfDashboards = await listingTable . searchAndGetItemsCount (
95- 'dashboard' ,
96- dashboardName
97- ) ;
98- expect ( countOfDashboards ) . to . equal ( 0 ) ;
82+ await listingTable . searchAndExpectItemsCount ( 'dashboard' , dashboardName , 0 ) ;
9983 } ) ;
10084 } ) ;
10185
@@ -109,38 +93,32 @@ export default function({ getService, getPageObjects }) {
10993
11094 it ( 'matches on the first word' , async function ( ) {
11195 await listingTable . searchForItemWithName ( 'Two' ) ;
112- const countOfDashboards = await listingTable . getItemsCount ( 'dashboard' ) ;
113- expect ( countOfDashboards ) . to . equal ( 1 ) ;
96+ await listingTable . expectItemsCount ( 'dashboard' , 1 ) ;
11497 } ) ;
11598
11699 it ( 'matches the second word' , async function ( ) {
117100 await listingTable . searchForItemWithName ( 'Words' ) ;
118- const countOfDashboards = await listingTable . getItemsCount ( 'dashboard' ) ;
119- expect ( countOfDashboards ) . to . equal ( 1 ) ;
101+ await listingTable . expectItemsCount ( 'dashboard' , 1 ) ;
120102 } ) ;
121103
122104 it ( 'matches the second word prefix' , async function ( ) {
123105 await listingTable . searchForItemWithName ( 'Wor' ) ;
124- const countOfDashboards = await listingTable . getItemsCount ( 'dashboard' ) ;
125- expect ( countOfDashboards ) . to . equal ( 1 ) ;
106+ await listingTable . expectItemsCount ( 'dashboard' , 1 ) ;
126107 } ) ;
127108
128109 it ( 'does not match mid word' , async function ( ) {
129110 await listingTable . searchForItemWithName ( 'ords' ) ;
130- const countOfDashboards = await listingTable . getItemsCount ( 'dashboard' ) ;
131- expect ( countOfDashboards ) . to . equal ( 0 ) ;
111+ await listingTable . expectItemsCount ( 'dashboard' , 0 ) ;
132112 } ) ;
133113
134114 it ( 'is case insensitive' , async function ( ) {
135115 await listingTable . searchForItemWithName ( 'two words' ) ;
136- const countOfDashboards = await listingTable . getItemsCount ( 'dashboard' ) ;
137- expect ( countOfDashboards ) . to . equal ( 1 ) ;
116+ await listingTable . expectItemsCount ( 'dashboard' , 1 ) ;
138117 } ) ;
139118
140119 it ( 'is using AND operator' , async function ( ) {
141120 await listingTable . searchForItemWithName ( 'three words' ) ;
142- const countOfDashboards = await listingTable . getItemsCount ( 'dashboard' ) ;
143- expect ( countOfDashboards ) . to . equal ( 0 ) ;
121+ await listingTable . expectItemsCount ( 'dashboard' , 0 ) ;
144122 } ) ;
145123 } ) ;
146124
0 commit comments