Skip to content

Commit

Permalink
Debug CI timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
isoos committed Aug 30, 2024
1 parent 63992f7 commit 28c4586
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions pkg/pub_integration/test/search_update_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ void main() {
// This imports 100 packages with these semi-random tags, and adding and
// removing filters works because of the number of packages and their
// tags are kind of random.
print('01');
await httpClient.post(Uri.parse('$origin/fake-test-profile'),
body: json.encode({
'testProfile': {
Expand All @@ -53,6 +54,7 @@ void main() {

final user = await fakeTestScenario.createAnonymousTestUser();

print('02');
// listing page
await user.withBrowserPage(
(page) async {
Expand Down Expand Up @@ -89,6 +91,7 @@ void main() {
expect(i2.openSections, isEmpty);
expect(page.url, '$origin/packages?q=platform%3Aandroid');

print('03');
// Open SDKs section
final flutterCB3 = await page.$('#search-form-checkbox-sdk-flutter');
expect(await flutterCB3.boundingBox, isNull);
Expand All @@ -112,6 +115,7 @@ void main() {
page.url, '$origin/packages?q=platform%3Aandroid+sdk%3Aflutter');
expect(i3.openSections, ['sdks']);

print('04');
// unclick Flutter
final flutterCB4 = await page.$('#search-form-checkbox-sdk-flutter');
final flutterLink = await flutterCB4.$x('../following-sibling::*');
Expand Down Expand Up @@ -143,6 +147,7 @@ void main() {
.toList();
expect(both3And5, isEmpty);

print('05');
expect(i5.openSections, ['sdks']);
expect(page.url,
'$origin/packages?q=platform%3Aandroid+-sdk%3Aflutter+pkg');
Expand Down Expand Up @@ -172,6 +177,7 @@ void main() {
expect(page.url,
'$origin/packages?q=platform%3Aandroid+show%3Aunlisted+pkg');

print('06');
// remove discontinued
await page.click('#search-form-checkbox-show-unlisted');
await page.waitForNavigation(wait: Until.networkIdle);
Expand All @@ -187,11 +193,13 @@ void main() {
expect(page.url, '$origin/packages?q=platform%3Aandroid+pkg');
}

print('07');
await toggleMore('is', 'dart3-compatible');
await toggleMore('is', 'flutter-favorite');
},
);

print('08');
// type + multiple checkbox clicks
await user.withBrowserPage(
(page) async {
Expand All @@ -208,7 +216,9 @@ void main() {
await page.waitForSelector(targetSelector, visible: true);
await page.click(targetSelector);
}
print('09');
await page.waitForNavigation(wait: Until.networkIdle);
print('10');
expect(
page.url,
allOf(
Expand All @@ -221,6 +231,7 @@ void main() {
expect(await page.propertyValue('input[name="q"]', 'value'),
'platform:android platform:web platform:ios pkg');

print('11');
await page.click('#search-form-checkbox-platform-windows');
await page.waitForNavigation(wait: Until.networkIdle);
expect(
Expand All @@ -237,6 +248,7 @@ void main() {
},
);

print('12');
// licenses
await user.withBrowserPage(
(page) async {
Expand All @@ -247,6 +259,7 @@ void main() {
await page.waitAndClick('#search-form-checkbox-license-osi-approved');
await page.waitForNavigation(wait: Until.networkIdle);

print('13');
expect(await page.propertyValue('input[name="q"]', 'value'),
'license:osi-approved');
final pageInfo = await listingPageInfo(page);
Expand All @@ -255,6 +268,7 @@ void main() {
},
);

print('14');
// back button working with checkboxes
await user.withBrowserPage(
(page) async {
Expand All @@ -267,6 +281,7 @@ void main() {
expect(page.url, '$origin/packages?q=pkg');
expect(await page.propertyValue('input[name="q"]', 'value'), 'pkg');

print('15');
await page.click('#search-form-checkbox-platform-android');
await page.waitForNavigation(wait: Until.networkIdle);
expect(page.url, '$origin/packages?q=platform%3Aandroid+pkg');
Expand All @@ -279,6 +294,7 @@ void main() {
},
);

print('16');
// back button updating the URL and the input text
await user.withBrowserPage(
(page) async {
Expand All @@ -291,6 +307,7 @@ void main() {
expect(page.url, '$origin/packages?q=pkg');
expect(await page.propertyValue('input[name="q"]', 'value'), 'pkg');

print('17');
await page.focus('input[name="q"]');
await page.keyboard.press(Key.arrowDown);
await page.keyboard.press(Key.backspace);
Expand All @@ -306,6 +323,7 @@ void main() {
},
);

print('18');
// Clicking on a tag keeps the search context.
await user.withBrowserPage((page) async {
await page.gotoOrigin('/packages?q=pkg+platform:android');
Expand All @@ -315,6 +333,7 @@ void main() {
expect(
page.url, '$origin/packages?q=platform%3Aandroid+sdk%3Adart+pkg');
});
print('19');
});
}, timeout: Timeout.factor(testTimeoutFactor));
}

0 comments on commit 28c4586

Please sign in to comment.