-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #280 from shopware/next-40281/search-product-in-st…
…orefront fix: NEXT-40281 - added some new locators and search suggest is extended from Home
- Loading branch information
Showing
1 changed file
with
18 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,31 @@ | ||
import type { Page, Locator } from '@playwright/test'; | ||
import type { PageObject } from '../../types/PageObject'; | ||
import { Home } from './Home'; | ||
|
||
export class SearchSuggest implements PageObject { | ||
export class SearchSuggest extends Home implements PageObject { | ||
|
||
public readonly searchSuggestLineItemImages: Locator; | ||
public readonly searchInput: Locator; | ||
public readonly searchIcon: Locator; | ||
public readonly searchSuggestNoResult: Locator; | ||
public readonly searchSuggestLineItemName: Locator; | ||
public readonly searchSuggestLineItemPrice: Locator; | ||
public readonly searchSuggestTotalLink: Locator; | ||
public readonly searchHeadline: Locator; | ||
|
||
constructor(public readonly page: Page) { | ||
super(page); | ||
this.searchSuggestLineItemImages = page.locator('.search-suggest-product-image-container'); | ||
this.searchInput = page.locator('.header-search-input'); | ||
this.searchIcon = page.locator('.header-search-icon'); | ||
this.searchSuggestNoResult = page.locator ('.search-suggest-no-result'); | ||
this.searchSuggestLineItemName = page.locator ('.search-suggest-product-name'); | ||
this.searchSuggestLineItemPrice = page.locator ('.col-auto.search-suggest-product-price'); | ||
this.searchSuggestTotalLink = page.locator ('.search-suggest-total-link'); | ||
this.searchHeadline = page.locator ('.search-headline'); | ||
} | ||
|
||
url(searchTerm: string) { | ||
url(searchTerm?: string) { | ||
return `suggest?search=${searchTerm}`; | ||
} | ||
} |