Beispiel #1
0
import unittest
from time import sleep

import paramunittest

from comm import common
from comm.Log import MyLog as Log
from comm.common import Element

register_xls = common.get_xls("testCase.xls", "register")


@paramunittest.parametrized(*register_xls)
class TestRegister(unittest.TestCase):
    def setParameters(self, case_name, email, password, password_confirm,
                      result):
        """
        :param case_name:
        :param email:
        :param password:
        :param password_confirm:
        :param result:
        :return:
        """
        self.case_name = str(case_name)
        self.email = str(email)
        self.password = str(password)
        self.password_confirm = str(password_confirm)
        self.result = str(result)
        print("setParameters!")
Beispiel #2
0
import unittest
from testCase.loginPage import login
from selenium.webdriver import Remote
from selenium import webdriver
import readconfig
localReadConfig = readconfig.readconfig()
import time
from comm import common
import paramunittest
from comm.Log import MyLog

login_xls = common.get_xls("userCase.xlsx", "login")
log = MyLog.get_log()
logger = log.get_logger()


@paramunittest.parametrized(*login_xls)
class Login(unittest.TestCase):
    def setParameters(self, case, email, password):
        self.email = email
        self.password = password
        self.case = case

    def setUp(self):
        self.driver = webdriver.Ie()
        self.driver.get(localReadConfig.get_HTTP("baseurl"))
        self.driver.maximize_window()
        self.driver.implicitly_wait(10)

        logger.info("开始." + self.case + "测试.")
Beispiel #3
0
import unittest
from time import sleep
import paramunittest
from comm import common
from comm.common import Element
from comm.Log import MyLog as Log

login_xls = common.get_xls("testCase.xls", "login")


@paramunittest.parametrized(*login_xls)
class Login(unittest.TestCase):
    def setParameters(self, case_name, email, password, result):
        """
        set parameters
        :param case_name:
        :param email:
        :param password:
        :param result:
        :return:
        """
        self.case_name = str(case_name)
        self.email = str(email)
        self.password = str(password)
        self.result = str(result)

    def description(self):
        """
        case description
        :return:
        """