Rayrun
← Back to videos

POM Clean Code | Playwright Tutorial part 71

In this video, we'll write a clean import statement in the page object model with the help of the Typescript path alias feature.

The video is a tutorial on how to use path aliases in TypeScript to simplify and clean up the code when using the page object model. The speaker explains that instead of using long paths to access files and folders, TypeScript allows for the use of path aliases. He demonstrates how to set up path aliases in the tsconfig.json file by defining the base URL and creating aliases for the different directories and files needed. He then shows how to use these aliases in the code by replacing the long paths with the aliases. The speaker highlights the benefits of using path aliases, such as easier maintenance and better organization of the code. He concludes by recommending that viewers try implementing path aliases themselves and ask any questions they may have in the comments.

Related Videos

#16 - ARIA and how Playwright is making use of it to identify UI controls?
#16 - ARIA and how Playwright is making use of it to identify UI controls?
Create feature, steps & config | Playwright & Cucumber - Typescript | Part 1
Create feature, steps & config | Playwright & Cucumber - Typescript | Part 1
Working with multiple elements in Playwright Test (NodeJS)
Working with multiple elements in Playwright Test (NodeJS)
Playwright Framework #3 | Multiple ENV with different locators | Playwright Tutorial - Part 82
Playwright Framework #3 | Multiple ENV with different locators | Playwright Tutorial - Part 82
TwitterGitHubLinkedIn
AboutQuestionsDiscord ForumBrowser ExtensionTagsQA Jobs

Rayrun is a community for QA engineers. I am constantly looking for new ways to add value to people learning Playwright and other browser automation frameworks. If you have feedback, email [email protected].