# Instructions - Following Playwright test failed. - Explain why, be concise, respect Playwright best practices. - Provide a snippet of code with the fix, if possible. # Test info - Name: src/apps/portal/tests/e2e/booking/booking-create.spec.ts >> should create a booking with the bigger neighboring unit out of the available smaller and bigger one - Location: src/apps/portal/tests/e2e/booking/booking-create.spec.ts:30:7 # Error details ``` Error: locator.click: Target crashed Call log: - waiting for getByTestId('insurance-section').getByTestId('insurance-list').locator('[data-test-id=load-more-button]:not(:disabled)') ``` # Test source ```ts 1 | import { BaseComponent } from '@/shared/modules/base/components/BaseComponent'; 2 | import { Locator } from '@playwright/test'; 3 | 4 | export class BookingInsuranceList extends BaseComponent { 5 | private readonly loadMoreButton = this.host.locator('[data-test-id=load-more-button]:not(:disabled)'); 6 | 7 | async select(insurance: string): Promise { 8 | const card = this.getInsuranceCard(insurance); 9 | let cardClicked = false; 10 | 11 | do { 12 | try { 13 | await card.click({ timeout: 2500 }); 14 | cardClicked = true; 15 | } catch (e) { > 16 | await this.loadMoreButton.click(); | ^ Error: locator.click: Target crashed 17 | } 18 | } while (!cardClicked); 19 | } 20 | 21 | private getInsuranceCard(item: string): Locator { 22 | return this.host.locator( 23 | `[data-test-id=insurance-card]:has([data-test-id=insurance-card-title]:text-is("${item}"))` 24 | ); 25 | } 26 | } 27 | ```