from selenium import webdriver from selenium.common.exceptions import TimeoutException from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.common.by import By import common # Create chrome webdriver driver=webdriver.Chrome() # Test Case Information result = True step_num = 1 f = common.createFileObj('signin_case_4') scenario = 'Scenario: Sign in with invalid email' precondition = 'Pre-condition: The user did not sign in before' common.printTitle(f, scenario, precondition) # Go to Twidder driver.get("http://127.0.0.1:5000") f.write(str(step_num)+'. '+'Open the browser\n') step_num+= 1 username = driver.find_element_by_id("signin_email") password = driver.find_element_by_id("signin_pw") # Fill in the username with invalid email format username.send_keys("abcabc") f.write(str(step_num)+'. '+'Fill in the username with invalid email format\n') step_num+= 1
from selenium import webdriver from selenium.common.exceptions import TimeoutException from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import Select import common # Create chrome webdriver driver = webdriver.Chrome() # Test Case Information result = True step_num = 1 f = common.createFileObj('signup_case_5') scenario = 'Scenario: Sign up successfully' precondition = 'Pre-condition: The user did not sign up before' common.printTitle(f, scenario, precondition) # Go to Twidder driver.get("http://127.0.0.1:5000") f.write(str(step_num) + '. ' + 'Open the browser\n') step_num += 1 firstname = driver.find_element_by_name("firstname") familyname = driver.find_element_by_name("familyname") gender = Select(driver.find_element_by_tag_name("select")) city = driver.find_element_by_name("city") country = driver.find_element_by_name("country") email = driver.find_element_by_id("signup_email") password = driver.find_element_by_name("passwordSignUp")
from selenium import webdriver from selenium.common.exceptions import TimeoutException from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.common.by import By import common # Create chrome webdriver driver = webdriver.Chrome() # Test Case Information result = True step_num = 1 f = common.createFileObj('postMsg_case_1') scenario = 'Scenario: Post a message in home tab' precondition = 'Pre-condition: The user signed in' common.printTitle(f, scenario, precondition) # Go to Twidder driver.get("http://127.0.0.1:5000") f.write(str(step_num) + '. ' + 'Open the browser\n') step_num += 1 # Fill in the username and password username = driver.find_element_by_id("signin_email") password = driver.find_element_by_id("signin_pw") username.send_keys("abc@abc") f.write(str(step_num) + '. ' + 'Fill in the username\n') step_num += 1
from selenium import webdriver from selenium.common.exceptions import TimeoutException from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.common.by import By import common # Create chrome webdriver driver = webdriver.Chrome() # Test Case Information result = True step_num = 1 f = common.createFileObj('changepw_case_1') scenario = 'Scenario: Change password with old password' precondition = 'Pre-condition: The user signed in' common.printTitle(f, scenario, precondition) # Go to Twidder driver.get("http://127.0.0.1:5000") f.write(str(step_num) + '. ' + 'Open the browser\n') step_num += 1 # Fill in the username and password username = driver.find_element_by_id("signin_email") password = driver.find_element_by_id("signin_pw") username.send_keys("abc@abc") f.write(str(step_num) + '. ' + 'Fill in the username\n') step_num += 1
from selenium import webdriver from selenium.common.exceptions import TimeoutException from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.common.by import By import common # Create chrome webdriver driver = webdriver.Chrome() # Test Case Information result = True step_num = 1 f = common.createFileObj('searchUser_case_1') scenario = 'Scenario: Search non-exist user in browse tab' precondition = 'Pre-condition: The user signed in' common.printTitle(f, scenario, precondition) # Go to Twidder driver.get("http://127.0.0.1:5000") f.write(str(step_num) + '. ' + 'Open the browser\n') step_num += 1 # Fill in the username and password username = driver.find_element_by_id("signin_email") password = driver.find_element_by_id("signin_pw") username.send_keys("abc@abc") f.write(str(step_num) + '. ' + 'Fill in the username\n') step_num += 1
from selenium import webdriver from selenium.common.exceptions import TimeoutException from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.common.by import By import common # Create chrome webdriver driver = webdriver.Chrome() # Test Case Information result = True step_num = 1 f = common.createFileObj('signout_case_1') scenario = 'Scenario: Sign Out Successfully' precondition = 'Pre-condition: The user signed in' common.printTitle(f, scenario, precondition) # Go to Twidder driver.get("http://127.0.0.1:5000") f.write(str(step_num) + '. ' + 'Open the browser\n') step_num += 1 # Fill in the username and password username = driver.find_element_by_id("signin_email") password = driver.find_element_by_id("signin_pw") username.send_keys("abc@abc") f.write(str(step_num) + '. ' + 'Fill in the username\n') step_num += 1