-
Notifications
You must be signed in to change notification settings - Fork 528
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- wrap tests in "flavor" factory - remove ci setup (doesn't work with old URL anymore) BREAKING CHANGE: this requires the url to be /examples/js/e-commerce instead of /examples/e-commerce. This means that until the package is in the monorepo, its tests wouldn't pass. After the main monorepo PR is merged, this repo will move inside and will no longer be published.
- Loading branch information
Showing
16 changed files
with
403 additions
and
462 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
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 |
---|---|---|
@@ -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); | ||
}); | ||
}); |
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module.exports = { | ||
flavors: ['js'], | ||
}; |
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,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) { | ||
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', () => { | ||
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', | ||
]); | ||
}); | ||
}); | ||
}); | ||
} |
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,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) { | ||
const root = `examples/${flavor}/e-commerce/`; | ||
|
||
it('selects "Appliances" category in list', async () => { | ||
await browser.clickHierarchicalMenuItem('Appliances'); | ||
}); | ||
describe('Search on specific category', () => { | ||
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', | ||
]); | ||
}); | ||
}); | ||
}); | ||
} |
Oops, something went wrong.