New to protractor and excited about learning. I have researched and read posts and learned a lot but this one has me stumped.
The UI has a table which lists products based on their state. Once the product is created in the DB a job has to run which can take seconds or minutes. When first created the product state in the DB is set to pending. After the job completes the product state becomes ready. The UI will list the product as soon as the product is in the DB but will not enable the link to the product until the product state reaches ready. The only way the UI is updated is by refreshing the browser. So I'm trying to write something in protractor similar to the sudo code:
Start of Loop If product.element.isDisplayed If product.element.isClickable product.element.click else browser.sleep.forSomeAmountOfTimeToPreventContinuousBrowserRefreshes browser.refresh else console.log.display.someSortOfUsefulMessage End Loop After Some Arbitrary Amount Of Time
Any help in the best way to approach a solution would be appreciated.