@@ -39,25 +39,27 @@ export function createInitialStateFromRouteTestSuite(flavor: string) {
3939 expect ( brand ) . toEqual ( 'KitchenAid' ) ;
4040 } ) ;
4141
42- it ( 'must have lower price set to $50 and the upper price set to $350 in the price range' , async ( ) => {
43- const lowerPrice = await browser . getRangeSliderLowerBoundValue ( ) ;
44- const upperPrice = await browser . getRangeSliderUpperBoundValue ( ) ;
42+ if ( flavor !== 'vue' ) {
43+ it ( 'must have lower price set to $50 and the upper price set to $350 in the price range' , async ( ) => {
44+ const lowerPrice = await browser . getRangeSliderLowerBoundValue ( ) ;
45+ const upperPrice = await browser . getRangeSliderUpperBoundValue ( ) ;
4546
46- expect ( lowerPrice ) . toEqual ( 50 ) ;
47- expect ( upperPrice ) . toEqual ( 350 ) ;
48- } ) ;
47+ expect ( lowerPrice ) . toEqual ( 50 ) ;
48+ expect ( upperPrice ) . toEqual ( 350 ) ;
49+ } ) ;
4950
50- it ( 'must have free shipping box checked' , async ( ) => {
51- const freeShipping = await browser . getToggleRefinementStatus ( ) ;
51+ it ( 'must have free shipping box checked' , async ( ) => {
52+ const freeShipping = await browser . getToggleRefinementStatus ( ) ;
5253
53- expect ( freeShipping ) . toEqual ( true ) ;
54- } ) ;
54+ expect ( freeShipping ) . toEqual ( true ) ;
55+ } ) ;
5556
56- it ( 'must have rating "4 & up" selected in the rating menu' , async ( ) => {
57- const rating = await browser . getSelectedRatingMenuItem ( ) ;
57+ it ( 'must have rating "4 & up" selected in the rating menu' , async ( ) => {
58+ const rating = await browser . getSelectedRatingMenuItem ( ) ;
5859
59- expect ( rating ) . toEqual ( '4 & up' ) ;
60- } ) ;
60+ expect ( rating ) . toEqual ( '4 & up' ) ;
61+ } ) ;
62+ }
6163
6264 it ( 'must have "Price descending" selected in the sort select' , async ( ) => {
6365 const sortBy = await browser . getSortByValue ( ) ;
@@ -127,13 +129,15 @@ export function createInitialStateFromRouteTestSuite(flavor: string) {
127129 await browser . setSortByValue ( 'Price ascending' ) ;
128130 } ) ;
129131
130- it ( 'sets lower price to $250 and the upper price to $1250 in the price range' , async ( ) => {
131- // Depending of the steps calculation there can be a difference between
132- // the wanted value and the actual value of the slider, so we store
133- // the actual value to use it in for subsequent tests
134- priceBounds . lower = await browser . dragRangeSliderLowerBoundTo ( 250 ) ;
135- priceBounds . upper = await browser . dragRangeSliderUpperBoundTo ( 1250 ) ;
136- } ) ;
132+ if ( flavor !== 'vue' ) {
133+ it ( 'sets lower price to $250 and the upper price to $1250 in the price range' , async ( ) => {
134+ // Depending of the steps calculation there can be a difference between
135+ // the wanted value and the actual value of the slider, so we store
136+ // the actual value to use it in for subsequent tests
137+ priceBounds . lower = await browser . dragRangeSliderLowerBoundTo ( 250 ) ;
138+ priceBounds . upper = await browser . dragRangeSliderUpperBoundTo ( 1250 ) ;
139+ } ) ;
140+ }
137141
138142 it ( 'selects "64 hits per page" in the hits per page select' , async ( ) => {
139143 await browser . setHitsPerPage ( '64 hits per page' ) ;
@@ -149,15 +153,19 @@ export function createInitialStateFromRouteTestSuite(flavor: string) {
149153 const url = await browser . getUrl ( ) ;
150154 const { pathname, searchParams } = new URL ( url ) ;
151155
156+ const range =
157+ flavor === 'vue' ||
158+ searchParams . get ( 'price' ) ===
159+ `${ priceBounds . lower } :${ priceBounds . upper } ` ;
160+
152161 return (
153162 pathname ===
154163 `/${ root } search/Appliances%2FRanges%2C+Cooktops+%26+Ovens/` &&
155164 searchParams . get ( 'query' ) === 'cooktop' &&
156165 searchParams . get ( 'page' ) === '2' &&
157166 searchParams . get ( 'brands' ) === 'Whirlpool' &&
158167 searchParams . get ( 'rating' ) === '3' &&
159- searchParams . get ( 'price' ) ===
160- `${ priceBounds . lower } :${ priceBounds . upper } ` &&
168+ range &&
161169 searchParams . get ( 'sortBy' ) === 'instant_search_price_asc' &&
162170 searchParams . get ( 'hitsPerPage' ) === '64'
163171 ) ;
0 commit comments