Giter Club home page Giter Club logo

Comments (4)

juanazam avatar juanazam commented on May 22, 2024

@toranb we are glad you like it 😄. That's actually a good question, I guess it's a matter of taste, in my opinion, I like my page objects to reflect everything that the user sees when they get to a page (including repeated content as a menu or nav).

Anyway there are same cases that having more than one PageObject is more clear to me, for example testing that a transition is done when the user does a particular action on a page.

  const createUserPage = PageObject.create({
    visit: visitable('/users/new'),
    fillInName: PageObject.fillable('#name')
  });

  const usersPage = PageObject.create({
    users: PageObject.collection({
      scope: 'users',
      itemScope: 'tr',
      item: {
        name: PageObject.text('td')
      }
    })
  });

test("user is redirected to user list page to see created user", function(assert) {
  createUserPage.visit().fillInName("toranb").clickOn('Save');

  andThen(function() {
    assert.equal(usersPage.users(0).name, "toranb");
  });
});

Hope this answers your question 😄

EDIT: you can ask questions like this on the ember-cli-page-object channel on the ember community slack.

from ember-cli-page-object.

toranb avatar toranb commented on May 22, 2024

@juanazam excellent (sorry I didn't utilize the slack channel first) !

from ember-cli-page-object.

san650 avatar san650 commented on May 22, 2024

Thanks for the kind words @toranb.

It's really an interesting topic of discussion. Personally, I prefer to implement the nav menu as a page object component and include it on every page that needs it.

We're also discussing how to implement page object extensibility (#109) to DRY this type of definitions so you can implement a base page object that has all the common parts of the application (main menu, etc).

I would like to see how people is implementing this in general, so if you have examples you can share, It would be great to see them.

from ember-cli-page-object.

toranb avatar toranb commented on May 22, 2024

@san650 I looked over #109 and realized it isn't (yet) in master so for now I'll just follow that and watch what lands in master officially :)

I'm really new to adopting this myself but like mixin model (or any extend option you end up with) as I can include modal/ or navigation as needed. Thanks again!

from ember-cli-page-object.

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.