Giter VIP home page Giter VIP logo

Comments (1)

YevgeniyShunevych avatar YevgeniyShunevych commented on June 19, 2024

The main problem I see here is that Atata's generic page objects model cannot support that. You should pass explicit type of page object to Go.To<TPageObject>(...) method. If a test uses one of the page object types, the type cannot be replaced with another one on a fly. And the base type also would not work here, as base page object type should be generic.

For cases when you need to test multiple resolutions/devices/platforms I would try to configure single page object using multiple JSON config files that contain AtataContext attributes separate for each platform. Kind of you can have single AccountDetailsPage with control properties marked with common attributes (that suit all resolutions), Atata.json (default one with main settings), Atata.Tablet.json, Atata.Mobile.json, etc. The additional configs can add attributes for page object and its controls specific for the resolution. For example you can define different FindAttributes for different resolutions.

{
  "attributes": {
    "component": [
      {
        "type": "AccountDetailsPage",
        "attributes": [
          {
            "type": "attribute type",
            "{{attributeValueName}}": "value" // Any property or constructor parameter of attribute.
          }
        ],
        "properties": [
          {
            "name": "property name",
            "attributes": [
              {
                "type": "attribute type",
                "{{attributeValueName}}": "value" // Any property or constructor parameter of attribute.
              }
            ]
          },
          {
              //...
          }
        ]
      }
    ]
  }
}

I believe that it will not cover all scenarios, but most. For cases when application with different resolutions have completely different UI and behavior, configuring with attributes may not be enough. For such cases, separate resolution tests (with separate page objects as well) can be implemented, for desktop, mobile, tablet. And such tests can be enabled/disabled depending on target platform testing.

If you can, please provide a couple of issues that you have with different resolutions and I can try to help resolve that using the approach described above.

from atata.

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.