Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using fixtures with the framework setup #26

Open
amit42147 opened this issue Jul 29, 2024 · 1 comment
Open

Using fixtures with the framework setup #26

amit42147 opened this issue Jul 29, 2024 · 1 comment

Comments

@amit42147
Copy link

Hello Vasu31dev! What an awesome framework with utility methods and excellent understandability.
One unique thing about Playwright is the concept of fixtures or ability to create custom fixtures that can reduce code duplication and especially the import statements that can make a test file clunky.

Is there any way to create custom fixtures for the pages from page object folder that we can call in the tests so that statements like following can be removed or any other repeatable steps across all tests if they are stand alone - example login, import statements like below
import { click, clickAndNavigate, fill, gotoURL } from 'vasu-playwright-utils';
import { expectElementToBeVisible } from 'vasu-playwright-utils';
import { getLocator, getLocatorByPlaceholder, getLocatorByRole } from 'vasu-playwright-utils';

@vcannam
Copy link

vcannam commented Jul 29, 2024

Hi @amit42147,
Thank you for the appreciation. I'm glad to hear that you like the framework. It's been a few months since I last updated the framework due to a busy schedule. Fixtures are very powerful in Playwright, and I will definitely add them and update the import statements to make it easier. Thank you so much for your suggestion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants