       secondProduct = indexPage.nthProduct(2)
       secondProduct.getDeleteButton().click()
 
-      indexPage.alert().info().then (alert) ->
-        expect(alert.getText()).toEqual "Product was deleted"
-
-      indexPage.greeting().then (greeting) ->
-        expect(greeting.getText()).toEqual "You have 5 products"
+      expect(indexPage.alert().info().isDisplayed()).toBeTruthy()
+      expect(indexPage.alert().info().getText()).toEqual "Product was deleted"
+      expect(indexPage.greeting().getText()).toEqual "You have 5 products"

      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"

  describe "edit a product", ->
    formPage = null

  describe "products list page", ->

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

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