question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Explore API for child selecting

See original GitHub issue

I have some code like so:

  click(
    testSelector('primitive-list-header') + ' '
      + testSelector('pointer')
  );

Thoughts about how this could get better?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
caseywattscommented, Nov 17, 2017

On my team, we started pulling test selectors up into a simple object at the top of test files: https://gist.github.com/caseywatts/46643c9c0825c5e8b1e2542b0a150659

It’s the sort of sugar that testSelector was going for, but more explicit. You can tell exactly what’s going on from within this single file.

2reactions
Turbo87commented, Jun 21, 2017

Just brainstorming, but what about something like this:

import { ts } from 'ember-test-selectors';

click(ts`@primitive-list-header .foo @pointer=3`);

Which would be transformed at runtime to:

click('[data-test-primitive-list-header] .foo [data-test-pointer="3"]');

I’m open to other suggestions about the prefix symbol (@), but in general this seems like a concise API that could work.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Use query parameters to customize responses - Microsoft Graph
Microsoft Graph provides optional query parameters that you can use to specify and control the amount of data returned in a response.
Read more >
api - How do I filter and select inside a expanded collection on ...
When filtering/selecting within an expand, you need to use ; as the ... eq 0&$expand=children($select=id,folder,name,parentReference,cwebUrl ...
Read more >
Take Your Child to Work to Play with APIs - Postman Blog
You and your favorite kids can join a special Postman livestream ... We'll also introduce some kid-friendly APIs you can explore together.
Read more >
APIs for Beginners - How to use an API (Full Course / Tutorial)
Learn all about APIs (Application Programming Interfaces) in this full ... Unit 2 - Exploring APIs ⌨️ Video 1 - Exploring an API...
Read more >
Selectors | jQuery API Documentation
For example, an element with id="foo.bar" , can use the selector $("#foo\\.bar") . ... Select all elements that have no children (including text...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found