Exemple #1
0
    def test_duplicate_comment_return_save_without_number(self):
        # clear field number
        comment_number = self.browser.find_element_by_id('Number')
        comment_number.clear()

        # save comment and return
        click_save_and_return(self.browser)

        # check that comment was created
        comments = find_all_comments(self.browser)
        self.assertIn(ExpectedResults.duplicate_button_without_number, comments)
Exemple #2
0
    def test_duplicate_comment_return_save_with_number(self):
        # enter number
        number = ExpectedResults.duplicate_button_with_number[0]
        enter_number(self.browser, number)

        # save comment and return
        click_save_and_return(self.browser)

        # check that comment was created
        comments = find_all_comments(self.browser)
        self.assertIn(ExpectedResults.duplicate_button_with_number, comments)
Exemple #3
0
    def test_edit_comment_return_save_without_number(self):
        comment_name = ExpectedResults.edit_button_without_number[1]
        # enter comment's name
        comment_text_write(self.browser, comment_name)

        # save comment and return
        click_save_and_return(self.browser)

        # check that comment was created
        comments = find_all_comments(self.browser)
        self.assertIn(ExpectedResults.edit_button_without_number, comments)
Exemple #4
0
    def test_duplicate_comment_save_with_number(self):
        number = ExpectedResults.duplicate_button_with_number[0]
        # enter number
        enter_number(self.browser, number)

        # save comment
        save_button_click(self.browser)

        # return to the row of comments
        click_return_button(self.browser)

        # find created comment
        comments = find_all_comments(self.browser)
        self.assertIn(ExpectedResults.duplicate_button_with_number, comments)
Exemple #5
0
    def test_duplicate_without_number(self):
        # clear field number
        comment_number = self.browser.find_element_by_id('Number')
        comment_number.clear()

        # save comment
        save_button_click(self.browser)

        # return to the row of comments
        click_return_button(self.browser)

        # find created comment
        comments = find_all_comments(self.browser)
        self.assertIn(ExpectedResults.duplicate_button_without_number, comments)
Exemple #6
0
    def test_new_comment_length_50_text(self):
        comment_name = ExpectedResults.new_button_length_50[1]
        # enter comment's name
        comment_text_write(self.browser, comment_name)

        # chose all category
        click_all_category(self.browser)

        # save comment and return
        click_save_and_return(self.browser)

        # check that comment was created
        comments = find_all_comments(self.browser)
        self.assertIn(ExpectedResults.new_button_length_50, comments)
Exemple #7
0
    def test_edit_comment_return_save_with_number(self):
        comment_name = ExpectedResults.edit_button_with_number[1]
        number = ExpectedResults.edit_button_with_number[0]
        # enter comment's name
        comment_text_write(self.browser, comment_name)
        # enter number
        comment_number = self.browser.find_element_by_id('Number')
        comment_number.send_keys(number)

        # save comment and return
        click_save_and_return(self.browser)

        # check that comment was created
        comments = find_all_comments(self.browser)
        self.assertIn(ExpectedResults.edit_button_with_number, comments)
Exemple #8
0
    def test_delete_one_comment(self):
        expected_result = ['', 'Comment Text 0', '', 'Cat0']

        # chose comment to delete
        choose_first_comment(self.browser)

        # press delete button
        click_delete_button(self.browser)

        # apply delete
        yes_button = self.browser.find_element_by_xpath('/html/body/div[2]/div[3]/div/button[1]')
        yes_button.click()

        # find created comment
        comments = find_all_comments(self.browser)
        self.assertNotIn(expected_result, comments)
Exemple #9
0
    def test_new_comment_save_without_number(self):
        comment_name = ExpectedResults.new_button_without_number[1]
        # enter comment's name
        comment_text_write(self.browser, comment_name)

        # chose all category
        click_all_category(self.browser)

        # save comment
        save_button_click(self.browser)

        # return to the row of comments
        click_return_button(self.browser)

        # find created comment
        comments = find_all_comments(self.browser)
        self.assertIn(ExpectedResults.new_button_without_number, comments)
Exemple #10
0
    def test_edit_comment_save_with_number(self):
        comment_name = ExpectedResults.edit_button_with_number[1]
        number = ExpectedResults.edit_button_with_number[0]
        # enter comment's name
        comment_text_write(self.browser, comment_name)
        # enter number
        comment_number = self.browser.find_element_by_id('Number')
        comment_number.send_keys(number)

        # save comment
        save_button_click(self.browser)

        # return to the row of comments
        click_return_button(self.browser)

        # find created comment
        comments = find_all_comments(self.browser)
        self.assertIn(ExpectedResults.edit_button_with_number, comments)
Exemple #11
0
    def test_new_comment_number_999(self):
        comment_name = ExpectedResults.new_button_number_999[1]
        number = ExpectedResults.new_button_number_999[0]
        # enter comment's name
        comment_text_write(self.browser, comment_name)
        # enter number
        comment_number = self.browser.find_element_by_id('Number')
        comment_number.send_keys(number)

        # chose all category
        click_all_category(self.browser)

        # save comment and return
        click_save_and_return(self.browser)

        # check that comment was created
        comments = find_all_comments(self.browser)
        self.assertIn(ExpectedResults.new_button_number_999, comments)