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.

Data Test Attribute Not Always Appearing When Specified

See original GitHub issue

When I try to add a data-test attribute to an element, it doesn’t appear on the element in the test build unless assigning it a value of “true”.

For example:

This does not work

<h2 class="summary-name" data-test-campaign-summary-name>{{campaign.name}}</h2>

This does work

<h2 class="summary-name" data-test-campaign-summary-name="true">{{campaign.name}}</h2>

Using the following versions:

Ember: 2.12.1 Ember Data: 2.12.2 jQuery: 3.2.1 Ember Simple Auth: 1.2.2 Model Fragments: 2.11.2

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:13 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
Turbo87commented, Jul 14, 2017

Since clearing the async cache appears to fix the issue I’m expecting https://github.com/simplabs/ember-test-selectors/pull/128 to have resolved it too. Please let use know if you still have any issues with the current release.

0reactions
bgentrycommented, Jun 22, 2017

I was also having this issue, and clearing out my $TMPDIR/if-you-need-to-delete-this-open-an-issue-async-disk-cache got the attrs to start appearing again.

Ember v2.13.0, latest version of this addon.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Data-id attribute not showing up when added to display:none ...
And weirdly enough, when I change the display:none to display:show, the data-id attribute will be visible as part of the div. It also...
Read more >
Using data attributes - Learn web development | MDN
data -* attributes allow us to store extra information on standard, semantic HTML elements without other hacks such as non-standard attributes, ...
Read more >
Removing data-test Attributes from React Production DOM
Because of this, we want to remove the data-test attributes during the build process so our final DOM is clean and data-test attribute...
Read more >
Block attributes do not display as expected in AutoCAD
Attributes of some Block objects are not displayed as expected in AutoCAD, while they are displayed correctly inside Block Editor.
Read more >
Don't use data attributes to find HTML elements with JS - intuio
The first thing is “there are no more appropriate attributes or elements” and for specific data that corresponds to a specific (and not...
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