Comments (5)
@DonCallisto Thank you very much! I can chew on this awhile.
from behatpageobjectextension.
Usually I split my context for "Subject --> Action", something like "User --> SignupContext, LoginContext, ResetPasswordContext" and so on.
It could be the case where contexts has same steps: I don't mind as I build my suites as follows
default:
suites:
ui_alunno_import:
paths:
- '%paths.base%/Features/Alunno'
contexts:
- NuvolaBehat\Context\Ui\Alunno\ImportContext
- NuvolaBehat\Context\Ui\Ata\ScegliAreaDiLavoroContext
- NuvolaBehat\Context\Ui\Hook\UiHookContext
- NuvolaBehat\Context\Ui\Utente\ImpersonaContext
- NuvolaBehat\Context\Ui\Utente\LoginContext
filters:
tags: "@alunno_import && @ui"
This way I use only Context
that I really need.
Don't know if this can help you.
Moreover I can't see how this problem could be related to this extension.
from behatpageobjectextension.
The idea behind page objects it to encapsulate all page interactions and page details extraction in page objects. Your context files will only call page objects to perform an action, or ask a page object for some page details (like title, header, if something is present on the page etc).
This way you avoid duplication as all the gressy details are in one place (page objects). You still might have to call the same page object in a similar way from multiple contexts. These one liners are usually not a big deal.
Sometimes it's worth to reconsider how you group your steps around contexts. It's not easy thing to do in cucumber implementations in general, whether you use the PO extension or not.
from behatpageobjectextension.
Thanks @jakzal & @DonCallisto - I appreciate your feedback - I'm not sure exactly how to address this but it's comforting to know it's not a problem specific w/ me.
from behatpageobjectextension.
@bartonhammond Take a look at Sylius.
I can't remember if they're using this extension - probably not - but the approach they follow to structure Features and Contexts is similar to what I've tried to explain with my snippet.
Maybe you can find there some useful techniques.
Good luck!
from behatpageobjectextension.
Related Issues (20)
- verifyUrl() can report expected and found URL as the same HOT 1
- User Notice: Undefined property: Page\HomePage::$factory HOT 2
- Fatal error: Call to a member function createPage() on null (Behat\Testwork\Call\Exception\FatalThrowableError) HOT 7
- Scenario works fine on pc but fails on Docker/Bitbucket HOT 3
- Expected to be on "xxx" but found "" instead HOT 6
- Misleading error when WebDriver fails to create a session
- Clicking link, when emulating device, does not work HOT 1
- Have Page subclasses to hold site-wide element locators and methods HOT 4
- ERROR 500 HOT 3
- fatal-error-uncaught-argument count error HOT 5
- Outdated Documentation HOT 2
- Support PHP 8.0 HOT 12
- Trying to get in touch regarding a security issue HOT 3
- Cannot autowire service ... "$factory" of method "SensioLabs\Behat\PageObjectExtension\PageObject\Page::__construct()" references interface "Sensi oLabs\Behat\PageObjectExtension\PageObject\Factory" HOT 1
- getDriver method is not available in Page class HOT 13
- Remove verify() from $page->open() function HOT 2
- Ability to reuse code among page/element objects HOT 2
- Remove path and selector from page and element HOT 2
- Fatal error: Call to a member function open() on null HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from behatpageobjectextension.