Skip to content

Small fix to the extension test #1811

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Dec 7, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions dwds/test/puppeteer/extension_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -133,15 +133,14 @@ void main() async {
// Verify the extension opened the Dart docs in the same window:
var devToolsTabTarget = await browser.waitForTarget(
(target) => target.url.contains(devToolsUrlFragment));
final devToolsPage = await devToolsTabTarget.page;
var devToolsTab = await devToolsTabTarget.page;
var devToolsWindowId = await _getWindowId(
devToolsPage.url!,
devToolsTab.url!,
worker: worker,
);
var appWindowId = await _getWindowId(appUrl, worker: worker);
expect(devToolsWindowId == appWindowId, isTrue);
// Close the DevTools tab:
var devToolsTab = await devToolsTabTarget.page;
await devToolsTab.close();
// Navigate to the extension settings page:
final extensionOrigin = getExtensionOrigin(browser);
Expand All @@ -164,8 +163,10 @@ void main() async {
// Verify the extension opened DevTools in a different window:
devToolsTabTarget = await browser.waitForTarget(
(target) => target.url.contains(devToolsUrlFragment));
devToolsTab = await devToolsTabTarget.page;
await devToolsTab.bringToFront();
devToolsWindowId = await _getWindowId(
devToolsPage.url!,
devToolsTab.url!,
worker: worker,
);
appWindowId = await _getWindowId(appUrl, worker: worker);
Expand Down Expand Up @@ -197,6 +198,7 @@ void main() async {
await appTab.bringToFront();
// Verify that the Dart DevTools tab closes:
await devToolsTabTarget.onClose;
await appTab.close();
});

test('Closing the Dart app while debugging closes DevTools', () async {
Expand Down