Exemplo n.º 1
0
class test_saasLogin(unittest.TestCase):
    def setUp(self):
        self.driver = BrowserEngine().open_browser()
        self.loginpage = saasloginPage(self.driver)

    def tearDown(self):
        self.driver.close()

    @ddt.data(('abc', '123456'), ('AT', '123456'))
    @ddt.unpack
    def test_saasLogin_1(self, username, password):
        self.loginpage.type_username(username)
        self.loginpage.type_password(password)
        self.loginpage.click_loginButton()
        self.loginpage.get_error()
        logger.info(self.loginpage.get_error())

    @ddt.data(('AT', '123456'))
    @ddt.unpack
    def test_saasLogin_2(self, username, password):
        self.loginpage.type_username(username)
        self.loginpage.type_password(password)
        self.loginpage.click_loginButton()
        time.sleep(3)
        if self.loginpage.isLoginSuccess():
            self.loginpage.click_loginOutButton()
        else:
            print("User is not login status !!")
Exemplo n.º 2
0
    email_loc = 'xpath >> /html/body/div[1]/div/div[3]/div/form/div/div[2]/div/div[3]/div[2]/p/input'
    password_loc = 'xpath >> /html/body/div[1]/div/div[3]/div/form/div/div[2]/div/div[5]/div[2]/p/input'
    firstname_loc = 'xpath >> /html/body/div[1]/div/div[3]/div/form/div/div[2]/div/div[6]/div[2]/p/input'
    lastname_loc = 'xpath >> /html/body/div[1]/div/div[3]/div/form/div/div[2]/div/div[7]/div[2]/p/input'
    selectCountryBtn_loc = 'xpath >> /html/body/div[1]/div/div[3]/div/form/div/div[2]/div/div[10]/div[2]/p/button'
    selectCountryTitle_loc = 'xpath >> /html/body/div[1]/div/div[4]/div/div/div[1]/h4'
    contryListSearch_loc = 'xpath >> /html/body/div[1]/div/div[4]/div/div/div[2]/div[1]/div[2]/input'
    contryListSearchBtn_loc = 'xpath >> /html/body/div[1]/div/div[4]/div/div/div[2]/div[1]/button'
    countryListSelectIn_loc = 'xpath >> /html/body/div[1]/div/div[4]/div/div/div[2]/div[2]/div[1]/table/tbody/tr[1]/td[1]/input'

    def registerEamilUser(self, username):
        self.click(self.regType0_loc)  #选择注册类型
        self.click(self.regType1_loc)  #选择邮箱用户
        self.send_keys(self.email_loc, username)  #输入邮箱
        self.send_keys(self.password_loc, '123456')  #输入密码
        self.click(self.selectCountryBtn_loc)
        t = self.get_text(self.selectCountryTitle_loc)
        if t == '选择国家或地区':
            print("选择国家弹窗打开成功!!")
        self.send_keys(self.contryListSearch_loc, 'cn')
        self.click(self.contryListSearchBtn_loc)
        self.click(self.countryListSelectIn_loc)


driver = BrowserEngine().open_browser()

page = registerPage(driver)

page.op
page.registerEamilUser("*****@*****.**")
Exemplo n.º 3
0
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import time
import unittest, ddt
from selenium import webdriver
from SAAS_UI_TEST.pageObject.customer360Page import customer360Page
from SAAS_UI_TEST.pageObject.saasMainPage import saasMainPage
from SAAS_UI_TEST.framework.browser_engine import BrowserEngine
from SAAS_UI_TEST.framework.logger import Logger

logger = Logger(logger='TestCase').getlog()

driver = BrowserEngine().open_browser()

page = customer360Page(driver)
page.openPage()
page.searchUser("8619900991745")
page.closePage()
driver.close()
Exemplo n.º 4
0
 def setUp(self):
     self.driver = BrowserEngine().open_browser()
     self.loginpage = saasloginPage(self.driver)