GithubHelp home page GithubHelp logo

Comments (5)

bartonhammond avatar bartonhammond commented on September 21, 2024 2

@DonCallisto Thank you very much! I can chew on this awhile.

from behatpageobjectextension.

DonCallisto avatar DonCallisto commented on September 21, 2024

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.

jakzal avatar jakzal commented on September 21, 2024

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.

bartonhammond avatar bartonhammond commented on September 21, 2024

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.

DonCallisto avatar DonCallisto commented on September 21, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.