mirror of
https://github.com/enso-org/enso.git
synced 2025-01-09 01:26:59 +03:00
736134e491
Fixes #11604 Most issues were caused by a problem with Project List flooding the network with its requests - this was fixed on develop. But one assertion was flaky - it assumed we will see the "real" run result on `write` node, but sometimes it is immediately overwritten by dry run. But the most important part of this PR is adding traces to Electron packages - it's should be much easier now to debug E2E test failures. Also renamed the previously misnamed "E2E tests" to "[GUI] integration tests".
42 lines
1.2 KiB
TypeScript
42 lines
1.2 KiB
TypeScript
import type { Page } from '@playwright/test'
|
|
import type { ExpressionUpdate, MethodCall } from 'ydoc-shared/languageServerTypes'
|
|
|
|
export type ExpressionLocator = string | { binding: string; expr: string }
|
|
|
|
/** Provide method call info for collapsed function call. */
|
|
export async function mockCollapsedFunctionInfo(
|
|
page: Page,
|
|
expression: ExpressionLocator,
|
|
functionName: string,
|
|
) {
|
|
await mockMethodCallInfo(page, expression, {
|
|
methodPointer: {
|
|
module: 'local.Mock_Project.Main',
|
|
definedOnType: 'local.Mock_Project.Main',
|
|
name: functionName,
|
|
},
|
|
notAppliedArguments: [],
|
|
})
|
|
}
|
|
|
|
/** Provide custom method call info for the specific node. */
|
|
export async function mockMethodCallInfo(
|
|
page: Page,
|
|
expression: ExpressionLocator,
|
|
methodCallInfo: MethodCall,
|
|
) {
|
|
await mockExpressionUpdate(page, expression, { methodCall: methodCallInfo })
|
|
}
|
|
|
|
/** Provide custom expression update for the specific node. */
|
|
export async function mockExpressionUpdate(
|
|
page: Page,
|
|
expression: ExpressionLocator,
|
|
update: Partial<ExpressionUpdate>,
|
|
) {
|
|
await page.evaluate(
|
|
({ expression, update }) => (window as any)._mockExpressionUpdate(expression, update),
|
|
{ expression, update },
|
|
)
|
|
}
|