       formPage.setDescription "this is the description"
       formPage.submit()
 
-      indexPage.alert().success().then (alert) ->
-        expect(alert.getText()).toEqual "Product was created"
-
-      indexPage.greeting().then (greeting) ->
-        expect(greeting.getText()).toEqual "You have 7 products"
+      expect(indexPage.alert().success().isDisplayed()).toBeTruthy()
+      expect(indexPage.alert().success().getText()).toEqual "Product was created"
+      expect(indexPage.greeting().getText()).toEqual "You have 7 products"
 
   describe "edit a product", ->
     formPage = null

  describe "products list page", ->

    it "displays the list of products", ->
      indexPage.greeting().then (greeting) ->
        expect(greeting.getText()).toEqual "You have 6 products"

      indexPage.productNames().then (productNames) ->
        expect(productNames.length).toEqual 6

      formPage.setDescription "this is the new description"
      formPage.submit()

      expect(indexPage.alert().success().isDisplayed()).toBeTruthy()
      expect(indexPage.alert().success().getText()).toEqual "Product was updated"

  describe "delete a product", ->

