(context: WebSmokeContext)
| 135 | } |
| 136 | |
| 137 | async function assertWebNetwork(context: WebSmokeContext): Promise<void> { |
| 138 | const result = await runStep(context, 'inspect browser network', [ |
| 139 | 'network', |
| 140 | 'dump', |
| 141 | '10', |
| 142 | '--include', |
| 143 | 'headers', |
| 144 | ...context.common, |
| 145 | ]); |
| 146 | assert.equal(result.json?.data?.backend, 'agent-browser'); |
| 147 | const entries: unknown[] = Array.isArray(result.json?.data?.entries) |
| 148 | ? result.json.data.entries |
| 149 | : []; |
| 150 | const fixtureEntry = entries.find( |
| 151 | (entry): entry is Record<string, unknown> => |
| 152 | typeof entry === 'object' && entry !== null && 'url' in entry && entry.url === context.url, |
| 153 | ); |
| 154 | if (!fixtureEntry) { |
| 155 | failWithContext(context, 'inspect browser network', ['network', 'dump', '10'], result); |
| 156 | } |
| 157 | assert.equal(fixtureEntry.method, 'GET'); |
| 158 | assert.equal(typeof fixtureEntry.requestHeaders, 'object'); |
| 159 | } |
| 160 | |
| 161 | async function assertWebInteractions(context: WebSmokeContext): Promise<void> { |
| 162 | await runStep(context, 'click submit', ['click', 'label="Submit order"', ...context.common]); |
no test coverage detected