Skip to content

Commit

Permalink
remove networkIdle wait state when switching pages (#2428)
Browse files Browse the repository at this point in the history
# Which issue(s) this PR fixes

speed up e2e tests + improve stability

## Checklist

- [ ] Unit, integration, and e2e (if applicable) tests updated
- [ ] Documentation added (or `pr:no public docs` PR label added if not
required)
- [ ] `CHANGELOG.md` updated (or `pr:no changelog` PR label added if not
required)
  • Loading branch information
joeyorlando authored Jul 5, 2023
1 parent dda92a1 commit 330785b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
8 changes: 2 additions & 6 deletions integration-tests/schedules/quality.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,15 @@ test('check schedule quality for simple 1-user schedule', async ({ adminRolePage

await createOnCallSchedule(page, onCallScheduleName, userName);

/**
* this page.reload() call is a hack to temporarily get around this issue
* https://github.com/grafana/oncall/issues/1968
*/
await page.reload({ waitUntil: 'networkidle' });

const scheduleQualityElement = page.getByTestId('schedule-quality');
await scheduleQualityElement.waitFor({ state: 'visible' });

await expect(scheduleQualityElement).toHaveText('Quality: Great', { timeout: 15_000 });

await scheduleQualityElement.hover();

const scheduleQualityDetailsElement = page.getByTestId('schedule-quality-details');
await scheduleQualityDetailsElement.waitFor({ state: 'visible' });

await expect(scheduleQualityDetailsElement.locator('span[class*="Text"] >> nth=2 ')).toHaveText(
'Schedule has no gaps'
Expand Down
3 changes: 1 addition & 2 deletions integration-tests/utils/navigation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ import { BASE_URL } from './constants';
type GrafanaPage = '/plugins/grafana-oncall-app';
type OnCallPage = 'incidents' | 'integrations' | 'escalations' | 'schedules' | 'users';

const _goToPage = (page: Page, url = ''): Promise<Response> =>
page.goto(`${BASE_URL}${url}`, { waitUntil: 'networkidle' });
const _goToPage = (page: Page, url = ''): Promise<Response> => page.goto(`${BASE_URL}${url}`);

export const goToGrafanaPage = (page: Page, url: GrafanaPage): Promise<Response> => _goToPage(page, url);

Expand Down

0 comments on commit 330785b

Please sign in to comment.