-
Notifications
You must be signed in to change notification settings - Fork 3
feat(tests): migrate for monorepo #38
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { brandAndQuery } from './specs/brand-and-query.spec'; | ||
import { category } from './specs/category.spec'; | ||
import { initialStateFromRoute } from './specs/initial-state-from-route.spec'; | ||
import { pagination } from './specs/pagination.spec'; | ||
import { priceRange } from './specs/price-range.spec'; | ||
import { flavors } from './flavors'; | ||
|
||
flavors.forEach(flavor => { | ||
describe(flavor, () => { | ||
brandAndQuery(flavor); | ||
category(flavor); | ||
initialStateFromRoute(flavor); | ||
pagination(flavor); | ||
priceRange(flavor); | ||
}); | ||
}); | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module.exports = { | ||
flavors: ['js'], | ||
}; |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -1,40 +1,44 @@ | ||||||
describe('InstantSearch - Search on specific brand and query filtering', () => { | ||||||
it('navigates to the e-commerce demo', async () => { | ||||||
await browser.url('examples/e-commerce/'); | ||||||
}); | ||||||
export function brandAndQuery(flavor: string) { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Type should be There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I had that first but the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah 😞 Can't we use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. with newer versions we can do it in typescript I think, I'll look if possible to upgrade once migrated in monorepo |
||||||
const root = `examples/${flavor}/e-commerce/`; | ||||||
|
||||||
it('selects "Apple" brand in list', async () => { | ||||||
await browser.clickRefinementListItem('Apple'); | ||||||
}); | ||||||
describe('Search on specific brand and query filtering', () => { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
it('navigates to the e-commerce demo', async () => { | ||||||
await browser.url(root); | ||||||
}); | ||||||
|
||||||
it('fills search input with "macbook"', async () => { | ||||||
await browser.setSearchBoxValue('macbook'); | ||||||
}); | ||||||
it('selects "Apple" brand in list', async () => { | ||||||
await browser.clickRefinementListItem('Apple'); | ||||||
}); | ||||||
|
||||||
it('waits for the results list to be updated (wait for the "macbook" word to be highlighted)', async () => { | ||||||
await browser.waitForElement('mark=MacBook'); | ||||||
}); | ||||||
it('fills search input with "macbook"', async () => { | ||||||
await browser.setSearchBoxValue('macbook'); | ||||||
}); | ||||||
|
||||||
it('waits for the results list to be updated (wait for the "macbook" word to be highlighted)', async () => { | ||||||
await browser.waitForElement('mark=MacBook'); | ||||||
}); | ||||||
|
||||||
it('must have the expected results', async () => { | ||||||
const hitsTitles = await browser.getHitsTitles(); | ||||||
it('must have the expected results', async () => { | ||||||
const hitsTitles = await browser.getHitsTitles(); | ||||||
|
||||||
expect(hitsTitles).toEqual([ | ||||||
'Apple - MacBook Air® (Latest Model) - 13.3" Display - Intel Core i5 - 8GB Memory - 128GB Flash Storage - Silver', | ||||||
'Apple - MacBook Air® (Latest Model) - 13.3" Display - Intel Core i5 - 8GB Memory - 256GB Flash Storage - Silver', | ||||||
'Apple - Macbook® (Latest Model) - 12" Display - Intel Core M3 - 8GB Memory - 256GB Flash Storage - Space Gray', | ||||||
'Apple - Macbook® (Latest Model) - 12" Display - Intel Core M3 - 8GB Memory - 256GB Flash Storage - Gold', | ||||||
'Apple - Macbook® (Latest Model) - 12" Display - Intel Core M3 - 8GB Memory - 256GB Flash Storage - Rose Gold', | ||||||
'Apple - Macbook® (Latest Model) - 12" Display - Intel Core M3 - 8GB Memory - 256GB Flash Storage - Silver', | ||||||
'Apple - Macbook® (Latest Model) - 12" Display - Intel Core M5 - 8GB Memory - 512GB Flash Storage - Space Gray', | ||||||
'Apple - Macbook® (Latest Model) - 12" Display - Intel Core M5 - 8GB Memory - 512GB Flash Storage - Rose Gold', | ||||||
'Apple - Macbook® (Latest Model) - 12" Display - Intel Core M5 - 8GB Memory - 512GB Flash Storage - Gold', | ||||||
'Apple - Macbook® (Latest Model) - 12" Display - Intel Core M5 - 8GB Memory - 512GB Flash Storage - Silver', | ||||||
'Apple - MacBook Pro with Retina display - 13.3" Display - 8GB Memory - 128GB Flash Storage - Silver', | ||||||
'Apple - MacBook Pro® - 13" Display - Intel Core i5 - 8 GB Memory - 256GB Flash Storage (latest model) - Space Gray', | ||||||
'Apple - MacBook® Pro - 15.4" Display - Intel Core i7 - 16GB Memory - 256GB Flash Storage - Silver', | ||||||
'Apple - MacBook Pro® - 13" Display - Intel Core i5 - 8 GB Memory - 256GB Flash Storage (latest model) - Silver', | ||||||
'Apple - MacBook® Pro - Intel Core i5 - 13.3" Display - 4GB Memory - 500GB Hard Drive - Silver', | ||||||
'Apple - MacBook Pro 13.3" Refurbished Laptop - Intel Core i5 - 4GB Memory - 320GB - Silver', | ||||||
]); | ||||||
expect(hitsTitles).toEqual([ | ||||||
'Apple - MacBook Air® (Latest Model) - 13.3" Display - Intel Core i5 - 8GB Memory - 128GB Flash Storage - Silver', | ||||||
'Apple - MacBook Air® (Latest Model) - 13.3" Display - Intel Core i5 - 8GB Memory - 256GB Flash Storage - Silver', | ||||||
'Apple - Macbook® (Latest Model) - 12" Display - Intel Core M3 - 8GB Memory - 256GB Flash Storage - Space Gray', | ||||||
'Apple - Macbook® (Latest Model) - 12" Display - Intel Core M3 - 8GB Memory - 256GB Flash Storage - Gold', | ||||||
'Apple - Macbook® (Latest Model) - 12" Display - Intel Core M3 - 8GB Memory - 256GB Flash Storage - Rose Gold', | ||||||
'Apple - Macbook® (Latest Model) - 12" Display - Intel Core M3 - 8GB Memory - 256GB Flash Storage - Silver', | ||||||
'Apple - Macbook® (Latest Model) - 12" Display - Intel Core M5 - 8GB Memory - 512GB Flash Storage - Space Gray', | ||||||
'Apple - Macbook® (Latest Model) - 12" Display - Intel Core M5 - 8GB Memory - 512GB Flash Storage - Rose Gold', | ||||||
'Apple - Macbook® (Latest Model) - 12" Display - Intel Core M5 - 8GB Memory - 512GB Flash Storage - Gold', | ||||||
'Apple - Macbook® (Latest Model) - 12" Display - Intel Core M5 - 8GB Memory - 512GB Flash Storage - Silver', | ||||||
'Apple - MacBook Pro with Retina display - 13.3" Display - 8GB Memory - 128GB Flash Storage - Silver', | ||||||
'Apple - MacBook Pro® - 13" Display - Intel Core i5 - 8 GB Memory - 256GB Flash Storage (latest model) - Space Gray', | ||||||
'Apple - MacBook® Pro - 15.4" Display - Intel Core i7 - 16GB Memory - 256GB Flash Storage - Silver', | ||||||
'Apple - MacBook Pro® - 13" Display - Intel Core i5 - 8 GB Memory - 256GB Flash Storage (latest model) - Silver', | ||||||
'Apple - MacBook® Pro - Intel Core i5 - 13.3" Display - 4GB Memory - 500GB Hard Drive - Silver', | ||||||
'Apple - MacBook Pro 13.3" Refurbished Laptop - Intel Core i5 - 4GB Memory - 320GB - Silver', | ||||||
]); | ||||||
}); | ||||||
}); | ||||||
}); | ||||||
} |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -1,63 +1,67 @@ | ||||||
describe('InstantSearch - Search on specific category', () => { | ||||||
it('navigates to the e-commerce demo', async () => { | ||||||
await browser.url('examples/e-commerce/'); | ||||||
}); | ||||||
export function category(flavor: string) { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
const root = `examples/${flavor}/e-commerce/`; | ||||||
|
||||||
it('selects "Appliances" category in list', async () => { | ||||||
await browser.clickHierarchicalMenuItem('Appliances'); | ||||||
}); | ||||||
describe('Search on specific category', () => { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
it('navigates to the e-commerce demo', async () => { | ||||||
await browser.url(root); | ||||||
}); | ||||||
|
||||||
it('selects "Small Kitchen Appliances" category in list', async () => { | ||||||
await browser.clickHierarchicalMenuItem('Small Kitchen Appliances'); | ||||||
}); | ||||||
it('selects "Appliances" category in list', async () => { | ||||||
await browser.clickHierarchicalMenuItem('Appliances'); | ||||||
}); | ||||||
|
||||||
it('must have the expected results for "Small Kitchen Appliances"', async () => { | ||||||
const hitsTitles = await browser.getHitsTitles(); | ||||||
|
||||||
expect(hitsTitles).toEqual([ | ||||||
'Insignia™ - 2.6 Cu. Ft. Compact Refrigerator - Black', | ||||||
'Keurig - K50 Coffeemaker - Black', | ||||||
'Keurig - K200 Brewer - Black', | ||||||
'Frigidaire - 3.3 Cu. Ft. Compact Refrigerator - Stainless Steel', | ||||||
'Ninja - Mega Kitchen System 72-Oz. Blender - Black', | ||||||
'Ninja - Nutri Ninja Pro 24-Oz. Blender - Black/Silver', | ||||||
'Oster - Inspire 2-Slice Wide-Slot Toaster - Black', | ||||||
'Keurig - The Original Donut Shop K-Cup® Pods (18-Pack)', | ||||||
'Chefman - Express Air Fryer - Black', | ||||||
'Oster - 10-Speed Blender - Black', | ||||||
'Keurig - Swiss Miss Milk Chocolate Hot Cocoa K-Cup® Pods (16-Pack)', | ||||||
'Keurig - Cinnabon Classic Cinnamon Roll K-Cup® Pods (18-Pack) - Multi', | ||||||
'Ninja - Nutri Ninja 32 Oz. Auto-iQ Blender - Black', | ||||||
'Anova - Precision Cooker WiFi', | ||||||
'Nespresso - VertuoLine Evoluo Espresso Maker/Coffeemaker - Gray', | ||||||
'Magic Bullet - Blender - Silver/Black', | ||||||
]); | ||||||
}); | ||||||
it('selects "Small Kitchen Appliances" category in list', async () => { | ||||||
await browser.clickHierarchicalMenuItem('Small Kitchen Appliances'); | ||||||
}); | ||||||
|
||||||
it('unselects "Small Kitchen Appliances" category in list', async () => { | ||||||
await browser.clickHierarchicalMenuItem('Small Kitchen Appliances'); | ||||||
}); | ||||||
it('must have the expected results for "Small Kitchen Appliances"', async () => { | ||||||
const hitsTitles = await browser.getHitsTitles(); | ||||||
|
||||||
expect(hitsTitles).toEqual([ | ||||||
'Insignia™ - 2.6 Cu. Ft. Compact Refrigerator - Black', | ||||||
'Keurig - K50 Coffeemaker - Black', | ||||||
'Keurig - K200 Brewer - Black', | ||||||
'Frigidaire - 3.3 Cu. Ft. Compact Refrigerator - Stainless Steel', | ||||||
'Ninja - Mega Kitchen System 72-Oz. Blender - Black', | ||||||
'Ninja - Nutri Ninja Pro 24-Oz. Blender - Black/Silver', | ||||||
'Oster - Inspire 2-Slice Wide-Slot Toaster - Black', | ||||||
'Keurig - The Original Donut Shop K-Cup® Pods (18-Pack)', | ||||||
'Chefman - Express Air Fryer - Black', | ||||||
'Oster - 10-Speed Blender - Black', | ||||||
'Keurig - Swiss Miss Milk Chocolate Hot Cocoa K-Cup® Pods (16-Pack)', | ||||||
'Keurig - Cinnabon Classic Cinnamon Roll K-Cup® Pods (18-Pack) - Multi', | ||||||
'Ninja - Nutri Ninja 32 Oz. Auto-iQ Blender - Black', | ||||||
'Anova - Precision Cooker WiFi', | ||||||
'Nespresso - VertuoLine Evoluo Espresso Maker/Coffeemaker - Gray', | ||||||
'Magic Bullet - Blender - Silver/Black', | ||||||
]); | ||||||
}); | ||||||
|
||||||
it('unselects "Small Kitchen Appliances" category in list', async () => { | ||||||
await browser.clickHierarchicalMenuItem('Small Kitchen Appliances'); | ||||||
}); | ||||||
|
||||||
it('must have the expected results for "Appliances"', async () => { | ||||||
const hitsTitles = await browser.getHitsTitles(); | ||||||
|
||||||
it('must have the expected results for "Appliances"', async () => { | ||||||
const hitsTitles = await browser.getHitsTitles(); | ||||||
|
||||||
expect(hitsTitles).toEqual([ | ||||||
'Nest - Learning Thermostat - 3rd Generation - Stainless Steel', | ||||||
'LG - 1.1 Cu. Ft. Mid-Size Microwave - Stainless-Steel', | ||||||
'Insignia™ - 2.6 Cu. Ft. Compact Refrigerator - Black', | ||||||
'Keurig - K50 Coffeemaker - Black', | ||||||
'iRobot - Roomba 650 Vacuuming Robot - Black', | ||||||
'Shark - Navigator Lift-Away Deluxe Bagless Upright Vacuum - Blue', | ||||||
'LG - 1.5 Cu. Ft. Mid-Size Microwave - Stainless Steel', | ||||||
'Insignia™ - 5.0 Cu. Ft. Chest Freezer - White', | ||||||
'Samsung - activewash 4.8 Cu. Ft. 11-Cycle High-Efficiency Top-Loading Washer - White', | ||||||
'Samsung - 4.8 Cu. Ft. 11-Cycle High-Efficiency Top-Loading Washer - White', | ||||||
'LG - 2.0 Cu. Ft. Full-Size Microwave - Stainless Steel', | ||||||
'Shark - Rotator Professional Lift-Away HEPA Bagless 2-in-1 Upright Vacuum - Red', | ||||||
'LG - 4.5 Cu. Ft. 8-Cycle High-Efficiency Top-Loading Washer - White', | ||||||
'Samsung - 4.2 Cu. Ft. 9-Cycle High-Efficiency Steam Front-Loading Washer - Platinum', | ||||||
'Panasonic - 1.3 Cu. Ft. Mid-Size Microwave - Stainless steel/black/silver', | ||||||
'LG - 2.0 Cu. Ft. Mid-Size Microwave - Black Stainless', | ||||||
]); | ||||||
expect(hitsTitles).toEqual([ | ||||||
'Nest - Learning Thermostat - 3rd Generation - Stainless Steel', | ||||||
'LG - 1.1 Cu. Ft. Mid-Size Microwave - Stainless-Steel', | ||||||
'Insignia™ - 2.6 Cu. Ft. Compact Refrigerator - Black', | ||||||
'Keurig - K50 Coffeemaker - Black', | ||||||
'iRobot - Roomba 650 Vacuuming Robot - Black', | ||||||
'Shark - Navigator Lift-Away Deluxe Bagless Upright Vacuum - Blue', | ||||||
'LG - 1.5 Cu. Ft. Mid-Size Microwave - Stainless Steel', | ||||||
'Insignia™ - 5.0 Cu. Ft. Chest Freezer - White', | ||||||
'Samsung - activewash 4.8 Cu. Ft. 11-Cycle High-Efficiency Top-Loading Washer - White', | ||||||
'Samsung - 4.8 Cu. Ft. 11-Cycle High-Efficiency Top-Loading Washer - White', | ||||||
'LG - 2.0 Cu. Ft. Full-Size Microwave - Stainless Steel', | ||||||
'Shark - Rotator Professional Lift-Away HEPA Bagless 2-in-1 Upright Vacuum - Red', | ||||||
'LG - 4.5 Cu. Ft. 8-Cycle High-Efficiency Top-Loading Washer - White', | ||||||
'Samsung - 4.2 Cu. Ft. 9-Cycle High-Efficiency Steam Front-Loading Washer - Platinum', | ||||||
'Panasonic - 1.3 Cu. Ft. Mid-Size Microwave - Stainless steel/black/silver', | ||||||
'LG - 2.0 Cu. Ft. Mid-Size Microwave - Black Stainless', | ||||||
]); | ||||||
}); | ||||||
}); | ||||||
}); | ||||||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.