Пример #1
0
    def check_sort_by_service(self):
        """Сортировка по услуге"""

        gb_tool = GBtool(self.driver)
        service = self.driver.find_elements_by_css_selector(
            Locators.GM_CH[1])[2]
        name = 'Панель выбора суслуги'

        gb_tool.select_a_game('All games')
        z = gb_tool.is_active(service, name)
        assert_equal(z, 0, 'Сценарий неверен')
        gb_tool.select_a_game('World of Warcraft')
        z = gb_tool.is_active(service, name)
        assert_equal(z, 1, 'Сценарий неверен')

        game_list = [
            'World of Warcraft', 'Counter-Strike', 'Overwatch', 'Dota 2',
            'League of Legends'
        ]
        i = 0
        while i < len(game_list):

            self.service_check(game_list[i])
            print('Услуги ' + game_list[i] + ' сошлись')
            i += 1
Пример #2
0
    def service_check(self, name):
        """Проверка строк"""

        gb_tool = GBtool(self.driver)
        service = self.driver.find_elements_by_css_selector(
            Locators.GAME_CHOOSER[1])[2]
        dpdwn = self.driver.find_elements_by_css_selector(
            Locators.DROP_DOWN[1])[2]

        service_dict = {
            'World of Warcraft': [
                'All services', 'Powerleveling', 'PVP', 'Dungeons', 'Raids',
                'Mounts', 'Glories', 'Coaching', 'Other services'
            ],
            'Counter-Strike': [
                'All services', 'Calibration', 'Rank boost', 'Coaching',
                'Other services'
            ],
            'Overwatch': [
                'All services', 'Skill rating boost', 'Win boost',
                'Placement matches', 'LVL boost', 'Coaching', 'Other services'
            ],
            'Dota 2': [
                'All services', 'Boost solo mmr', 'Calibration',
                'Boost party mmr', 'Low priority', 'Coaching', 'Other services'
            ],
            'League of Legends': [
                'All services', 'Division boost', 'Win boost', 'Calibration',
                'Coaching', 'Other services'
            ]
        }

        gb_tool.select_a_game(name)
        i = 0
        service.click()

        while i < len(service_dict[name]):

            row = dpdwn.find_elements_by_css_selector(
                Locators.CHOOSER_ITEM[1])[i]
            assert_equal(row.text, service_dict[name][i])
            i += 1
        service.click()
Пример #3
0
    def check_sort_by_service(self):
        """Проверяет сортировку по услуге"""


        gb_tool = GBtool(self.driver)
        gb_tool.select_a_game('World of Warcraft')
        gb_tool.select_a_service()


        i = 0
        while i < 20:
            ordritm = self.driver.find_elements(*Locators.ORDRITM)[i]
            name = ordritm.find_element(*Locators.NAME)
            name = name.text
            name = name[18:31]
            assert_equal(name, 'Powerleveling', 'не сошлось')
            print('Запись %d из 20 отсортирвоана по улсуге ' % (i+1) + name)
            i += 1

        gb_tool.select_a_service()
Пример #4
0
    def check_game(self):
        """Проверка сортировки по игре"""

        gb_tool = GBtool(self.driver)

        time.sleep(1)
        gm = 'World of Warcraft'
        gb_tool.select_a_game(gm)
        time.sleep(2)
        ttl = self.driver.find_element(*Locators.TITLE)
        ttl = ttl.text
        count = int(re.findall(r'\d+', ttl)[0])
        etalon = 'https://dev.gamersbay.com/images/games/1/icons/icon.svg'

        i = 0
        while i < count:
            time.sleep(2)
            order = self.driver.find_elements(*Locators.ORDER)[i]
            game_icon = order.find_element(*Locators.GAME_ICON)
            icon = game_icon.get_attribute('src')
            assert_equal(etalon, icon, 'не сошлось')
            print('Строка %d из %d соответсвует сортировке по ' %
                  ((i + 1), count) + gm)
            i += 1