I'm trying to select an element by text, but the actual text changes because it has the current time stamp in it. Is there is way to select it without doing a substring search on getAttributes()? I can't use getAttributes because we will also be testing on android.
The select I'm using:
await expect(element(by.text("James has initiated the chatbot: ShallowFaqChatbot"))).toBeVisible();
The element:
{
hittable: true,
activationPoint: { x: 153.5, y: 14.75 },
normalizedActivationPoint: { x: 0.5, y: 0.5 },
elementFrame: { y: 9, x: 9, width: 307, height: 29.5 },
enabled: true,
elementBounds: { y: 0, x: 0, width: 307, height: 29.5 },
layer: '<CALayer: 0x600002b907c0>',
safeAreaInsets: { right: 0, top: 0, left: 0, bottom: 0 },
visible: true,
elementSafeBounds: { y: 0, x: 0, width: 307, height: 29.5 },
label: 'James has initiated the chatbot: ShallowFaqChatbot - 11:08 am',
className: 'RCTTextView',
frame: { y: 473, x: 34, width: 307, height: 29.5 },
text: 'James has initiated the chatbot: ShallowFaqChatbot - 11:08 am'
}
You can see that it has the attribute text with the text I'm looking for, however detox is unable to grab it because of the " - 11:08 am".