feat(recorder): display primary page URL in recorder title#34637
feat(recorder): display primary page URL in recorder title#34637agg23 merged 2 commits intomicrosoft:mainfrom
Conversation
|
|
||
| import { test, expect } from './inspectorTest'; | ||
|
|
||
| test('should reflect formatted URL of the page', async ({ openRecorder, server }) => { |
There was a problem hiding this comment.
I'm not sure if a new file is the best place for these tests. It seemed like there aren't any tests of the actual Recorder UI itself, only of specific code gen functionality.
This comment has been minimized.
This comment has been minimized.
| window.playwrightSetSources = React.useCallback((sources: Source[]) => { | ||
| setSources(sources); | ||
| window.playwrightSourcesEchoForTest = sources; | ||
| React.useLayoutEffect(() => { |
There was a problem hiding this comment.
This is the way these side effects are supposed to be triggered in React (though ideally it would be useEffect, but I figured people would complain about it potentially being delayed too long). Prior to this change, they were being set on each render of the main component (which happens quite often since it receives the data from the bridge). Unnecessarily inefficient, and for no gain.
dd8797c to
2c707de
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
One of the new tests is failing across all platforms: |
Test results for "tests 1"1 failed 11 flaky37822 passed, 655 skipped Merge workflow run. |
Closes #34549. It is difficult to identify what recorder instance corresponds to a given browser session. This updates our title to roughly match how Chrome DevTools displays in the same scenario.
Note a given
BrowserContextcan have multiple pages, and thus multiple URLs. We take and maintain the first one (so your first tab) as the source of this URL.