Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有可能跟随吗?
const span= fixture.debugElement.query(By.css('span:containts("some text")'));
还是有类似.cssContainingText量角器的东西?作为css选择器或其他方式。
.cssContainingText
这种方法怎么样:
const spans = fixture.debugElement.queryAll(By.css('span')); const span = spans.find(span => span.nativeElement.textContent.includes('some text'))