Rayrun
← Back to Discord Forum

How can I extend my test object similar to class inheritance

In other testing framework, I am thinking NUnit or maybe even MSTest, it's pretty straight forward to have a base test class where you could build in some common methods/assertions that could then be inherited in all other test classes that would use the base class. I am interested in doing something similar if not identical with Playwright's Test runner. I've read the docs on Fixtures and usage of base.extend but am not quite getting it fully. I'm just not comprehending it entirely. Said documentation seems to revolve around injecting POMs as fixtures into the test rather than class inheritance like I am imagining. Any insights please?

This thread is trying to answer question "How can I extend my test object similar to class inheritance in Playwright's Test runner?"

0 replies
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 luc@ray.run.