def __init__(self, *args, **kwargs):
     super(CreateBotFeatureTests, self).__init__(*args, **kwargs)
     self.__data = DataGenerateUtils()
     self.__login = LoginPage()
     self.__create_bot = CreateBotPage()
     self.__register = RegisterPage()
     self.__appearance = AppearancePage()
     self.__create_bot_validation = CreateBotValidation()
     self.__drop_down_list = DropDownList()
     self.__data_set = DataUtils()
     self.valid_email = self.__data.create_email()
     self.valid_username = self.__data.create_name()
     self.valid_password = self.__data.create_password()
     self.faq_url = YAML_CONFIG.get("stub_faq_url")
 def __init__(self, *args, **kwargs):
     super(KnowledgeFeatureTests, self).__init__(*args, **kwargs)
     self.__data = DataGenerateUtils()
     self.__login = LoginPage()
     self.__create_bot = CreateBotPage()
     self.__register = RegisterPage()
     self.__appearance = AppearancePage()
     self.__knowledge_validation = KnowledgeValidation()
     self.__dashboard = DashboardPage()
     self.__knowledge = KnowledgePage()
     self.__data_set = DataUtils()
     self.valid_email = self.__data.create_email()
     self.valid_username = self.__data.create_name()
     self.valid_password = self.__data.create_password()
     self.faq_url = YAML_CONFIG.get("stub_manual_faq_url")
     self.invalid_faq = YAML_CONFIG.get("stub_invalid_faq_url")
예제 #3
0
 def __init__(self, *args, **kwargs):
     super(ChangePasswordTests, self).__init__(*args, **kwargs)
     self.__data = DataGenerateUtils()
     self.__login = LoginPage()
     self.__create_bot = CreateBotPage()
     self.__register = RegisterPage()
     self.__dashboard = DashboardPage()
     self.__appearance = AppearancePage()
     self.__create_bot_validation = CreateBotValidation()
     self.__drop_down_list = DropDownList()
     self.__change_password = ChangePasswordPage()
     self.__data_set = DataUtils()
     self.valid_email = self.__data.create_email()
     self.valid_username = self.__data.create_name()
     self.valid_password = self.__data.create_password()
     self.bot_name = "Test"
     self.invalid_faq = "google.com"
예제 #4
0
 def __init__(self, *args, **kwargs):
     super(AppearanceTests, self).__init__(*args, **kwargs)
     self.__data = DataGenerateUtils()
     self.__login = LoginPage()
     self.__create_bot = CreateBotPage()
     self.__register = RegisterPage()
     self.__appearance = AppearancePage()
     self.__create_bot_validation = CreateBotValidation()
     self.__drop_down_list = DropDownList()
     self.__chat_box_simulator = ClientSimulator()
     self.__loader = LoaderComponent()
     self.__data_set = DataUtils()
     self.valid_email = self.__data.create_email()
     self.valid_username = self.__data.create_name()
     self.valid_password = self.__data.create_password()
     self.bot_name = self.__data.create_uuid_number()
     self.faq_url = YAML_CONFIG.get("stub_faq_url")
 def __init__(self, *args, **kwargs):
     super(TestConversationDuration, self).__init__(*args, **kwargs)
     self.__data = DataGenerateUtils()
     self.__create_bot = CreateBotPage()
     self.__register = RegisterPage()
     self.__appearance = AppearancePage()
     self.__integration = IntegrationPage()
     self.__create_bot_validation = CreateBotValidation()
     self.__html_file = HTMLFileUtils()
     self.__client_simulator = ClientSimulator()
     self.__conversation = ConversationPage()
     self.valid_email = self.__data.create_email()
     self.valid_username = self.__data.create_name()
     self.valid_password = self.__data.create_password()
     self.bot_name = self.__data.create_uuid_number()
     self.invalid_faq = YAML_CONFIG.get("stub_invalid_faq_url")
     self.integrated_page_path = ""
     self.root_path = os.path.dirname(
         os.path.dirname(os.path.abspath(__file__)))
     self.file_path = os.path.normpath(
         os.path.join(self.root_path, 'TestGUI', 'index.html'))
예제 #6
0
 def __init__(self, *args, **kwargs):
     super(TestAdminPages, self).__init__(*args, **kwargs)
     self.__data = DataGenerateUtils()
     self.__login = LoginPage()
     self.__create_bot = CreateBotPage()
     self.__register = RegisterPage()
     self.__dashboard = DashboardPage()
     self.__appearance = AppearancePage()
     self.__create_bot_validation = CreateBotValidation()
     self.__drop_down_list = DropDownList()
     self.__change_password = ChangePasswordPage()
     self.__knowledge = KnowledgePage()
     self.__data_set = DataUtils()
     self.__faq_knowledge_data_table_component = FaqKnowledgeDataTableComponent(
     )
     self.valid_email = self.__data.create_email()
     self.valid_username = self.__data.create_name()
     self.valid_password = self.__data.create_password()
     self.bot_name = "Test"
     self.invalid_faq = "google.com"
     self.eyes = Eyes()
     self.eyes.api_key = YAML_CONFIG.get("eyes_api_key")
     self.eyes.force_full_page_screenshot = True
     self.eyes.stitch_mode = StitchMode.CSS
class CreateBotFeatureTests(BaseTest):
    def __init__(self, *args, **kwargs):
        super(CreateBotFeatureTests, self).__init__(*args, **kwargs)
        self.__data = DataGenerateUtils()
        self.__login = LoginPage()
        self.__create_bot = CreateBotPage()
        self.__register = RegisterPage()
        self.__appearance = AppearancePage()
        self.__create_bot_validation = CreateBotValidation()
        self.__drop_down_list = DropDownList()
        self.__data_set = DataUtils()
        self.valid_email = self.__data.create_email()
        self.valid_username = self.__data.create_name()
        self.valid_password = self.__data.create_password()
        self.faq_url = YAML_CONFIG.get("stub_faq_url")

    def setUp(self):
        super().setUp()
        self.__register.open_register_page()
        self.__register.login_with_new_account(self.valid_username,
                                               self.valid_email,
                                               self.valid_password)
        self.__create_bot.wait_for_create_page()

    def test_create_bot_unsuccessfully_with_invalid_inputs(self):
        bot_infos = self.__data_set.get_data(INVALID_BOT_INFO_DATA)
        expected_errors = [bot_info[2] for bot_info in bot_infos[1:]]
        actual_errors = []
        for bot_info in bot_infos[1:]:
            bot_name = bot_info[0]
            bot_url = bot_info[1]
            self.__create_bot.open_create_page()
            self.__create_bot.create_bot_with_data(bot_name, bot_url)
            actual_errors.append(
                self.__create_bot.lbl_error_message.get_element_text())
        self.assertEqual(expected_errors, actual_errors)

    @unittest.skip("Update logic with ignore for offline network")
    def test_create_bot_unsuccessfully_with_offline_connection(self):
        DriverFactory.get_driver().core_driver.set_network_conditions(
            offline=True, latency=5, throughput=500 * 1024)
        self.__create_bot.open_create_page()
        self.__create_bot.create_bot_with_data('Random Name',
                                               'www.katalon.com')
        self.assertEqual(
            self.__create_bot.lbl_error_message.get_element_text(),
            'Failed to fetch')

    def test_create_bot_successfully(self):
        bot_name = "Bot_name"
        website = self.faq_url
        self.__create_bot.open_create_page()
        self.__create_bot.create_bot_with_data(bot_name, website)
        print(self.__appearance.get_header_title_text())
        print(self.__appearance.get_expected_title(bot_name=bot_name))
        assert self.__appearance.get_header_title_text(
        ) == self.__appearance.get_expected_title(bot_name=bot_name)
        self.__create_bot_validation.wait_and_verify_notification_message()
        self.__create_bot_validation.should_init_correct_total_faq_questions(
            self.valid_email, bot_name)
        self.__create_bot_validation.should_init_correct_question_data()

    def test_create_bot_with_existed_bot_name_successfully(self):
        new_bot_name = "Bot_name"
        new_bot_website = "www.google.com"
        # Create a bot
        self.test_create_bot_successfully()
        # Open create bot page again
        self.__create_bot.open_create_page()
        self.__create_bot.create_bot_with_data(new_bot_name, new_bot_website)
        # Verify that new bot name is displayed
        self.__create_bot_validation.new_bot_should_be_current_selected_bot(
            new_bot_name, new_bot_website)
        self.__create_bot_validation.wait_and_verify_notification_message()
        self.__create_bot_validation.should_init_correct_total_faq_questions(
            self.valid_email, new_bot_name)
        self.__create_bot_validation.should_init_correct_question_data()

    def test_create_bot_with_existed_website_successfully(self):
        new_bot_name = "Another name"
        new_bot_website = self.faq_url
        # Create a bot
        self.test_create_bot_successfully()
        # Open create bot page again
        self.__create_bot.open_create_page()
        self.__create_bot.create_bot_with_data(new_bot_name, new_bot_website)
        # Verify that new bot name is displayed
        self.__create_bot_validation.new_bot_should_be_current_selected_bot(
            new_bot_name, new_bot_website)
        self.__create_bot_validation.wait_and_verify_notification_message()
        self.__create_bot_validation.should_init_correct_total_faq_questions(
            self.valid_email, new_bot_name)
        self.__create_bot_validation.should_init_correct_question_data()