2023-03-04 01:28:33 +03:00
|
|
|
/**
|
|
|
|
* Copyright (c) Microsoft Corporation.
|
|
|
|
*
|
|
|
|
* Licensed 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.
|
|
|
|
*/
|
|
|
|
|
2024-01-08 06:45:42 +03:00
|
|
|
import type { Locator } from 'playwright/test';
|
2023-04-20 01:32:33 +03:00
|
|
|
import type { JsonObject } from '@playwright/experimental-ct-core/types/component';
|
2024-01-08 06:45:42 +03:00
|
|
|
import type { TestType } from '@playwright/experimental-ct-core';
|
2023-03-04 01:28:33 +03:00
|
|
|
|
|
|
|
export interface MountOptions<HooksConfig extends JsonObject> {
|
|
|
|
hooksConfig?: HooksConfig;
|
|
|
|
}
|
|
|
|
|
2024-02-06 04:19:39 +03:00
|
|
|
export interface MountResult extends Locator {
|
2023-03-04 01:28:33 +03:00
|
|
|
unmount(): Promise<void>;
|
|
|
|
update(component: JSX.Element): Promise<void>;
|
|
|
|
}
|
|
|
|
|
2024-01-08 06:45:42 +03:00
|
|
|
export const test: TestType<{
|
2023-03-04 01:28:33 +03:00
|
|
|
mount<HooksConfig extends JsonObject>(
|
|
|
|
component: JSX.Element,
|
|
|
|
options?: MountOptions<HooksConfig>
|
|
|
|
): Promise<MountResult>;
|
2024-01-08 06:45:42 +03:00
|
|
|
}>;
|
2023-03-04 01:28:33 +03:00
|
|
|
|
2024-01-08 06:45:42 +03:00
|
|
|
export { defineConfig, PlaywrightTestConfig } from '@playwright/experimental-ct-core';
|
2023-09-09 00:23:35 +03:00
|
|
|
export { expect, devices } from 'playwright/test';
|