From fbe1c82efc360c5e96cbbb5814bd907b400bbd3c Mon Sep 17 00:00:00 2001 From: Omar Jarjur Date: Tue, 22 Oct 2024 11:14:49 -0700 Subject: [PATCH 1/2] Fixes for the Kokoro integration tests: 1. Give integration tests more time to complete 2. Be more specific on which UI items to click in the BQ UI tests 3. Document what the BQ UI test is doing at each step. 4. Make sure the caret selector is expanded before clicking the next one. --- ui-tests/playwright.config.js | 1 + ui-tests/tests/bigquery_dataset_explorer.spec.ts | 14 ++++++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/ui-tests/playwright.config.js b/ui-tests/playwright.config.js index 76367fe3..29e9e3ed 100644 --- a/ui-tests/playwright.config.js +++ b/ui-tests/playwright.config.js @@ -22,6 +22,7 @@ const baseConfig = require('@jupyterlab/galata/lib/playwright-config'); module.exports = { ...baseConfig, + timeout: 120000, webServer: { command: 'jlpm start --allow-root', url: 'http://localhost:8888/lab', diff --git a/ui-tests/tests/bigquery_dataset_explorer.spec.ts b/ui-tests/tests/bigquery_dataset_explorer.spec.ts index c6cef154..936d5834 100644 --- a/ui-tests/tests/bigquery_dataset_explorer.spec.ts +++ b/ui-tests/tests/bigquery_dataset_explorer.spec.ts @@ -35,13 +35,19 @@ test('bigquery-dataset-explorer', async ({ page, request }) => { .getByRole('tab', { name: 'Dataset Explorer - BigQuery' }) .click(); + // Wait for the Dataset projects to populate. await page.waitForSelector('div[role="treeitem"].caret-icon.down'); - await page.locator('div[role="treeitem"].caret-icon.down').nth(1).click(); - await page.locator('div[role="treeitem"][aria-level="1"]').first().click(); - await page.locator('div[role="treeitem"].caret-icon.down').nth(1).click(); + // Expand the first dataset project. This should always be the `bigquery-public-data` one. + await page.locator('div[role="treeitem"].caret-icon.down').nth(0).click(); - await page.locator('div[role="treeitem"][aria-level="2"]').first().click(); + // Wait for the first dataset to be displayed, and then expand it. + await page.waitForSelector('div[role="treeitem"][aria-level="2"]'); + await page.waitForSelector('div[role="treeitem"].caret-icon.down'); + await page.locator('div[role="treeitem"].caret-icon.down').nth(0).click(); + + // Click on the first table displayed. + await page.locator('div[role="treeitem"][aria-level="3"]').first().click(); await page.getByText('Schema', { exact: true }).click(); await page.getByText('Preview', { exact: true }).click(); } else { From dadb7d4d259f071b863805a2602a0cacf7cfaacd Mon Sep 17 00:00:00 2001 From: Omar Jarjur Date: Wed, 23 Oct 2024 00:41:04 +0000 Subject: [PATCH 2/2] Add more waits to the BQ UI tests to try to remove race conditions. --- ui-tests/tests/bigquery_dataset_explorer.spec.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/ui-tests/tests/bigquery_dataset_explorer.spec.ts b/ui-tests/tests/bigquery_dataset_explorer.spec.ts index 936d5834..3e03888e 100644 --- a/ui-tests/tests/bigquery_dataset_explorer.spec.ts +++ b/ui-tests/tests/bigquery_dataset_explorer.spec.ts @@ -36,6 +36,7 @@ test('bigquery-dataset-explorer', async ({ page, request }) => { .click(); // Wait for the Dataset projects to populate. + await page.waitForSelector('div[role="treeitem"][aria-level="1"]'); await page.waitForSelector('div[role="treeitem"].caret-icon.down'); // Expand the first dataset project. This should always be the `bigquery-public-data` one.