remove networkIdle wait state when switching pages (#2428)

# 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)
This commit is contained in:
Joey Orlando 2023-07-05 11:15:21 +02:00 committed by GitHub
parent 7195646413
commit f6e0ec83d8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 8 deletions

View file

@ -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'

View file

@ -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);