# Generated by Selenium IDE
import unittest, os
from .base_test import BaseSeleniumUnitTest
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.support import expected_conditions as ec
from selenium.webdriver.support.wait import WebDriverWait as ui
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
import time

class TestChat(BaseSeleniumUnitTest):
  def test_chat(self):
    self.login_user()
    # 6 | click | css=.btn-primary | 
    self.driver.find_element(By.CSS_SELECTOR, ".btn-primary").click()

    # Test name: chat
    # Step # | name | target | value
    # 1 | open | /mural/1 | 
    self.driver.get("http://localhost:5000/mural/1")
    # 3 | click | css=.btn-dark:nth-child(1) | 
    self.driver.find_element(By.ID, "go-chat-button-with-aaron_morillo").click()
    # 4 | click | id=message-input | 
    self.driver.find_element(By.ID, "message-input-text").click()
    # 5 | type | id=message-input | Hello there!
    self.driver.find_element(By.ID, "message-input-text").send_keys("Hello there!")
    # 6 | click | css=.bi | 
    self.driver.find_element(By.ID, "send-button").click()
    bodyText = self.driver.find_element(By.TAG_NAME, "body").text
    self.assertTrue("Hello there!" in bodyText)

 
if __name__ == '__main__':
    unittest.main()
