Giter Club home page Giter Club logo

Comments (3)

edbzn avatar edbzn commented on June 1, 2024

Hi @srlee309, really appreciate your feedback, thank you! That's something we were thinking about. I really like how you abstracted the locatorFor logic. Would you want to create a PR for that? Maybe we can iterate over it, but that's a good starting point. What do you think @yjaaidi ?

from devkit.

yjaaidi avatar yjaaidi commented on June 1, 2024

Hi @srlee309, thank you for your suggestion.
Actually, you can already use HarnessPredicate to achieve this.
Cf. https://material.angular.io/cdk/test-harnesses/overview#filtering-harness-instances-with-harnesspredicate

This would look something like:

export class TitleHarness extends ComponentHarness {
  ...

  static with(
    options: BaseHarnessFilters
  ): HarnessPredicate<TitleHarness> {
    return new HarnessPredicate(TitleHarness, options);
  }
}

...

getHarness(TitleHarness.with({ selector: '...' })

I totally agree that the HarnessPredicate and ComponentHarness implementation are not very convenient. Cf. angular/components#20871

The goal of this library is to provide a way of using existing harnesses with Cypress, but we are planning to release another library (in this repo) that will make harness writing easier.
We are still not sure if we will extend ComponentHarness or provide a completely different approach that could be framework agnostic.

I will close this issue and add a reference to it in a new issue about harness abstraction in general.

from devkit.

yjaaidi avatar yjaaidi commented on June 1, 2024

I just opened the issue. @srlee309 if you have any suggestions & ideas, we'd be glad to hear them 😊

from devkit.

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.