Skip to content

Add Page Object Support #95

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

Closed
wants to merge 9 commits into from
Closed

Conversation

d4niloArantes
Copy link

This start repo was super helpful to deliver an automation project in my work so I've done some modifications that I you may find nice to have here:

  • The biggest change is the support to page object. I thought of a structure that could fit well to the project;
  • I introduced the config.ts file because I think that is better to have those configurations in one place together;
  • I optimized the Cucumber scenario to use some benefits that Cucumber has offer.
  • I also optimized the usage of the commonBrowserOptions. When it was time for webkit it throws an error if we pass the args to launch it.

@Tallyb
Copy link
Owner

Tallyb commented May 21, 2021

Thank you for the PR.
Personally, I am less keen on classes in Javascript. I think JS is more into the functional side, and I do not see the value in accumulating all the pages into a single place. I would be happy to accept the other changes.

@d4niloArantes
Copy link
Author

Oh I see your point. Well I'll close this PR then. #staySafe

@Haemoglobin
Copy link

Thanks @Tallyb this is a very useful starter - would be keen to see your take on how the page objects could look in a more functional way.

@d4niloArantes Just wanted to say that I have found your PR useful (even if not merged). Thanks!

@Tallyb
Copy link
Owner

Tallyb commented Jun 16, 2021

@Haemoglobin - thank you.
The page object class is basically storing only the page (context can be extracted from page, so it is not really needed). I export the methods included in a page Object as functions, organizing them by modules similar to the page objects.
Then the step definition can just import the needed utility.
I am not sure I see the benefit in the "allPagesObjects" (aka God object) as defined in this code.

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

Successfully merging this pull request may close these issues.

3 participants