Skip to content

Commit

Permalink
Merge pull request #280 from shopware/next-40281/search-product-in-st…
Browse files Browse the repository at this point in the history
…orefront

fix: NEXT-40281 - added some new locators and search suggest is extended from Home
  • Loading branch information
ocavli authored Jan 21, 2025
2 parents 8863caf + b0f5312 commit d3e7cd0
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions src/page-objects/storefront/SearchSuggest.ts
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}`;
}
}

0 comments on commit d3e7cd0

Please sign in to comment.