Ho bisogno di controllare che i dati restituiti siano ordinati per data. Questo è il modo che sto scrivendo:Goniometro: il controllo dei dati è ordinato per data
it('should be sorted by date', function() {
element.all(by.repeater('users in group.users')).then(
function(users) {
var lastUser = users[0].element(by.id('birth-date')).getText();
for (var i = 1; i < users.length; ++i) {
var currentUser = users[i].element(by.id('birth-date')).getText();
expect(moment(currentApplication).format('MMM d, YYYY HH:mm')).toBeGreaterThan(moment(lastApplication).format('MMM d, YYYY HH:mm'));
lastUser = currentUser;
}
}
)
})
Questo restituisce:
Expected 'Jan 1, 2015 00:00' to be greater than 'Jan 1, 2015 00:00'.
Che cosa sto facendo di sbagliato? currentUser e lastUser sembrano essere oggetti anziché testo ... ma non sono sicuro del perché.
Mi sto prendendo questo: TypeError: Object [oggetto Object] non ha alcun metodo 'all' – Jason
@Jason oops, typo, fixed :) – alecxe
Grazie. Sono nuovo, quindi la sintassi è importante per me :) Un altro, ottenendo questo ora: TypeError: Object [oggetto Object] non ha alcun metodo 'sort' – Jason