Пример #1
0
class ThirdPage(QMainWindow):
    def __init__(self):
        super().__init__()

        self.ui = Ui_MainWindow()
        self.ui.setupUi(self)
        self.ui.pushButton.clicked.connect(self.clk)

        self.succes = Success()
        self.fail = Fail()

    def refresh(self, key):
        self.key = key
        self.analyze()

    def analyze(self):
        if self.key == 1:
            self.succes.show()
        else:
            self.fail.show()

    def clk(self):
        from main_page import MainPage
        self.giris = MainPage()
        self.giris.show()
        self.close()
class AThirdPage(QMainWindow):
    def __init__(self):
        super().__init__()

        self.ui = Ui_admin2()
        self.ui.setupUi(self)

        self.ui.pushButton.clicked.connect(self.page1)
        self.ui.pushButton_2.clicked.connect(self.page2)
        self.ui.pushButton_3.clicked.connect(self.page3)
        self.ui.pushButton_4.clicked.connect(self.mainpage)

        self.admin3 = AFPage()
        self.admin4 = AGPage()

    def page1(self):
        self.admin3.show()

    def page2(self):
        self.admin4.show()

    def page3(self):
        import read_data
        read_data.transfer()

    def mainpage(self):
        from main_page import MainPage
        self.giris = MainPage()
        self.giris.show()
        self.close()
Пример #3
0
 def show_main_page(self):
     self.main_page = MainPage(master=self)
     self.main_page.place(in_=self.container,
                          x=0,
                          y=0,
                          relwidth=1,
                          relheight=1)
     self.main_page.show()
Пример #4
0
 def setUp(self):
     chrome_options = Options()
     chrome_options.add_argument('headless')
     self.driver = webdriver.Chrome('chromedriver.exe', options=chrome_options)
     self.driver.get('http://automationpractice.com/index.php')
     self.driver.implicitly_wait(5)
     self.pageMain = MainPage(self.driver)
     self.pageDresses = DressesPage(self.driver)
     self.dressesCasual = CasualDresses(self.driver)
     self.add_to_cart = AddToCart(self.driver)
     self.added_product = ProductAdded(self.driver)
Пример #5
0
 def setUp(self):
     """
     Предусловие:
     зайти на сайт www.onetwotrip.com
     нажать "личный кабинет"
     """
     self.driver = webdriver.Firefox()
     self.driver.maximize_window()
     page = MainPage(self.driver)
     page.open("http://www.onetwotrip.com/ru")
     page.top_panel.click_button_personal_area()
def precondition(request):
    main_page = MainPage()
    main_page.authorization()
    profile_page = ProfilePage()

    def postcondition():
        driver_quit()

    request.addfinalizer(postcondition)

    return profile_page
Пример #7
0
class MainView(tk.Frame):
    def __init__(self, *args, **kwargs):
        tk.Frame.__init__(self, *args, **kwargs)

        self.container = tk.Frame(self)
        self.container.pack(side="top", fill="both", expand=True)
        self.show_main_page()

    def show_main_page(self):
        self.main_page = MainPage(master=self)
        self.main_page.place(in_=self.container,
                             x=0,
                             y=0,
                             relwidth=1,
                             relheight=1)
        self.main_page.show()

    def show_new_review_page(self, review):
        self.review_page = ReviewPage(master=self, review=review)
        self.review_page.place(in_=self.container,
                               x=0,
                               y=0,
                               relwidth=1,
                               relheight=1)
        self.review_page.show()

    def show_view_all_page(self):
        self.view_all_page = ViewAllPage(master=self)
        self.view_all_page.place(in_=self.container,
                                 x=0,
                                 y=0,
                                 relwidth=1,
                                 relheight=1)
        self.view_all_page.show()

    def show_add_flashcard_page(self):
        self.add_flashcard_page = AddFlashcard(master=self)
        self.add_flashcard_page.place(in_=self.container,
                                      x=0,
                                      y=0,
                                      relwidth=1,
                                      relheight=1)
        self.add_flashcard_page.show()

    def show_edit_flashcard_page(self, flashcard):
        self.edit_flashcard_page = EditFlashcard(master=self,
                                                 flashcard=flashcard)
        self.edit_flashcard_page.place(in_=self.container,
                                       x=0,
                                       y=0,
                                       relwidth=1,
                                       relheight=1)
        self.edit_flashcard_page.show()
Пример #8
0
def test_page_open(browser):
    link = "https://csgoempire.com"
    # link = "https://www.google.ru/"
    page = MainPage(browser, link)
    # Открываем страницу, на которой будем парсить
    page.open()
    # Открываем страницу, на которой будем парсить
    time.sleep(10)

    while True:
        page.wait_for_counter_disappear(*MainPageLocators.COUNTER)
        page.watch_the_wheel(browser, *MainPageLocators.WHEEL)
        page.collect_data(browser, *MainPageLocators.RESULT)
Пример #9
0
    def __init__(self):

        self.st = SeleniumTools("https://www.klanlar.org")

        self.main_page = MainPage()

        self.ana_bina_page = AnaBinaPage(self.st.driver)
Пример #10
0
class BuyCases(unittest.TestCase):
    """Just an excercise to learn.."""
    def setUp(self):
        chrome_options = Options()
        chrome_options.add_argument('headless')
        self.driver = webdriver.Chrome('chromedriver.exe', options=chrome_options)
        self.driver.get('http://automationpractice.com/index.php')
        self.driver.implicitly_wait(5)
        self.pageMain = MainPage(self.driver)
        self.pageDresses = DressesPage(self.driver)
        self.dressesCasual = CasualDresses(self.driver)
        self.add_to_cart = AddToCart(self.driver)
        self.added_product = ProductAdded(self.driver)

    #@unittest.skip('no quiero que corra el test1')
    def test_caso_1(self):
        self.pageMain.click_dresses()
        self.pageDresses.subcategories_casual_dresses()
        self.dressesCasual.click_dress()
        self.add_to_cart.enter_quantity('5')
        self.add_to_cart.enter_size('L')
        self.add_to_cart.click_add_to_cart()
        self.assertEqual(self.added_product.return_quantity_added(), '5')
        self.driver.get_screenshot_as_file('addtocart_screenshot.png')
        print('El precio de los producto es: '+self.added_product.return_price_products())
        print('El costo del envío es de: '+self.added_product.return_shipping_price())
        print('El precio total es de: '+self.added_product.return_total_price())
        print('El producto que usted desea comprar se denomina: '+self.added_product.return_product_name())
        print('fin caso 1')

    #@unittest.skip('no quiero que corra el test2')
    def test_casp_2(self):
        self.pageMain.click_dresses()
        self.pageDresses.view_list()
        self.pageDresses.add_printed_orange_dress_to_cart()
        print('El precio de los producto es: '+self.added_product.return_price_products())
        print('El costo del envío es de: '+self.added_product.return_shipping_price())
        print('El precio total es de: '+self.added_product.return_total_price())
        print('El producto que usted desea comprar se denomina: '+self.added_product.return_product_name())
        print('fin caso 2')

    def tearDown(self):
        self.driver.close()
        self.driver.quit()
Пример #11
0
 def build(self):
     """
     Override the App class's initial build function.
     Here is where the UI functionality is called.
     :return: MainPage()
     """
     # print("Elevating...")
     # elevate()
     # print("Elevated.")
     return MainPage()
Пример #12
0
 def test_guest_can_go_to_login_page(self, browser):
     link = "http://selenium1py.pythonanywhere.com"
     page = MainPage(browser, link, 10)
     page.open()
     page.go_to_login_page()
     login_page = LoginPage(browser, browser.current_url)
     login_page.should_be_login_page()
def test_guest_can_go_to_login_page(browser):
    link = "http://selenium1py.pythonanywhere.com/"
    page = MainPage(
        browser, link
    )  # инициализируем Page Object, передаем в конструктор экземпляр драйвера и url адрес
    page.open()  # открываем страницу
    page.go_to_login_page(
    )  # выполняем метод страницы - переходим на страницу логина
Пример #14
0
    def test_auth_correct(self):
        """
        Тест-кейс "Проверка ввода верного логина и пароля в форме авторизации"
        Шаги:
        1.В поле "Электронная почта" вести почту зарегистрированную на onetwotrip
        2.В поле "Пароль" ввести верный пароль
        3.Нажать кнопку "Войти"
        Ожидание:
        Успешная авторизация (название кнопки личный кабинет заменяется на email адрес)
        """
        page_auth = PageLogin(self.driver)
        page_auth.auth_form.authorization("*****@*****.**", "040994alex")

        profile = MainPage(self.driver).top_panel.get_user_name()
        self.assertEqual(profile, "*****@*****.**")
Пример #15
0
    def test_auth_facebook(self):
        """
        Тест-кейс "Проверка ввода верного логина и пароля в форме авторизации"
        Шаги:
        1.Нажать на иконку Facebook
        2.В новом окне ввести логин и пароль от аккаунта Facebook
        3.Нажать кнопку "Войти"
        Ожидание:
        Успешная авторизация (название кнопки "личный кабинет" заменяется название профиля)
        """
        page_auth = PageLogin(self.driver)
        page_auth.auth_form.auth_facebook("*****@*****.**", "040994alex")

        profile = MainPage(self.driver).top_panel.get_user_name()
        self.assertEqual(profile, "Алексей Демин")
Пример #16
0
def test_guest_cant_see_product_in_cart_opened_from_main_page(browser):
    """
    Гость открывает главную страницу 
    Переходит в корзину по кнопке в шапке сайта
    Ожидаем, что в корзине нет товаров
    Ожидаем, что есть текст о том что корзина пуста 
    """
    link = "http://selenium1py.pythonanywhere.com"
    main_page = MainPage(browser, link)
    main_page.open()
    main_page.click_go_to_basket()
    cart_page = CartPage(browser, browser.current_url)
    cart_page.should_not_be_goods_in_cart()
    cart_page.should_be_text_basket_is_empty()
def main():
    root = Tk()
    root.title("This is Python Project 2k18")

    content = MainPage(root)
    content.grid(column=0, row=0, sticky=(N, S, E, W))

    root.columnconfigure(0, weight=1)  # set the window to fill up empty spaces (width)
    root.rowconfigure(0, weight=1)  # set the window to fill up empty spaces (height)
    content.columnconfigure(0, weight=1)
    root.update()  # render the ui

    def content_rendered(e):
        """
        Update the root window to resize to fit the render content
        :param e: event object
        :return: None
        """
        root.minsize(e.width, e.height)

    content.bind('<Configure>', content_rendered)  # when window size changes. E.g On render

    root.mainloop()
Пример #18
0
class TestAddMember:
    @pytest.mark.parametrize('name', ["火枪手"])
    def test_add_member(self, name):
        self.main = MainPage()
        # self.main.goto_add_member().add_member(name).get_list()
        self.main.goto_add_member().add_member(name)
        # assert name in res

    @pytest.mark.parametrize('name', ["研发部"])
    def test_add_party(self, name):
        # 添加部门
        self.main = MainPage()
        self.main.goto_contact().add_party(name)

    def test_address_book(self):
        # 导入通讯录
        self.main = MainPage()
        self.main.goto_address_book().add_address_book()
Пример #19
0
def run(ctrl_socket, child_pid, recv_queue, send_queue):
    # 把myconnection传给handler进行相关的登录操作
    # 创建客户端请求对象
    global _ctrl_socket
    _ctrl_socket = ctrl_socket
    c_ftp = MyFtp_Client(_ctrl_socket, recv_queue)
    #    界面
    login_page = Login_Page()
    login_handler = Login_handler(login_page)
    login_handler.bind(comment_handler, c_ftp)
    login_page.register_handler(login_handler)
    login_handler.setup(child_pid, send_queue)
    login_page.run()
    main_page = MainPage()
    global main_handler
    main_handler = Main_handler(main_page)
    c_ftp.set_view_handler(main_handler)
    main_handler.bind(comment_handler, c_ftp)
    main_page.register_handler(main_handler)
    #设置父进程监听子进程信号
    signal.signal(40, main_handler.display_chat)

    main_handler.setup(child_pid, send_queue)
    main_page.run()
Пример #20
0
def test_change_language():
    browser = webdriver.Chrome()
    link = "https://coinmarketcap.com/"
    page = MainPage(browser, link)
    page.open()
    page.change_size(1920, 1080)
    for key in page.page_titles_order:
        time.sleep(3)
        page.go_to_desktop_language_panel()
        page.choose_desktop_language(key)
        page.title_has_right_language(key)
    page.change_size(800, 1024)
    for key in page.page_titles_order:
        time.sleep(3)
        page.go_to_mobile_side_bar()
        page.go_to_mobile_language_panel()
        page.choose_mobile_language(key)
        page.title_has_right_language(key)
    page.quit_browser()
Пример #21
0
 def clk(self):
     from main_page import MainPage
     self.giris = MainPage()
     self.giris.show()
     self.close()
Пример #22
0
 def test_address_book(self):
     # 导入通讯录
     self.main = MainPage()
     self.main.goto_address_book().add_address_book()
Пример #23
0
from Tkinter import *
from main_page import MainPage

"""
Resources:
http://effbot.org/tkinterbook/tkinter-events-and-bindings.htm
"""

root = Tk()
root.title("This is Python Project 2k18")

content = MainPage(root)
content.grid(column=0, row=0, sticky=(N, S, E, W))

root.columnconfigure(0, weight=1)  # set the window to fill up empty spaces (width)
root.rowconfigure(0, weight=1)  # set the window to fill up empty spaces (height)
content.columnconfigure(0, weight=1)
root.update()  # render the ui


def content_rendered(e):
    root.minsize(e.width, e.height)  # set the minimum size of the window to content size


content.bind('<Configure>', content_rendered)  # when window size changes. E.g On render

root.mainloop()
Пример #24
0
 def test_add_member(self, name):
     self.main = MainPage()
     # self.main.goto_add_member().add_member(name).get_list()
     self.main.goto_add_member().add_member(name)
Пример #25
0
 def test_add_party(self, name):
     # 添加部门
     self.main = MainPage()
     self.main.goto_contact().add_party(name)
Пример #26
0
def test_quest_can_go_to_login_page(browser):
    link = "http://selenium1py.pythonanywhere.com/"
    page = MainPage(browser, link)
    page.open()
    page.go_to_login_page()
Пример #27
0
def test_guest_should_see_login_link(browser):
    link = "http://selenium1py.pythonanywhere.com/catalogue/the-shellcoders-handbook_209?promo=midsummer"
    page = MainPage(browser, link)
    page.open()
    page.should_be_login_link()
Пример #28
0
def test_search(driver):
    p = MainPage(driver)
    p.accept_GDPR()
    p.search("Anton Mishin")
Пример #29
0
 def test_guest_should_see_login_link(self, browser):
     link = "http://selenium1py.pythonanywhere.com/en-gb/catalogue/the-city-and-the-stars_95/"
     page = MainPage(browser, link)
     page.open()
     page.should_be_login_link()
Пример #30
0
def test_add_and_remove_products(driver):
    main_page = MainPage(driver)
    product_page = ProductPage(driver)
    cart_page = CartPage(driver)
    put_products_into_cart(main_page, product_page)
    remove_products_from_cart(main_page, cart_page)