My objective is to validate if all names in an array are equal to e2e
. I have a set of objects generated using protractor's element.all(by.css(...)
. The next step involves confirming if any element within the array has a text value that differs from my requirement.
To achieve this, I attempted creating an array from the existing collection and utilized the Array.some
method, as depicted below:
const accountNames = element.all(by.css('td > p:nth-child(3)'))
const notMatch = Array.from(accountNames).some(element =>
element.getText() !== 'e2e')
expect(notMatch).toBeFalsy()
I anticipate obtaining both an array of strings and a boolean outcome with regards to comparing elements against a specific text.
However, I am currently receiving an empty array. What could potentially be causing this issue?