(description: string, step: () => Promise<T>| T)
| 21 | } |
| 22 | |
| 23 | export const step = async<T = unknown>(description: string, step: () => Promise<T>| T): Promise<Awaited<T>> => { |
| 24 | try { |
| 25 | return await step(); |
| 26 | } catch (error) { |
| 27 | if (error instanceof AssertionError) { |
| 28 | throw new AssertionError( |
| 29 | `Unexpected Result in Step "${description}" |
| 30 | ${error.message}`, |
| 31 | error); |
| 32 | } else { |
| 33 | error.message += ` in Step "${description}"`; |
| 34 | throw error; |
| 35 | } |
| 36 | } |
| 37 | }; |
| 38 | |
| 39 | export const selectOption = async (select: puppeteer.ElementHandle<HTMLSelectElement>, value: string) => { |
| 40 | await select.evaluate(async (node, _value) => { |
no outgoing calls