mirror of
https://github.com/apache/superset.git
synced 2026-04-23 01:55:09 +00:00
78 lines
2.6 KiB
TypeScript
78 lines
2.6 KiB
TypeScript
/**
|
|
* Licensed to the Apache Software Foundation (ASF) under one
|
|
* or more contributor license agreements. See the NOTICE file
|
|
* distributed with this work for additional information
|
|
* regarding copyright ownership. The ASF licenses this file
|
|
* to you under the Apache License, Version 2.0 (the
|
|
* "License"); you may not use this file except in compliance
|
|
* with the License. You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing,
|
|
* software distributed under the License is distributed on an
|
|
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
* KIND, either express or implied. See the License for the
|
|
* specific language governing permissions and limitations
|
|
* under the License.
|
|
*/
|
|
|
|
/**
|
|
* Timeout constants for Playwright tests.
|
|
* Only define timeouts that differ from Playwright defaults or are semantically important.
|
|
*
|
|
* Default Playwright timeouts (from playwright.config.ts):
|
|
* - Test timeout: 30000ms (30s)
|
|
* - Expect timeout: 8000ms (8s)
|
|
*
|
|
* Use these constants instead of magic numbers for better maintainability.
|
|
*/
|
|
|
|
export const TIMEOUT = {
|
|
/**
|
|
* Global setup timeout (matches test timeout for cold CI starts)
|
|
*/
|
|
GLOBAL_SETUP: 30000, // 30s for global setup auth
|
|
|
|
/**
|
|
* Page navigation and load timeouts
|
|
*/
|
|
PAGE_LOAD: 10000, // 10s for page transitions (login → welcome, dataset → explore)
|
|
|
|
/**
|
|
* Form and UI element load timeouts
|
|
*/
|
|
FORM_LOAD: 5000, // 5s for forms to become visible (login form, modals)
|
|
|
|
/**
|
|
* API response timeout for operations like export/download
|
|
*/
|
|
API_RESPONSE: 15000, // 15s for API responses and downloads
|
|
|
|
/**
|
|
* Confirmation dialog wait (e.g., "Confirm save", "Are you sure?")
|
|
*/
|
|
CONFIRM_DIALOG: 2000, // 2s for confirmation dialogs that may or may not appear
|
|
|
|
/**
|
|
* File import/upload operations (upload + server processing)
|
|
*/
|
|
FILE_IMPORT: 30000, // 30s for file import operations
|
|
|
|
/**
|
|
* UI transition timeout (tab close, popover dismiss, dropdown close)
|
|
*/
|
|
UI_TRANSITION: 5000, // 5s ceiling for Ant Design animations (~300-500ms actual)
|
|
|
|
/**
|
|
* SQL query execution (query → backend processing → results)
|
|
*/
|
|
QUERY_EXECUTION: 15000, // 15s for SQL queries that may take longer than default expect timeout
|
|
|
|
/**
|
|
* Extended test timeout for multi-step tests (page load + query execution + assertions).
|
|
* Use with test.setTimeout() when the default 30s test timeout is insufficient.
|
|
*/
|
|
SLOW_TEST: 60000, // 60s for tests that chain multiple slow operations
|
|
} as const;
|