Use the TypeScript editor when you want direct Playwright control with Leapwork Play step tracking on top.
What to use
|
Need |
Use |
|---|---|
|
One executable business action |
|
|
Shared timeout or self-heal behavior |
|
|
Input and output values between steps |
|
|
DOM-based validation |
Playwright |
|
Visual validation |
|
|
D365 F&O shortcuts |
|
How to add testdata variables as a separate TS asset and use in multiple TCs
-
Create a new typescript asset.
-
Add your functions variables there and export them.
Plain Text
export const testVar = "testVal";
export function doSomething() {
console.log("Do something");
}
-
Now create a new test case.
-
Drag and drop this in references section if you just want to import variables and functions else if you want to execute it something then drop it in steps sections.
-
Go to playwright section and import and use your functions and variables like you do in playwright.
-
An import statement will be created automatically as soon as typescript asset is dropped.
Plain Text
import { StepTest, testVar, doSomething } from "@assets/Add to basket and basket build-up/Step test";
console.log(testVar);
doSomething();