Exemplo n.º 1
0
 def test_login(self):
     home = MainPage()
     # Login to Application
     home.login(self.email, self.password)
     # Verify Title of the page
     Assert.equal(home.page_title, "GroupDocs Dashboard")
     home.close_browser()
Exemplo n.º 2
0
    def test_2_upload_doc_questionnaire(self):
        home = MainPage()
        home.login(self.email, self.password)
        home.click_apps_menu()
        home.click_item("Assembly")
        file_name = self.doc_folder + "fw4.pdf"
        home.upload_doc(file_name)
        fields = home.input_fields
        # Fill all fields
        print len(fields)
        for i in range(len(fields)):
            home.enter_question_for_field(fields[i], "Question Number %s" % i)
        home.save_template("TestTemplate", "TestDescription")
        # Goto My Files
        home.back_to_home_folder()
        # Open Templates folder
        home.click_to_view("templates")
        home.elements[0].click_dropdown()
        home.elements[0].click_item()
        home._wait_for_results_refresh()
        fields = home.input_fields
        for i in range(len(fields)):
            Assert.contains("Question Number %s" % i, home.question_text)
            if not i == len(fields) - 1:
                home.click_next_tag()
        home.back_to_home_folder()

        # Cleaning up after our tests
        home.clear_test_data("all")
        home.close_browser()
Exemplo n.º 3
0
    def test_1_add_docs_and_folders(self):
        home = MainPage()
        home.login(self.email, self.password)

        # Upload 5 documents from /docs folder
        for i in range(6):
            i += 1
            file_name = self.doc_folder + "test%s.docx" % i
            home.upload_doc(file_name)
        # Create Folder Test1 and Drag 2 Documents inside
        home.create_folder("Test1")
        for i in range(2):
            i += 1
            home.drag_doc_to_folder("test%s.docx" % i, "Test1")
        # Create Folder Test2 and Drag 3 Next Documents inside
        home.create_folder("Test2")
        for i in range(3):
            i += 3
            home.drag_doc_to_folder("test%s.docx" % i, "Test2")

        # Go inside created folders and verify quantity of elements
        home.click_to_view("Test1")
        # 2 Docs Inside
        Assert.equal(home.list_elements_count, 2)
        home.back_to_home_folder()
        home.click_to_view("Test2")
        # 3 Docs Inside
        Assert.equal(home.list_elements_count, 3)
        home.back_to_home_folder()

        # Cleaning up after our tests
        home.clear_test_data("all")
        home.close_browser()