Skip to content

Commit 7cfd382

Browse files
chore: try to resolve flaky chart creation
1 parent 41a558a commit 7cfd382

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tests/e2e/utils/common.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,6 @@ export async function createChartWithAdmin( admin, page, chart_label = CHART_JS_
5656
// The string must be numeric.
5757
expect( chartId ).toMatch(/^\d+$/);
5858

59-
60-
6159
await page.frameLocator('iframe').getByRole('button', { name: 'Create Chart' }).click({ timeout: 5000 });
6260

6361
await page.waitForURL( '**/admin.php?page=visualizer', { timeout: 5000 } );
@@ -140,6 +138,8 @@ export function getAssetFilePath( assetName ) {
140138
*/
141139
export async function selectChartAdmin(iframeLocator, chartLabel) {
142140
const labelRegex = new RegExp(`^${chartLabel}$`);
141+
await expect( iframeLocator.locator('div#type-picker').locator('label').filter({ hasText: labelRegex }) ).toBeVisible({ timeout: 5000 });
143142
await iframeLocator.locator('div#type-picker').locator('label').filter({ hasText: labelRegex }).click();
143+
await expect( iframeLocator.getByRole('button', { name: 'Next' }) ).toBeVisible({ timeout: 5000 });
144144
await iframeLocator.getByRole('button', { name: 'Next' }).click();
145145
}

0 commit comments

Comments
 (0)