@11joselu/cypress-to-playwright
Version:
Automatic migration from cypress to playwright
31 lines • 2.74 kB
TypeScript
import ts from 'typescript';
import { COMMANDS, LOCATOR_PROPERTIES, VALIDATION } from '../playwright.js';
type Args = ts.NodeArray<ts.Expression> | ts.NumericLiteral[] | ts.StringLiteral[] | ts.Expression[];
export type Factory = {
callExpressionStatement(newExpression: ts.Expression, callExpression: ts.CallExpression): ts.Statement;
statement(statement: ts.Expression): ts.Statement;
propertyAccessExpression(expression: string | ts.Expression, name: string | ts.MemberName): ts.PropertyAccessExpression;
identifier(name: string): ts.Identifier;
arrowFunction(body: ts.Block, parameters: ts.ParameterDeclaration[], modifiers?: ts.Modifier[]): ts.ArrowFunction;
callExpression(expression: ts.Expression, typeArguments: ts.NodeArray<ts.TypeNode> | undefined, argumentsArray: ts.NodeArray<ts.Expression> | ts.Expression[]): ts.CallExpression;
destructuringParameter(parameterName: string): ts.ParameterDeclaration;
awaitCallExpression(expression: ts.PropertyAccessExpression | ts.CallExpression, typeArguments?: ts.NodeArray<ts.TypeNode> | undefined, args?: ts.NodeArray<ts.Expression> | ts.NumericLiteral[]): ts.AwaitExpression;
await(expression: ts.CallExpression): ts.AwaitExpression;
emptyBlock(): ts.Block;
asyncToken(): ts.ModifierToken<ts.SyntaxKind.AsyncKeyword>;
exportToken(): ts.ModifierToken<ts.SyntaxKind.ExportKeyword>;
variable(name: string, value: ts.Expression, flag?: ts.NodeFlags): ts.VariableStatement;
block(statements: ts.Statement[]): ts.Block;
numeric(value: string): ts.NumericLiteral;
string(value: string): ts.StringLiteral;
expect(validationValues: ts.LeftHandSideExpression, validationType: Omit<VALIDATION, 'EXPECT'>, validationArgs?: Args, isNegative?: boolean): ts.AwaitExpression;
playwrightCommand(commandName: COMMANDS): ts.PropertyAccessExpression;
playwrightLocatorProperty(property: LOCATOR_PROPERTIES, locatorTypeArgs?: ts.NodeArray<ts.TypeNode> | undefined, locatorArgs?: ts.NodeArray<ts.Expression> | ts.Expression[], propertyTypeArgs?: ts.NodeArray<ts.TypeNode> | undefined, propertyArgs?: ts.NodeArray<ts.Expression> | ts.Expression[]): ts.CallExpression;
playwrightIntercept(node: ts.CallExpression): ts.CallExpression;
functionWithPageParameter(node: ts.FunctionDeclaration | ts.VariableDeclaration): ts.FunctionDeclaration | ts.VariableDeclaration;
parameter: (name: string) => ts.ParameterDeclaration;
function(name: string, parameters: ts.ParameterDeclaration[] | ts.NodeArray<ts.ParameterDeclaration>, body: ts.Block, modifiers?: ts.ModifierLike[]): ts.FunctionDeclaration;
};
export declare const nodeFactory: (factory: ts.NodeFactory) => Factory;
export {};
//# sourceMappingURL=node-factory.d.ts.map