jeudi 28 mai 2015

Protractor tests are passing regardless if isDisplayed is true

I have some E2E tests that are currently passing. I thought this was working as expected, however when i use browser.sleep() after inputing data into fields to modify some fields to see if the test will fail when it reaches the expected results.

Our test spec fills out a form, and upon saving the form, we navigate back home to see the name of the form to display in a grid(if the save is successful).

The expected code in our spec is as follows:

expect(element.all(mainPO.getScheduled()).isDisplayed());

Main PageObject:

this.currentScheduledCampaign = by.linkText(scheduledData.scheduledEntity.name);

this.getCurrentScheduledCampaign = function() {
     return this.currentScheduledCampaign;
}; 

scheduledEntity:

this.scheduledEntity = {
    name: 'Protractor Test' + ' ' + uuid.v4()
};

Why would .isDisplayed() returning the protractor test as a fail, even if i remove say the "Protractor Test" from the name during a browser.sleep() BEFORE saving the campaign?

I've tried running with console.log() on both the getCurrentScheduledCampaign and scheduledData.scheduledEntity.name and it seems to return the proper expected name being "Protractor Test [UUID]" and "{ using: 'link text', value: 'Protractor Test [UUID]'.

Aucun commentaire:

Enregistrer un commentaire