# 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 not create a booking with an expired card - Location: src/apps/portal/tests/e2e/booking/booking-create.spec.ts:24:7 # Error details ``` Error: expect(locator).toBeVisible() failed Locator: getByTestId('stripe-error') Expected: visible Timeout: 20000ms Error: element(s) not found Call log: - Expect "toBeVisible" with timeout 20000ms - waiting for getByTestId('stripe-error') ``` # Page snapshot ```yaml - generic [active] [ref=e1]: - generic [ref=e3]: - generic [ref=e7]: - banner [ref=e8]: - generic [ref=e10]: - img "Logo of Storeroom Innsbruck" [ref=e13] - complementary [ref=e14]: - button "English" [ref=e16] [cursor=pointer]: - text: English - img [ref=e17] - button "Help" [ref=e20] [cursor=pointer]: - figure [ref=e21]: - img [ref=e23] - main [ref=e27]: - generic [ref=e28]: - generic [ref=e29]: Storeroom Innsbruck - img [ref=e30] [cursor=pointer] - generic [ref=e32]: - button "Back" [ref=e34] [cursor=pointer]: - figure [ref=e35]: - img [ref=e37] - heading "Payment" [level=1] [ref=e40] - generic [ref=e43]: - main [ref=e48]: - iframe [ref=e57]: - generic [ref=f3e7]: - tablist "Payment Methods" [ref=f3e8]: - tab "Card" [selected] [ref=f3e9]: - generic [ref=f3e12]: Card - tab "SEPA Debit" [ref=f3e13] [cursor=pointer]: - generic [ref=f3e19]: SEPA Debit - tabpanel "Card" [ref=f3e20]: - generic [ref=f3e23]: - generic [ref=f3e24]: - button "Secure, fast checkout with Link" [ref=f3e30] [cursor=pointer]: - img [ref=f3e31] - generic [ref=f3e33]: Secure, fast checkout with Link - generic [ref=f3e35]: While entering card information, you’ll be automatically advanced to the next form field when the current field is complete. - generic [ref=f3e36]: - generic [ref=f3e37]: - generic [ref=f3e39]: - generic [ref=f3e40]: Card number - generic [ref=f3e42]: - textbox "Card number" [ref=f3e44]: - /placeholder: 1234 1234 1234 1234 - text: 4000 0000 0000 0069 - generic: - option "Select card brand (optional)" [disabled] [selected] - option "Visa" - generic: - generic: - generic: - paragraph: Supported cards include Mastercard, Visa, American Express, and Discover. - generic: - img - img - generic: - img - generic: Current card brand is Visa. - generic [ref=f3e46]: - generic [ref=f3e47]: - text: Expiration (MM/YY) - generic [ref=f3e48]: MM / YY - textbox "Expiration (MM/YY) MM / YY" [ref=f3e52]: - /placeholder: MM / YY - text: 10 / 50 - alert [ref=f3e55]: Your card has expired. - generic [ref=f3e57]: - generic [ref=f3e58]: Security code - generic [ref=f3e60]: - textbox "Security code" [ref=f3e62]: - /placeholder: CVC - text: "123" - generic: - generic: 3-digit code on back of card - generic: - img - generic [ref=f3e65]: - generic [ref=f3e67]: - generic [ref=f3e68]: Country/Territory - combobox "Country/Territory" [ref=f3e71] [cursor=pointer]: - option "Select" [disabled] - option "Afghanistan" - option "Åland Islands" - option "Albania" - option "Algeria" - option "Andorra" - option "Angola" - option "Anguilla" - option "Antarctica" - option "Antigua & Barbuda" - option "Argentina" - option "Armenia" - option "Aruba" - option "Ascension Island" - option "Australia" - option "Austria" - option "Azerbaijan" - option "Bahamas" - option "Bahrain" - option "Bangladesh" - option "Barbados" - option "Belarus" - option "Belgium" - option "Belize" - option "Benin" - option "Bermuda" - option "Bhutan" - option "Bolivia" - option "Bosnia & Herzegovina" - option "Botswana" - option "Bouvet Island" - option "Brazil" - option "British Indian Ocean Territory" - option "British Virgin Islands" - option "Brunei" - option "Bulgaria" - option "Burkina Faso" - option "Burundi" - option "Cambodia" - option "Cameroon" - option "Canada" - option "Cape Verde" - option "Caribbean Netherlands" - option "Cayman Islands" - option "Central African Republic" - option "Chad" - option "Chile" - option "China" - option "Colombia" - option "Comoros" - option "Congo - Brazzaville" - option "Congo - Kinshasa" - option "Cook Islands" - option "Costa Rica" - option "Côte d’Ivoire" - option "Croatia" - option "Curaçao" - option "Cyprus" - option "Czechia" - option "Denmark" - option "Djibouti" - option "Dominica" - option "Dominican Republic" - option "Ecuador" - option "Egypt" - option "El Salvador" - option "Equatorial Guinea" - option "Eritrea" - option "Estonia" - option "Eswatini" - option "Ethiopia" - option "Falkland Islands" - option "Faroe Islands" - option "Fiji" - option "Finland" - option "France" - option "French Guiana" - option "French Polynesia" - option "French Southern Territories" - option "Gabon" - option "Gambia" - option "Georgia" - option "Germany" - option "Ghana" - option "Gibraltar" - option "Greece" - option "Greenland" - option "Grenada" - option "Guadeloupe" - option "Guam" - option "Guatemala" - option "Guernsey" - option "Guinea" - option "Guinea-Bissau" - option "Guyana" - option "Haiti" - option "Honduras" - option "Hong Kong SAR China" - option "Hungary" - option "Iceland" - option "India" - option "Indonesia" - option "Iraq" - option "Ireland" - option "Isle of Man" - option "Israel" - option "Italy" - option "Jamaica" - option "Japan" - option "Jersey" - option "Jordan" - option "Kazakhstan" - option "Kenya" - option "Kiribati" - option "Kosovo" - option "Kuwait" - option "Kyrgyzstan" - option "Laos" - option "Latvia" - option "Lebanon" - option "Lesotho" - option "Liberia" - option "Libya" - option "Liechtenstein" - option "Lithuania" - option "Luxembourg" - option "Macao SAR China" - option "Madagascar" - option "Malawi" - option "Malaysia" - option "Maldives" - option "Mali" - option "Malta" - option "Martinique" - option "Mauritania" - option "Mauritius" - option "Mayotte" - option "Mexico" - option "Moldova" - option "Monaco" - option "Mongolia" - option "Montenegro" - option "Montserrat" - option "Morocco" - option "Mozambique" - option "Myanmar (Burma)" - option "Namibia" - option "Nauru" - option "Nepal" - option "Netherlands" - option "New Caledonia" - option "New Zealand" - option "Nicaragua" - option "Niger" - option "Nigeria" - option "Niue" - option "North Macedonia" - option "Norway" - option "Oman" - option "Pakistan" - option "Palestinian Territories" - option "Panama" - option "Papua New Guinea" - option "Paraguay" - option "Peru" - option "Philippines" - option "Pitcairn Islands" - option "Poland" - option "Portugal" - option "Puerto Rico" - option "Qatar" - option "Réunion" - option "Romania" - option "Russia" - option "Rwanda" - option "Samoa" - option "San Marino" - option "São Tomé & Príncipe" - option "Saudi Arabia" - option "Senegal" - option "Serbia" - option "Seychelles" - option "Sierra Leone" - option "Singapore" - option "Sint Maarten" - option "Slovakia" - option "Slovenia" - option "Solomon Islands" - option "Somalia" - option "South Africa" - option "South Georgia & South Sandwich Islands" - option "South Korea" - option "South Sudan" - option "Spain" - option "Sri Lanka" - option "St. Barthélemy" - option "St. Helena" - option "St. Kitts & Nevis" - option "St. Lucia" - option "St. Martin" - option "St. Pierre & Miquelon" - option "St. Vincent & Grenadines" - option "Sudan" - option "Suriname" - option "Svalbard & Jan Mayen" - option "Sweden" - option "Switzerland" - option "Taiwan" - option "Tajikistan" - option "Tanzania" - option "Thailand" - option "Timor-Leste" - option "Togo" - option "Tokelau" - option "Tonga" - option "Trinidad & Tobago" - option "Tristan da Cunha" - option "Tunisia" - option "Türkiye" - option "Turkmenistan" - option "Turks & Caicos Islands" - option "Tuvalu" - option "Uganda" - option "Ukraine" - option "United Arab Emirates" - option "United Kingdom" [selected] - option "United States" - option "Uruguay" - option "Uzbekistan" - option "Vanuatu" - option "Vatican City" - option "Venezuela" - option "Vietnam" - option "Wallis & Futuna" - option "Western Sahara" - option "Yemen" - option "Zambia" - option "Zimbabwe" - generic [ref=f3e73]: - generic [ref=f3e74]: Postal code - textbox "Postal code" [ref=f3e77]: - /placeholder: WS11 1DB - text: BR11AA - paragraph [ref=f3e80]: By providing your card information, you allow E2E Testing Innsbruck to charge your card for future payments in accordance with their terms. - generic [ref=f3e85]: - generic [ref=f3e86]: - generic: - paragraph: Optional - generic [ref=f3e87]: Save my information for faster checkout - generic [ref=f3e90]: - generic [ref=f3e93]: - generic [ref=f3e95]: - generic [ref=f3e96]: Email - textbox "Email" [ref=f3e101]: - /placeholder: you@example.com - generic [ref=f3e103]: - generic [ref=f3e104]: Mobile number - generic [ref=f3e107]: - generic [ref=f3e109]: - img "AT" [ref=f3e113] - combobox "Country or region for phone number" [ref=f3e115] [cursor=pointer]: - option "Afghanistan (+93)" - option "Åland Islands (+358)" - option "Albania (+355)" - option "Algeria (+213)" - option "Andorra (+376)" - option "Angola (+244)" - option "Anguilla (+1)" - option "Antigua & Barbuda (+1)" - option "Argentina (+54)" - option "Armenia (+374)" - option "Aruba (+297)" - option "Ascension Island (+247)" - option "Australia (+61)" - option "Austria (+43)" [selected] - option "Azerbaijan (+994)" - option "Bahamas (+1)" - option "Bahrain (+973)" - option "Bangladesh (+880)" - option "Barbados (+1)" - option "Belarus (+375)" - option "Belgium (+32)" - option "Belize (+501)" - option "Benin (+229)" - option "Bermuda (+1)" - option "Bhutan (+975)" - option "Bolivia (+591)" - option "Bosnia & Herzegovina (+387)" - option "Botswana (+267)" - option "Brazil (+55)" - option "British Indian Ocean Territory (+246)" - option "British Virgin Islands (+1)" - option "Brunei (+673)" - option "Bulgaria (+359)" - option "Burkina Faso (+226)" - option "Burundi (+257)" - option "Cambodia (+855)" - option "Cameroon (+237)" - option "Canada (+1)" - option "Cape Verde (+238)" - option "Caribbean Netherlands (+599)" - option "Cayman Islands (+1)" - option "Central African Republic (+236)" - option "Chad (+235)" - option "Chile (+56)" - option "China (+86)" - option "Colombia (+57)" - option "Comoros (+269)" - option "Congo - Brazzaville (+242)" - option "Congo - Kinshasa (+243)" - option "Cook Islands (+682)" - option "Costa Rica (+506)" - option "Côte d’Ivoire (+225)" - option "Croatia (+385)" - option "Curaçao (+599)" - option "Cyprus (+357)" - option "Czechia (+420)" - option "Denmark (+45)" - option "Djibouti (+253)" - option "Dominica (+1)" - option "Dominican Republic (+1)" - option "Ecuador (+593)" - option "Egypt (+20)" - option "El Salvador (+503)" - option "Equatorial Guinea (+240)" - option "Eritrea (+291)" - option "Estonia (+372)" - option "Eswatini (+268)" - option "Ethiopia (+251)" - option "Falkland Islands (+500)" - option "Faroe Islands (+298)" - option "Fiji (+679)" - option "Finland (+358)" - option "France (+33)" - option "French Guiana (+594)" - option "French Polynesia (+689)" - option "Gabon (+241)" - option "Gambia (+220)" - option "Georgia (+995)" - option "Germany (+49)" - option "Ghana (+233)" - option "Gibraltar (+350)" - option "Greece (+30)" - option "Greenland (+299)" - option "Grenada (+1)" - option "Guadeloupe (+590)" - option "Guam (+1)" - option "Guatemala (+502)" - option "Guernsey (+44)" - option "Guinea (+224)" - option "Guinea-Bissau (+245)" - option "Guyana (+592)" - option "Haiti (+509)" - option "Honduras (+504)" - option "Hong Kong SAR China (+852)" - option "Hungary (+36)" - option "Iceland (+354)" - option "India (+91)" - option "Indonesia (+62)" - option "Iraq (+964)" - option "Ireland (+353)" - option "Isle of Man (+44)" - option "Israel (+972)" - option "Italy (+39)" - option "Jamaica (+1)" - option "Japan (+81)" - option "Jersey (+44)" - option "Jordan (+962)" - option "Kazakhstan (+7)" - option "Kenya (+254)" - option "Kiribati (+686)" - option "Kosovo (+383)" - option "Kuwait (+965)" - option "Kyrgyzstan (+996)" - option "Laos (+856)" - option "Latvia (+371)" - option "Lebanon (+961)" - option "Lesotho (+266)" - option "Liberia (+231)" - option "Libya (+218)" - option "Liechtenstein (+423)" - option "Lithuania (+370)" - option "Luxembourg (+352)" - option "Macao SAR China (+853)" - option "Madagascar (+261)" - option "Malawi (+265)" - option "Malaysia (+60)" - option "Maldives (+960)" - option "Mali (+223)" - option "Malta (+356)" - option "Martinique (+596)" - option "Mauritania (+222)" - option "Mauritius (+230)" - option "Mayotte (+262)" - option "Mexico (+52)" - option "Moldova (+373)" - option "Monaco (+377)" - option "Mongolia (+976)" - option "Montenegro (+382)" - option "Montserrat (+1)" - option "Morocco (+212)" - option "Mozambique (+258)" - option "Myanmar (Burma) (+95)" - option "Namibia (+264)" - option "Nauru (+674)" - option "Nepal (+977)" - option "Netherlands (+31)" - option "New Caledonia (+687)" - option "New Zealand (+64)" - option "Nicaragua (+505)" - option "Niger (+227)" - option "Nigeria (+234)" - option "Niue (+683)" - option "North Macedonia (+389)" - option "Norway (+47)" - option "Oman (+968)" - option "Pakistan (+92)" - option "Palestinian Territories (+970)" - option "Panama (+507)" - option "Papua New Guinea (+675)" - option "Paraguay (+595)" - option "Peru (+51)" - option "Philippines (+63)" - option "Poland (+48)" - option "Portugal (+351)" - option "Puerto Rico (+1)" - option "Qatar (+974)" - option "Réunion (+262)" - option "Romania (+40)" - option "Russia (+7)" - option "Rwanda (+250)" - option "Samoa (+685)" - option "San Marino (+378)" - option "São Tomé & Príncipe (+239)" - option "Saudi Arabia (+966)" - option "Senegal (+221)" - option "Serbia (+381)" - option "Seychelles (+248)" - option "Sierra Leone (+232)" - option "Singapore (+65)" - option "Sint Maarten (+1)" - option "Slovakia (+421)" - option "Slovenia (+386)" - option "Solomon Islands (+677)" - option "Somalia (+252)" - option "South Africa (+27)" - option "South Korea (+82)" - option "South Sudan (+211)" - option "Spain (+34)" - option "Sri Lanka (+94)" - option "St. Barthélemy (+590)" - option "St. Helena (+290)" - option "St. Kitts & Nevis (+1)" - option "St. Lucia (+1)" - option "St. Martin (+590)" - option "St. Pierre & Miquelon (+508)" - option "St. Vincent & Grenadines (+1)" - option "Sudan (+249)" - option "Suriname (+597)" - option "Svalbard & Jan Mayen (+47)" - option "Sweden (+46)" - option "Switzerland (+41)" - option "Taiwan (+886)" - option "Tajikistan (+992)" - option "Tanzania (+255)" - option "Thailand (+66)" - option "Timor-Leste (+670)" - option "Togo (+228)" - option "Tokelau (+690)" - option "Tonga (+676)" - option "Trinidad & Tobago (+1)" - option "Tristan da Cunha (+290)" - option "Tunisia (+216)" - option "Türkiye (+90)" - option "Turkmenistan (+993)" - option "Turks & Caicos Islands (+1)" - option "Tuvalu (+688)" - option "Uganda (+256)" - option "Ukraine (+380)" - option "United Arab Emirates (+971)" - option "United Kingdom (+44)" - option "United States (+1)" - option "Uruguay (+598)" - option "Uzbekistan (+998)" - option "Vanuatu (+678)" - option "Vatican City (+39)" - option "Venezuela (+58)" - option "Vietnam (+84)" - option "Wallis & Futuna (+681)" - option "Western Sahara (+212)" - option "Yemen (+967)" - option "Zambia (+260)" - option "Zimbabwe (+263)" - textbox "Mobile number" [ref=f3e116]: - /placeholder: 0664 123456 - generic [ref=f3e121]: - generic [ref=f3e122]: Full name - textbox "Full name" [ref=f3e126]: - /placeholder: First and last name - paragraph [ref=f3e127]: - generic [ref=f3e128]: - button "Link" [ref=f3e130] [cursor=pointer] - generic: • - generic [ref=f3e133]: - text: By providing phone number and email, you agree to create an account subject to - link "Terms" [ref=f3e134] [cursor=pointer]: - /url: https://link.com/terms - text: and - link "Privacy Policy" [ref=f3e135] [cursor=pointer]: - /url: https://link.com/privacy - text: . - generic: 01234567890123456789 - button - button "Pay now" [ref=e60] [cursor=pointer]: - generic [ref=e61]: Pay now - contentinfo [ref=e62]: - separator [ref=e63] - generic [ref=e64]: - link "Imprint" [ref=e65] [cursor=pointer]: - /url: https://www.storeroom.com/imprint - generic [ref=e66]: "|" - link "Data privacy" [ref=e67] [cursor=pointer]: - /url: https://www.storeroom.com/privacy - generic [ref=e68]: - banner [ref=e69] - generic [ref=e71]: - generic [ref=e76]: - generic [ref=e77]: - generic [ref=e78]: Total - generic [ref=e79]: first invoice - generic [ref=e80]: - generic [ref=e82]: - generic [ref=e83]: €5,569.20 - generic [ref=e84]: €5,545.20 - generic [ref=e85]: (incl. tax) - generic [ref=e88]: - generic [ref=e90]: - generic [ref=e91]: - generic [ref=e93]: Move-in date - generic [ref=e95]: Apr 8, 2026 - separator [ref=e96] - generic [ref=e99]: - generic [ref=e100]: - generic [ref=e101]: VI 7 sqm Unit - generic [ref=e102]: every 26 weeks - generic [ref=e103]: - generic [ref=e104]: €5,304.00 - generic [ref=e105]: (incl. tax) - generic [ref=e108]: - generic [ref=e109]: - generic [ref=e110]: VI - Insurance weekly - 10 - generic [ref=e111]: every 26 weeks - generic [ref=e112]: - generic [ref=e113]: €265.20 - generic [ref=e114]: (incl. tax) - generic [ref=e116]: - separator [ref=e117] - generic [ref=e118]: - generic [ref=e119]: Discount code - generic [ref=e120]: €20.00 off forever - separator [ref=e121] - generic [ref=e122]: - generic [ref=e123]: - generic [ref=e124]: Total - generic [ref=e125]: first invoice - generic [ref=e126]: - generic [ref=e128]: - generic [ref=e129]: €5,569.20 - generic [ref=e130]: €5,545.20 - generic [ref=e131]: (incl. tax) - generic [ref=e134]: - generic [ref=e135]: - generic [ref=e136]: Recurring payment - generic [ref=e137]: every 26 weeks - generic [ref=e138]: - generic [ref=e140]: - generic [ref=e141]: €5,569.20 - generic [ref=e142]: €5,545.20 - generic [ref=e143]: (incl. tax) - contentinfo ``` # Test source ```ts 105 | 106 | // open drawer 107 | isMobile && (await customerView.openDrawer()); 108 | 109 | // check basket summary 110 | await expectBasketContentToDisplayCorrectData( 111 | customerView.getBasketContent(), 112 | isMobile, 113 | data.customer.type, 114 | data.moveInDate, 115 | data.location, 116 | data.unitType, 117 | data.insurance, 118 | data.discount 119 | ); 120 | 121 | // confirm customer data 122 | const paymentView = await customerView.confirm(); 123 | 124 | // set payment info 125 | await paymentView.fill(data.paymentMethod); 126 | 127 | // confirm payment and create booking 128 | await confirmPayment(isMobile, paymentView, data); 129 | } 130 | 131 | export async function expectBookingNotToBeCreatedDueToDeclinedPayment( 132 | startView: BookingLocationView, 133 | data: IBookingCreateData, 134 | isMobile: boolean 135 | ): Promise { 136 | // select location specific booking portal 137 | const unitTypeView = await startView.select(data.location.id); 138 | 139 | // accept cookie consent banner 140 | await acceptCookieConsentBanner(unitTypeView, data.location.showCookieConsentBanner); 141 | 142 | // select unit type 143 | const optionsView = await unitTypeView.select( 144 | data.unitType.name, 145 | data.location.categories.length > 1 ? data.unitType.category : undefined 146 | ); 147 | 148 | // select move in date, booking plan and insurance 149 | await optionsView.select(data.moveInDate, data.unitType.billing, data.insurance?.name); 150 | 151 | // confirm selected options 152 | const basketView = await optionsView.confirm(); 153 | 154 | // add discount code 155 | data.discount && (await basketView.add(data.discount.code)); 156 | 157 | // check basket summary 158 | await expectBasketContentToDisplayCorrectData( 159 | basketView.basketContent, 160 | isMobile, 161 | 'private', 162 | data.moveInDate, 163 | data.location, 164 | data.unitType, 165 | data.insurance, 166 | data.discount 167 | ); 168 | 169 | // confirm basket summary 170 | const customerView = await basketView.confirm(); 171 | 172 | // set customer view viewport 173 | customerView.isMobile = isMobile; 174 | 175 | // set customer data 176 | await customerView.fill(data.customer); 177 | 178 | // open drawer 179 | isMobile && (await customerView.openDrawer()); 180 | 181 | // check basket summary 182 | await expectBasketContentToDisplayCorrectData( 183 | customerView.getBasketContent(), 184 | isMobile, 185 | data.customer.type, 186 | data.moveInDate, 187 | data.location, 188 | data.unitType, 189 | data.insurance, 190 | data.discount 191 | ); 192 | 193 | // confirm customer data 194 | const paymentView = await customerView.confirm(); 195 | 196 | // set payment info 197 | await paymentView.fill(data.paymentMethod); 198 | 199 | // try to confirm payment 200 | await paymentView.payNowButton.click(); 201 | 202 | try { 203 | await expect(paymentView.stripeFieldError).toBeVisible({ timeout: 2500 }); 204 | } catch (e) { > 205 | await expect(paymentView.stripeAlertError).toBeVisible(); | ^ Error: expect(locator).toBeVisible() failed 206 | } 207 | } 208 | 209 | export async function expectBookingToBeCreated( 210 | startView: BookingLocationView, 211 | data: IBookingCreateData, 212 | isMobile: boolean 213 | ): Promise { 214 | // select location specific booking portal 215 | const unitTypeView = await startView.select(data.location.id); 216 | 217 | // accept cookie consent banner 218 | await acceptCookieConsentBanner(unitTypeView, data.location.showCookieConsentBanner); 219 | 220 | // select unit type 221 | const optionsView = await unitTypeView.select( 222 | data.unitType.name, 223 | data.location.categories.length > 1 ? data.unitType.category : undefined 224 | ); 225 | 226 | // select move in date, booking plan and insurance 227 | await optionsView.select(data.moveInDate, data.unitType.billing, data.insurance?.name); 228 | 229 | // confirm selected options 230 | const basketView = await optionsView.confirm(); 231 | 232 | // add discount code 233 | data.discount && (await basketView.add(data.discount.code)); 234 | 235 | // check basket summary 236 | await expectBasketContentToDisplayCorrectData( 237 | basketView.basketContent, 238 | isMobile, 239 | 'private', 240 | data.moveInDate, 241 | data.location, 242 | data.unitType, 243 | data.insurance, 244 | data.discount 245 | ); 246 | 247 | // confirm basket summary 248 | const customerView = await basketView.confirm(); 249 | 250 | // set customer view viewport 251 | customerView.isMobile = isMobile; 252 | 253 | // set customer data 254 | await customerView.fill(data.customer); 255 | 256 | // open drawer 257 | isMobile && (await customerView.openDrawer()); 258 | 259 | // check basket summary 260 | await expectBasketContentToDisplayCorrectData( 261 | customerView.getBasketContent(), 262 | isMobile, 263 | data.customer.type, 264 | data.moveInDate, 265 | data.location, 266 | data.unitType, 267 | data.insurance, 268 | data.discount 269 | ); 270 | 271 | // confirm customer data 272 | const paymentView = await customerView.confirm(); 273 | 274 | // set payment info 275 | await paymentView.fill(data.paymentMethod); 276 | 277 | // confirm payment and create booking 278 | await confirmPayment(isMobile, paymentView, data); 279 | } 280 | 281 | async function acceptCookieConsentBanner(view: BookingUnitTypeView, showCookieConsentBanner: boolean): Promise { 282 | if (!showCookieConsentBanner) { 283 | return; 284 | } 285 | 286 | const cookieConsentData: ICookieConsentData = { 287 | allowMarketing: true, 288 | }; 289 | 290 | await view.acceptCookieConsent(cookieConsentData); 291 | } 292 | 293 | async function confirmPayment(isMobile: boolean, view: BookingPaymentView, data: IBookingCreateData): Promise { 294 | // currently restricting sepa payment tests for desktop (see: comments of https://kinn.atlassian.net/browse/KIN-2835) 295 | if (!isMobile && data.paymentMethod.kind === 'sepa') { 296 | return; 297 | } 298 | 299 | // confirm payment 300 | const successView = await view.confirm(); 301 | 302 | // check success view 303 | await expectSuccessViewToDisplayCorrectData(successView, data.customer); 304 | } 305 | ```