class TestLoginMode(unittest.TestCase): """ 登录状态模块 """ def setUp(self): self.browser = Browser().browser() self.common = Common(self.browser) self.common.get_lobby() self.common.login() self.daf = DirAndFiles() def tearDown(self): self.browser.quit() # # # ------------------------------------------------------------------------ 横屏模式 ------------------------------------------------------------------------ # # def test_login(self): """ 横屏登录状态 """ sleep(1) lobby_chips = self.common.lobby_chips()["lobby_chips"] self.common.switch_page() self.common.find_game() self.common.switch_game_window() self.common.loading_pass() sleep(1) has_money_title = self.common.info_bar_view_has_money_title() has_money_label = self.common.info_bar_view_has_money_label() game_record = self.common.game_record_btn_enable() game_record_touchable = self.common.game_record_btn_touchable() try: self.assertEqual(has_money_title, "我的余额", "横屏登录下导航栏余额标题错误!") self.assertEqual(has_money_label, lobby_chips, "横屏登录下导航栏余额数值与大厅的不一致!") self.assertEqual(game_record, True, "横屏登录选项菜单不会显示游戏记录按钮!") self.assertEqual(game_record_touchable, True, "横屏登录游戏记录按钮不可点击!") except AssertionError: self.daf.get_screenshot(self.browser) raise sleep(1) self.common.set_chips_to_zero() self.browser.refresh() self.common.loading_pass() sleep(1) self.common.start_btn_click() sleep(1) slot_status = self.common.slot_machine_rolling() setting_btn = self.common.setting_btn_visible() auto_game_btn = self.common.auto_game_btn_visible() start_btn = self.common.start_btn_status() lack_of_money_view = self.common.lack_of_money_view_showing() mask_view = self.common.mask_view_showing() lack_of_money_title = self.common.lack_of_money_title() lack_of_money_ok_btn = self.common.lack_of_money_ok_btn_visible() lack_of_money_ok_btn_title = self.common.lack_of_money_ok_btn_title() lack_of_money_ok_btn_touchable = self.common.lack_of_money_ok_btn_touchable( ) try: self.assertEqual(slot_status, False, "横屏余额为0时点击旋转按钮,滚轴会滚动!") self.assertEqual(setting_btn, True, "横屏余额为0时点击旋转按钮,线数线注设置按钮消失!") self.assertEqual(auto_game_btn, True, "横屏余额为0时点击旋转按钮,自动游戏按钮消失!") self.assertEqual(start_btn, "stopped", "横屏余额为0时点击旋转按钮,旋转按钮不是停止状态!") self.assertEqual(lack_of_money_view, True, "横屏余额为0时点击旋转按钮,不会弹出余额不足窗口!") self.assertEqual(mask_view, True, "横屏余额为0时点击旋转按钮,不会显示灰色蒙板!") self.assertEqual(lack_of_money_title, "您的额度不足,无法完成您所请求的下注", "横屏弹出余额不足窗口,提示文字错误!") self.assertEqual(lack_of_money_ok_btn, True, "横屏弹出余额不足窗口,不会显示确定按钮!") self.assertEqual(lack_of_money_ok_btn_title, "确定", "横屏弹出余额不足窗口,确定按钮文字错误!") self.assertEqual(lack_of_money_ok_btn_touchable, True, "横屏弹出余额不足窗口,确定按钮不可点击!") except AssertionError: self.daf.get_screenshot(self.browser) raise self.common.mask_view_click() sleep(1) lack_of_money_view = self.common.lack_of_money_view_showing() mask_view = self.common.mask_view_showing() try: self.assertEqual(lack_of_money_view, True, "横屏弹出余额不足窗口时,点击灰色蒙板,窗口会消失!") self.assertEqual(mask_view, True, "横屏弹出余额不足窗口时,点击灰色蒙板,灰色蒙板会消失!") except AssertionError: self.daf.get_screenshot(self.browser) raise self.common.lack_of_money_ok_btn_click() sleep(1) lack_of_money_view = self.common.lack_of_money_view_dispear() mask_view = self.common.mask_view_showing() try: self.assertEqual(lack_of_money_view, None, "横屏弹出余额不足窗口时,点击确定按钮,窗口不会消失!") self.assertEqual(mask_view, False, "横屏弹出余额不足窗口时,点击确定按钮,灰色蒙板不会消失!") except AssertionError: self.daf.get_screenshot(self.browser) raise # # # ------------------------------------------------------------------------ 竖屏模式 ------------------------------------------------------------------------ # # def test_login_portrait(self): """ 竖屏登录状态 """ sleep(1) lobby_chips = self.common.lobby_chips()["lobby_chips"] self.common.switch_page() self.common.find_game() self.common.switch_game_window() self.common.portrait() self.common.loading_pass() sleep(1) has_money_title = self.common.info_bar_view_has_money_title() has_money_label = self.common.info_bar_view_has_money_label() game_record = self.common.game_record_btn_enable() game_record_touchable = self.common.game_record_btn_touchable() try: self.assertEqual(has_money_title, "我的余额", "竖屏登录下导航栏余额标题错误!") self.assertEqual(has_money_label, lobby_chips, "竖屏登录下导航栏余额数值与大厅的不一致!") self.assertEqual(game_record, True, "竖屏登录选项菜单不会显示游戏记录按钮!") self.assertEqual(game_record_touchable, True, "竖屏登录游戏记录按钮不可点击!") except AssertionError: self.daf.get_screenshot(self.browser) raise sleep(1) self.common.set_chips_to_zero() self.browser.refresh() self.common.loading_pass() sleep(1) self.common.start_btn_click() sleep(1) slot_status = self.common.slot_machine_rolling() setting_btn = self.common.setting_btn_visible() auto_game_btn = self.common.auto_game_btn_visible() start_btn = self.common.start_btn_status() lack_of_money_view = self.common.lack_of_money_view_showing() mask_view = self.common.mask_view_showing() lack_of_money_title = self.common.lack_of_money_title() lack_of_money_ok_btn = self.common.lack_of_money_ok_btn_visible() lack_of_money_ok_btn_title = self.common.lack_of_money_ok_btn_title() lack_of_money_ok_btn_touchable = self.common.lack_of_money_ok_btn_touchable( ) try: self.assertEqual(slot_status, False, "竖屏余额为0时点击旋转按钮,滚轴会滚动!") self.assertEqual(setting_btn, True, "竖屏余额为0时点击旋转按钮,线数线注设置按钮消失!") self.assertEqual(auto_game_btn, True, "竖屏余额为0时点击旋转按钮,自动游戏按钮消失!") self.assertEqual(start_btn, "stopped", "竖屏余额为0时点击旋转按钮,旋转按钮不是停止状态!") self.assertEqual(lack_of_money_view, True, "竖屏余额为0时点击旋转按钮,不会弹出余额不足窗口!") self.assertEqual(mask_view, True, "竖屏余额为0时点击旋转按钮,不会显示灰色蒙板!") self.assertEqual(lack_of_money_title, "您的额度不足,无法完成您所请求的下注", "竖屏弹出余额不足窗口,提示文字错误!") self.assertEqual(lack_of_money_ok_btn, True, "竖屏弹出余额不足窗口,不会显示确定按钮!") self.assertEqual(lack_of_money_ok_btn_title, "确定", "竖屏弹出余额不足窗口,确定按钮文字错误!") self.assertEqual(lack_of_money_ok_btn_touchable, True, "竖屏弹出余额不足窗口,确定按钮不可点击!") except AssertionError: self.daf.get_screenshot(self.browser) raise self.common.mask_view_click() sleep(1) lack_of_money_view = self.common.lack_of_money_view_showing() mask_view = self.common.mask_view_showing() try: self.assertEqual(lack_of_money_view, True, "竖屏弹出余额不足窗口时,点击灰色蒙板,窗口会消失!") self.assertEqual(mask_view, True, "竖屏弹出余额不足窗口时,点击灰色蒙板,灰色蒙板会消失!") except AssertionError: self.daf.get_screenshot(self.browser) raise self.common.lack_of_money_ok_btn_click() sleep(1) lack_of_money_view = self.common.lack_of_money_view_dispear() mask_view = self.common.mask_view_showing() try: self.assertEqual(lack_of_money_view, None, "竖屏弹出余额不足窗口时,点击确定按钮,窗口不会消失!") self.assertEqual(mask_view, False, "竖屏弹出余额不足窗口时,点击确定按钮,灰色蒙板不会消失!") except AssertionError: self.daf.get_screenshot(self.browser) raise # # # ------------------------------------------------------------------------ 横竖屏模式 ------------------------------------------------------------------------ # # def test_login_switch_screen(self): """ 横竖屏登录状态 """ sleep(1) lobby_chips = self.common.lobby_chips()["lobby_chips"] self.common.switch_page() self.common.find_game() self.common.switch_game_window() self.common.portrait() self.common.loading_pass() sleep(1) self.common.landscape() sleep(0.5) self.common.portrait() sleep(0.5) has_money_title = self.common.info_bar_view_has_money_title() has_money_label = self.common.info_bar_view_has_money_label() game_record = self.common.game_record_btn_enable() game_record_touchable = self.common.game_record_btn_touchable() try: self.assertEqual(has_money_title, "我的余额", "登录后横竖屏切换,下导航栏余额标题错误!") self.assertEqual(has_money_label, lobby_chips, "登录后横竖屏切换,下导航栏余额数值与大厅的不一致!") self.assertEqual(game_record, True, "登录后横竖屏切换,选项菜单不会显示游戏记录按钮!") self.assertEqual(game_record_touchable, True, "登录后横竖屏切换,游戏记录按钮不可点击!") except AssertionError: self.daf.get_screenshot(self.browser) raise sleep(1) self.common.set_chips_to_zero() self.browser.refresh() self.common.loading_pass() sleep(1) self.common.start_btn_click() sleep(1) self.common.landscape() sleep(0.5) self.common.portrait() sleep(0.5) slot_status = self.common.slot_machine_rolling() setting_btn = self.common.setting_btn_visible() auto_game_btn = self.common.auto_game_btn_visible() start_btn = self.common.start_btn_status() lack_of_money_view = self.common.lack_of_money_view_showing() mask_view = self.common.mask_view_showing() lack_of_money_title = self.common.lack_of_money_title() lack_of_money_ok_btn = self.common.lack_of_money_ok_btn_visible() lack_of_money_ok_btn_title = self.common.lack_of_money_ok_btn_title() lack_of_money_ok_btn_touchable = self.common.lack_of_money_ok_btn_touchable( ) try: self.assertEqual(slot_status, False, "登录后余额为0时点击旋转按钮,横竖屏切换,滚轴会滚动!") self.assertEqual(setting_btn, True, "登录后余额为0时点击旋转按钮,横竖屏切换,线数线注设置按钮消失!") self.assertEqual(auto_game_btn, True, "登录后余额为0时点击旋转按钮,横竖屏切换,自动游戏按钮消失!") self.assertEqual(start_btn, "stopped", "登录后余额为0时点击旋转按钮,横竖屏切换,旋转按钮不是停止状态!") self.assertEqual(lack_of_money_view, True, "登录后余额为0时点击旋转按钮,横竖屏切换,不会弹出余额不足窗口!") self.assertEqual(mask_view, True, "登录后余额为0时点击旋转按钮,横竖屏切换,不会显示灰色蒙板!") self.assertEqual(lack_of_money_title, "您的额度不足,无法完成您所请求的下注", "登录后弹出余额不足窗口,横竖屏切换,提示文字错误!") self.assertEqual(lack_of_money_ok_btn, True, "登录后弹出余额不足窗口,横竖屏切换,不会显示确定按钮!") self.assertEqual(lack_of_money_ok_btn_title, "确定", "登录后弹出余额不足窗口,横竖屏切换,确定按钮文字错误!") self.assertEqual(lack_of_money_ok_btn_touchable, True, "登录后弹出余额不足窗口,横竖屏切换,确定按钮不可点击!") except AssertionError: self.daf.get_screenshot(self.browser) raise self.common.mask_view_click() sleep(1) self.common.landscape() sleep(0.5) self.common.portrait() sleep(0.5) lack_of_money_view = self.common.lack_of_money_view_showing() mask_view = self.common.mask_view_showing() try: self.assertEqual(lack_of_money_view, True, "登录后弹出余额不足窗口时,点击灰色蒙板,横竖屏切换,窗口会消失!") self.assertEqual(mask_view, True, "登录后弹出余额不足窗口时,点击灰色蒙板,横竖屏切换,灰色蒙板会消失!") except AssertionError: self.daf.get_screenshot(self.browser) raise self.common.lack_of_money_ok_btn_click() sleep(1) self.common.landscape() sleep(0.5) self.common.portrait() sleep(0.5) lack_of_money_view = self.common.lack_of_money_view_dispear() mask_view = self.common.mask_view_showing() try: self.assertEqual(lack_of_money_view, None, "录后弹出余额不足窗口时,点击确定按钮,横竖屏切换,窗口不会消失!") self.assertEqual(mask_view, False, "录后弹出余额不足窗口时,点击确定按钮,横竖屏切换,灰色蒙板不会消失!") except AssertionError: self.daf.get_screenshot(self.browser) raise
class TestSpinBtn(unittest.TestCase): """ 旋转按钮模块 """ def setUp(self): self.browser = Browser().browser() self.common = Common(self.browser) self.common.start() self.daf = DirAndFiles() def tearDown(self): self.browser.quit() # # # ------------------------------------------------------------------------ 横屏模式 ------------------------------------------------------------------------ # # def test_start_btn(self): """ 横屏旋转按钮默认显示 """ self.common.loading_pass() sleep(3) visible = self.common.start_btn_visible() touchable = self.common.start_btn_touchable() status = self.common.start_btn_status() rolling = self.common.slot_machine_rolling() banner = self.common.info_bar_view_banner_tips_label() try: self.assertEqual(visible, True, "横屏进入游戏,旋转按钮默认不会显示!") self.assertEqual(touchable, True, "横屏进入游戏,旋转按钮默认不可点击!") self.assertEqual(status, "stopped", "横屏进入游戏,旋转按钮默认显示停止按钮!") self.assertEqual(rolling, False, "横屏进入游戏,滚轴默认处于滚动状态!") self.assertEqual(banner, "滑动转轴或按旋转", "横屏进入游戏,下导航栏默认的提示文字错误!") except AssertionError: self.daf.get_screenshot(self.browser) raise def test_start_btn_click(self): """ 横屏点击旋转按钮 """ self.common.loading_pass() sleep(1) self.common.start_btn_click() self.common.wait_for_rolling(15) slot_rolling = self.common.slot_machine_rolling() start_btn_status = self.common.start_btn_status() setting_btn = self.common.setting_btn_visible() auto_game_btn = self.common.auto_game_btn_visible() main_menu_expand = self.common.main_menu_expand() main_menu = self.common.main_menu_touchable() banner = self.common.info_bar_view_banner_tips_label() try: self.assertEqual(slot_rolling, True, "横屏点击旋转按钮,滚轴不会滚动!") self.assertEqual(start_btn_status, "playing", "横屏点击旋转按钮,旋转按钮不会变成停止按钮!") self.assertEqual(setting_btn, False, "横屏点击旋转按钮,线数线注设置按钮不会消失!") self.assertEqual(auto_game_btn, False, "横屏点击旋转按钮,自动游戏按钮不会消失!") self.assertEqual(main_menu_expand, "retractL", "横屏点击旋转按钮,左侧选项菜单不会折叠!") self.assertEqual(main_menu, False, "横屏点击旋转按钮,左侧选项菜单可以点击!") self.assertEqual(banner, "触摸转轴来提前停止", "横屏点击旋转按钮,下导航栏的提示文字错误!") except AssertionError: self.daf.get_screenshot(self.browser) raise self.common.wait_for_rolling_stop(15) game_status = self.common.get_game_current_status() coin = self.common.total_win() if game_status is None: if coin == 0: start_btn_status = self.common.start_btn_status() setting_btn = self.common.setting_btn_visible() auto_game_btn = self.common.auto_game_btn_visible() main_menu_expand = self.common.main_menu_expand() main_menu = self.common.main_menu_touchable() banner = self.common.info_bar_view_banner_tips_label() try: self.assertEqual(start_btn_status, "stopped", "横屏点击旋转按钮,等待滚轴停下后,停止按钮不会恢复成旋转按钮!") self.assertEqual(setting_btn, True, "横屏点击旋转按钮,等待滚轴停下后,线数线注设置按钮不会恢复显示!") self.assertEqual(auto_game_btn, True, "横屏点击旋转按钮,等待滚轴停下后,自动游戏按钮不会恢复显示!") self.assertEqual(main_menu_expand, "retractL", "横屏点击旋转按钮,等待滚轴停下后,左侧选项菜单不会折叠!") self.assertEqual(main_menu, True, "横屏点击旋转按钮,等待滚轴停下后,左侧选项菜单不会恢复可点击状态!") self.assertEqual(banner, "滑动转轴或按旋转", "横屏点击旋转按钮,等待滚轴停下后,下导航栏的提示文字错误!") except AssertionError: self.daf.get_screenshot(self.browser) raise else: start_btn_status = self.common.start_btn_status() setting_btn = self.common.setting_btn_visible() auto_game_btn = self.common.auto_game_btn_visible() main_menu_expand = self.common.main_menu_expand() main_menu = self.common.main_menu_touchable() banner = self.common.info_bar_view_banner_tips_label() locale.setlocale(locale.LC_ALL, "") coin = "奖金 ¥" + locale.format("%.2f", coin / 100, 1) try: self.assertEqual(start_btn_status, "stopped", "横屏点击旋转按钮,等待滚轴停下后,停止按钮不会恢复成旋转按钮!") self.assertEqual(setting_btn, True, "横屏点击旋转按钮,等待滚轴停下后,线数线注设置按钮不会恢复显示!") self.assertEqual(auto_game_btn, True, "横屏点击旋转按钮,等待滚轴停下后,自动游戏按钮不会恢复显示!") self.assertEqual(main_menu_expand, "retractL", "横屏点击旋转按钮,等待滚轴停下后,左侧选项菜单不会折叠!") self.assertEqual(main_menu, True, "横屏点击旋转按钮,等待滚轴停下后,左侧选项菜单不会恢复可点击状态!") self.assertEqual(banner, coin, "横屏点击旋转按钮,等待滚轴停下后,下导航栏提示文字错误!") except AssertionError: self.daf.get_screenshot(self.browser) raise else: if coin == 0: start_btn_status = self.common.start_btn_status() setting_btn = self.common.setting_btn_visible() auto_game_btn = self.common.auto_game_btn_visible() main_menu_expand = self.common.main_menu_expand() main_menu = self.common.main_menu_touchable() banner = self.common.info_bar_view_banner_tips_label() try: self.assertEqual(start_btn_status, "stopped", "横屏点击旋转按钮,等待滚轴停下后中了特殊玩法,停止按钮不会恢复成旋转按钮!") self.assertEqual(setting_btn, False, "横屏点击旋转按钮,等待滚轴停下后中了特殊玩法,线数线注设置按钮会恢复显示!") self.assertEqual(auto_game_btn, False, "横屏点击旋转按钮,等待滚轴停下后中了特殊玩法,自动游戏按钮会恢复显示!") self.assertEqual(main_menu_expand, "retractL", "横屏点击旋转按钮,等待滚轴停下后中了特殊玩法,左侧选项菜单不会折叠!") self.assertEqual(main_menu, False, "横屏点击旋转按钮,等待滚轴停下后中了特殊玩法,左侧选项菜单会恢复可点击状态!") self.assertEqual(banner, "滑动转轴或按旋转", "横屏点击旋转按钮,等待滚轴停下后中了特殊玩法,下导航栏的提示文字错误!") except AssertionError: self.daf.get_screenshot(self.browser) raise else: start_btn_status = self.common.start_btn_status() setting_btn = self.common.setting_btn_visible() auto_game_btn = self.common.auto_game_btn_visible() main_menu_expand = self.common.main_menu_expand() main_menu = self.common.main_menu_touchable() banner = self.common.info_bar_view_banner_tips_label() locale.setlocale(locale.LC_ALL, "") coin = "奖金 ¥" + locale.format("%.2f", coin / 100, 1) try: self.assertEqual(start_btn_status, "stopped", "横屏点击旋转按钮,等待滚轴停下后中了特殊玩法,停止按钮不会恢复成旋转按钮!") self.assertEqual(setting_btn, False, "横屏点击旋转按钮,等待滚轴停下后中了特殊玩法,线数线注设置按钮会恢复显示!") self.assertEqual(auto_game_btn, False, "横屏点击旋转按钮,等待滚轴停下后中了特殊玩法,自动游戏按钮会恢复显示!") self.assertEqual(main_menu_expand, "retractL", "横屏点击旋转按钮,等待滚轴停下后中了特殊玩法,左侧选项菜单不会折叠!") self.assertEqual(main_menu, False, "横屏点击旋转按钮,等待滚轴停下后中了特殊玩法,左侧选项菜单会恢复可点击状态!") self.assertEqual(banner, coin, "横屏点击旋转按钮,等待滚轴停下后中了特殊玩法,下导航栏的提示文字错误!") except AssertionError: self.daf.get_screenshot(self.browser) raise def test_stop_btn_click(self): """ 横屏旋转过程点击停止按钮 """ self.common.loading_pass() sleep(1) self.common.start_btn_click() self.common.wait_for_rolling(15) sleep(0.5) self.common.start_btn_click() sleep(0.5) rolling = self.common.slot_machine_rolling() try: self.assertEqual(rolling, False, "横屏旋转过程,点击停止按钮,滚轴没有立刻停下!") except AssertionError: self.daf.get_screenshot(self.browser) raise self.common.wait_for_rolling_stop(15) game_status = self.common.get_game_current_status() coin = self.common.total_win() if game_status is None: if coin == 0: start_btn_status = self.common.start_btn_status() setting_btn = self.common.setting_btn_visible() auto_game_btn = self.common.auto_game_btn_visible() main_menu_expand = self.common.main_menu_expand() main_menu = self.common.main_menu_touchable() banner = self.common.info_bar_view_banner_tips_label() try: self.assertEqual(start_btn_status, "stopped", "横屏旋转过程,点击停止按钮,停止按钮不会恢复成旋转按钮!") self.assertEqual(setting_btn, True, "横屏旋转过程,点击停止按钮,线数线注设置按钮不会恢复显示!") self.assertEqual(auto_game_btn, True, "横屏旋转过程,点击停止按钮,自动游戏按钮不会恢复显示!") self.assertEqual(main_menu_expand, "retractL", "横屏旋转过程,点击停止按钮,左侧选项菜单不会折叠!") self.assertEqual(main_menu, True, "横屏旋转过程,点击停止按钮,左侧选项菜单不会恢复可点击状态!") self.assertEqual(banner, "滑动转轴或按旋转", "横屏旋转过程,点击停止按钮,下导航栏的提示文字错误!") except AssertionError: self.daf.get_screenshot(self.browser) raise else: start_btn_status = self.common.start_btn_status() setting_btn = self.common.setting_btn_visible() auto_game_btn = self.common.auto_game_btn_visible() main_menu_expand = self.common.main_menu_expand() main_menu = self.common.main_menu_touchable() banner = self.common.info_bar_view_banner_tips_label() locale.setlocale(locale.LC_ALL, "") coin = "奖金 ¥" + locale.format("%.2f", coin / 100, 1) try: self.assertEqual(start_btn_status, "stopped", "横屏旋转过程,点击停止按钮,停止按钮不会恢复成旋转按钮!") self.assertEqual(setting_btn, True, "横屏旋转过程,点击停止按钮,线数线注设置按钮不会恢复显示!") self.assertEqual(auto_game_btn, True, "横屏旋转过程,点击停止按钮,自动游戏按钮不会恢复显示!") self.assertEqual(main_menu_expand, "retractL", "横屏旋转过程,点击停止按钮,左侧选项菜单不会折叠!") self.assertEqual(main_menu, True, "横屏旋转过程,点击停止按钮,左侧选项菜单不会恢复可点击状态!") self.assertEqual(banner, coin, "横屏旋转过程,点击停止按钮,下导航栏的提示文字错误!") except AssertionError: self.daf.get_screenshot(self.browser) raise else: if coin == 0: start_btn_status = self.common.start_btn_status() setting_btn = self.common.setting_btn_visible() auto_game_btn = self.common.auto_game_btn_visible() main_menu_expand = self.common.main_menu_expand() main_menu = self.common.main_menu_touchable() banner = self.common.info_bar_view_banner_tips_label() try: self.assertEqual(start_btn_status, "stopped", "横屏旋转过程,点击停止按钮后中了特殊玩法,停止按钮不会恢复成旋转按钮!") self.assertEqual(setting_btn, False, "横屏旋转过程,点击停止按钮后中了特殊玩法,线数线注设置按钮会恢复显示!") self.assertEqual(auto_game_btn, False, "横屏旋转过程,点击停止按钮后中了特殊玩法,自动游戏按钮会恢复显示!") self.assertEqual(main_menu_expand, "retractL", "横屏旋转过程,点击停止按钮后中了特殊玩法,左侧选项菜单不会折叠!") self.assertEqual(main_menu, False, "横屏旋转过程,点击停止按钮后中了特殊玩法,左侧选项菜单会恢复可点击状态!") self.assertEqual(banner, "滑动转轴或按旋转", "横屏旋转过程,点击停止按钮后中了特殊玩法,下导航栏的提示文字错误!") except AssertionError: self.daf.get_screenshot(self.browser) raise else: start_btn_status = self.common.start_btn_status() setting_btn = self.common.setting_btn_visible() auto_game_btn = self.common.auto_game_btn_visible() main_menu_expand = self.common.main_menu_expand() main_menu = self.common.main_menu_touchable() banner = self.common.info_bar_view_banner_tips_label() locale.setlocale(locale.LC_ALL, "") coin = "奖金 ¥" + locale.format("%.2f", coin / 100, 1) try: self.assertEqual(start_btn_status, "stopped", "横屏旋转过程,点击停止按钮后中了特殊玩法,停止按钮不会恢复成旋转按钮!") self.assertEqual(setting_btn, False, "横屏旋转过程,点击停止按钮后中了特殊玩法,线数线注设置按钮会恢复显示!") self.assertEqual(auto_game_btn, False, "横屏旋转过程,点击停止按钮后了特殊玩法,自动游戏按钮会恢复显示!") self.assertEqual(main_menu_expand, "retractL", "横屏旋转过程,点击停止按钮后了特殊玩法,左侧选项菜单不会折叠!") self.assertEqual(main_menu, False, "横屏旋转过程,点击停止按钮后中了特殊玩法,左侧选项菜单会恢复可点击状态!") self.assertEqual(banner, coin, "横屏旋转过程,点击停止按钮后中了特殊玩法,下导航栏的提示文字错误!") except AssertionError: self.daf.get_screenshot(self.browser) raise # # # ------------------------------------------------------------------------ 竖屏模式 ------------------------------------------------------------------------ # # def test_spin_btn_portrait(self): """ 竖屏旋转按钮默认显示 """ self.common.portrait() self.common.loading_pass() sleep(3) visible = self.common.start_btn_visible() touchable = self.common.start_btn_touchable() status = self.common.start_btn_status() rolling = self.common.slot_machine_rolling() banner = self.common.info_bar_view_banner_tips_label() try: self.assertEqual(visible, True, "竖屏进入游戏,旋转按钮默认不会显示!") self.assertEqual(touchable, True, "竖屏进入游戏,旋转按钮默认不可点击!") self.assertEqual(status, "stopped", "竖屏进入游戏,旋转按钮默认显示停止按钮!") self.assertEqual(rolling, False, "竖屏进入游戏,滚轴默认处于滚动状态!") self.assertEqual(banner, "滑动转轴或按旋转", "横屏进入游戏,下导航栏默认的提示文字错误!") except AssertionError: self.daf.get_screenshot(self.browser) raise def test_start_btn_click_portrait(self): """ 竖屏点击旋转按钮 """ self.common.portrait() self.common.loading_pass() sleep(1) self.common.start_btn_click() self.common.wait_for_rolling(15) slot_rolling = self.common.slot_machine_rolling() start_btn_status = self.common.start_btn_status() setting_btn = self.common.setting_btn_visible() auto_game_btn = self.common.auto_game_btn_visible() main_menu_expand = self.common.main_menu_expand() main_menu = self.common.main_menu_touchable() try: self.assertEqual(slot_rolling, True, "竖屏点击旋转按钮,滚轴不会滚动!") self.assertEqual(start_btn_status, "playing", "竖屏点击旋转按钮,旋转按钮不会变成停止按钮!") self.assertEqual(setting_btn, False, "竖屏点击旋转按钮,线数线注设置按钮不会消失!") self.assertEqual(auto_game_btn, False, "竖屏点击旋转按钮,自动游戏按钮不会消失!") self.assertEqual(main_menu_expand, "retractP", "竖屏点击旋转按钮,左侧选项菜单不会折叠!") self.assertEqual(main_menu, False, "竖屏点击旋转按钮,左侧选项菜单可以点击!") except AssertionError: self.daf.get_screenshot(self.browser) raise self.common.wait_for_rolling_stop(15) game_status = self.common.get_game_current_status() coin = self.common.total_win() if game_status is None: if coin == 0: start_btn_status = self.common.start_btn_status() setting_btn = self.common.setting_btn_visible() auto_game_btn = self.common.auto_game_btn_visible() main_menu_expand = self.common.main_menu_expand() main_menu = self.common.main_menu_touchable() banner = self.common.info_bar_view_banner_tips_label() try: self.assertEqual(start_btn_status, "stopped", "竖屏点击旋转按钮,等待滚轴停下后,停止按钮不会恢复成旋转按钮!") self.assertEqual(setting_btn, True, "竖屏点击旋转按钮,等待滚轴停下后,线数线注设置按钮不会恢复显示!") self.assertEqual(auto_game_btn, True, "竖屏点击旋转按钮,等待滚轴停下后,自动游戏按钮不会恢复显示!") self.assertEqual(main_menu_expand, "retractP", "竖屏点击旋转按钮,等待滚轴停下后,左侧选项菜单不会折叠!") self.assertEqual(main_menu, True, "竖屏点击旋转按钮,等待滚轴停下后,左侧选项菜单不会恢复可点击状态!") self.assertEqual(banner, "滑动转轴或按旋转", "竖屏点击旋转按钮,等待滚轴停下后,下导航栏的提示文字错误!") except AssertionError: self.daf.get_screenshot(self.browser) raise else: start_btn_status = self.common.start_btn_status() setting_btn = self.common.setting_btn_visible() auto_game_btn = self.common.auto_game_btn_visible() main_menu_expand = self.common.main_menu_expand() main_menu = self.common.main_menu_touchable() banner = self.common.info_bar_view_banner_tips_label() locale.setlocale(locale.LC_ALL, "") coin = "奖金 ¥" + locale.format("%.2f", coin / 100, 1) try: self.assertEqual(start_btn_status, "stopped", "竖屏点击旋转按钮,等待滚轴停下后,停止按钮不会恢复成旋转按钮!") self.assertEqual(setting_btn, True, "竖屏点击旋转按钮,等待滚轴停下后,线数线注设置按钮不会恢复显示!") self.assertEqual(auto_game_btn, True, "竖屏点击旋转按钮,等待滚轴停下后,自动游戏按钮不会恢复显示!") self.assertEqual(main_menu_expand, "retractP", "竖屏点击旋转按钮,等待滚轴停下后,左侧选项菜单不会折叠!") self.assertEqual(main_menu, True, "竖屏点击旋转按钮,等待滚轴停下后,左侧选项菜单不会恢复可点击状态!") self.assertEqual(banner, coin, "竖屏点击旋转按钮,等待滚轴停下后,下导航栏的提示文字错误!") except AssertionError: self.daf.get_screenshot(self.browser) raise else: if coin == 0: start_btn_status = self.common.start_btn_status() setting_btn = self.common.setting_btn_visible() auto_game_btn = self.common.auto_game_btn_visible() main_menu_expand = self.common.main_menu_expand() main_menu = self.common.main_menu_touchable() banner = self.common.info_bar_view_banner_tips_label() try: self.assertEqual(start_btn_status, "stopped", "竖屏点击旋转按钮,等待滚轴停下后中了特殊玩法,停止按钮不会恢复成旋转按钮!") self.assertEqual(setting_btn, False, "竖屏点击旋转按钮,等待滚轴停下后中了特殊玩法,线数线注设置按钮会恢复显示!") self.assertEqual(auto_game_btn, False, "竖屏点击旋转按钮,等待滚轴停下后中了特殊玩法,自动游戏按钮会恢复显示!") self.assertEqual(main_menu_expand, "retractP", "竖屏点击旋转按钮,等待滚轴停下后中了特殊玩法,左侧选项菜单不会折叠!") self.assertEqual(main_menu, False, "竖屏点击旋转按钮,等待滚轴停下后中了特殊玩法,左侧选项菜单会恢复可点击状态!") self.assertEqual(banner, "滑动转轴或按旋转", "竖屏点击旋转按钮,等待滚轴停下后中了特殊玩法,下导航栏的提示文字错误!") except AssertionError: self.daf.get_screenshot(self.browser) raise else: start_btn_status = self.common.start_btn_status() setting_btn = self.common.setting_btn_visible() auto_game_btn = self.common.auto_game_btn_visible() main_menu_expand = self.common.main_menu_expand() main_menu = self.common.main_menu_touchable() banner = self.common.info_bar_view_banner_tips_label() locale.setlocale(locale.LC_ALL, "") coin = "奖金 ¥" + locale.format("%.2f", coin / 100, 1) try: self.assertEqual(start_btn_status, "stopped", "竖屏点击旋转按钮,等待滚轴停下后中了特殊玩法,停止按钮不会恢复成旋转按钮!") self.assertEqual(setting_btn, False, "竖屏点击旋转按钮,等待滚轴停下后中了特殊玩法,线数线注设置按钮会恢复显示!") self.assertEqual(auto_game_btn, False, "竖屏点击旋转按钮,等待滚轴停下后中了特殊玩法,自动游戏按钮会恢复显示!") self.assertEqual(main_menu_expand, "retractP", "竖屏点击旋转按钮,等待滚轴停下后中了特殊玩法,左侧选项菜单不会折叠!") self.assertEqual(main_menu, False, "竖屏点击旋转按钮,等待滚轴停下后中了特殊玩法,左侧选项菜单会恢复可点击状态!") self.assertEqual(banner, coin, "竖屏点击旋转按钮,等待滚轴停下后中了特殊玩法,下导航栏的提示文字错误!") except AssertionError: self.daf.get_screenshot(self.browser) raise def test_stop_btn_click_portrait(self): """ 竖屏旋转过程点击停止按钮 """ self.common.portrait() self.common.loading_pass() sleep(1) self.common.start_btn_click() self.common.wait_for_rolling(15) sleep(0.5) self.common.start_btn_click() sleep(0.5) rolling = self.common.slot_machine_rolling() try: self.assertEqual(rolling, False, "竖屏旋转过程,点击停止按钮,滚轴没有立刻停下!") except AssertionError: self.daf.get_screenshot(self.browser) raise self.common.wait_for_rolling_stop(15) game_status = self.common.get_game_current_status() coin = self.common.total_win() if game_status is None: if coin == 0: start_btn_status = self.common.start_btn_status() setting_btn = self.common.setting_btn_visible() auto_game_btn = self.common.auto_game_btn_visible() main_menu_expand = self.common.main_menu_expand() main_menu = self.common.main_menu_touchable() banner = self.common.info_bar_view_banner_tips_label() try: self.assertEqual(start_btn_status, "stopped", "竖屏点击旋转按钮,点击停止按钮,停止按钮不会恢复成旋转按钮!") self.assertEqual(setting_btn, True, "竖屏点击旋转按钮,点击停止按钮,线数线注设置按钮不会恢复显示!") self.assertEqual(auto_game_btn, True, "竖屏点击旋转按钮,点击停止按钮,自动游戏按钮不会恢复显示!") self.assertEqual(main_menu_expand, "retractP", "竖屏点击旋转按钮,点击停止按钮,左侧选项菜单不会折叠!") self.assertEqual(main_menu, True, "竖屏点击旋转按钮,点击停止按钮,左侧选项菜单不会恢复可点击状态!") self.assertEqual(banner, "滑动转轴或按旋转", "竖屏点击旋转按钮,点击停止按钮,下导航栏的提示文字错误!") except AssertionError: self.daf.get_screenshot(self.browser) raise else: start_btn_status = self.common.start_btn_status() setting_btn = self.common.setting_btn_visible() auto_game_btn = self.common.auto_game_btn_visible() main_menu_expand = self.common.main_menu_expand() main_menu = self.common.main_menu_touchable() banner = self.common.info_bar_view_banner_tips_label() locale.setlocale(locale.LC_ALL, "") coin = "奖金 ¥" + locale.format("%.2f", coin / 100, 1) try: self.assertEqual(start_btn_status, "stopped", "竖屏点击旋转按钮,点击停止按钮,停止按钮不会恢复成旋转按钮!") self.assertEqual(setting_btn, True, "竖屏点击旋转按钮,点击停止按钮,线数线注设置按钮不会恢复显示!") self.assertEqual(auto_game_btn, True, "竖屏点击旋转按钮,点击停止按钮,自动游戏按钮不会恢复显示!") self.assertEqual(main_menu_expand, "retractP", "竖屏点击旋转按钮,点击停止按钮,左侧选项菜单不会折叠!") self.assertEqual(main_menu, True, "竖屏点击旋转按钮,点击停止按钮,左侧选项菜单不会恢复可点击状态!") self.assertEqual(banner, coin, "竖屏点击旋转按钮,点击停止按钮,下导航栏的提示文字错误!") except AssertionError: self.daf.get_screenshot(self.browser) raise else: if coin == 0: start_btn_status = self.common.start_btn_status() setting_btn = self.common.setting_btn_visible() auto_game_btn = self.common.auto_game_btn_visible() main_menu_expand = self.common.main_menu_expand() main_menu = self.common.main_menu_touchable() banner = self.common.info_bar_view_banner_tips_label() try: self.assertEqual(start_btn_status, "stopped", "竖屏点击旋转按钮,点击停止按钮后中了特殊玩法,停止按钮不会恢复成旋转按钮!") self.assertEqual(setting_btn, False, "竖屏点击旋转按钮,点击停止按钮后中了特殊玩法,线数线注设置按钮会恢复显示!") self.assertEqual(auto_game_btn, False, "竖屏点击旋转按钮,点击停止按钮后中了特殊玩法,自动游戏按钮会恢复显示!") self.assertEqual(main_menu_expand, "retractP", "竖屏点击旋转按钮,点击停止按钮后中了特殊玩法,左侧选项菜单不会折叠!") self.assertEqual(main_menu, False, "竖屏点击旋转按钮,点击停止按钮后中了特殊玩法,左侧选项菜单会恢复可点击状态!") self.assertEqual(banner, "滑动转轴或按旋转", "竖屏点击旋转按钮,点击停止按钮后中了特殊玩法,下导航栏的提示文字错误!") except AssertionError: self.daf.get_screenshot(self.browser) raise else: start_btn_status = self.common.start_btn_status() setting_btn = self.common.setting_btn_visible() auto_game_btn = self.common.auto_game_btn_visible() main_menu_expand = self.common.main_menu_expand() main_menu = self.common.main_menu_touchable() banner = self.common.info_bar_view_banner_tips_label() locale.setlocale(locale.LC_ALL, "") coin = "奖金 ¥" + locale.format("%.2f", coin / 100, 1) try: self.assertEqual(start_btn_status, "stopped", "竖屏点击旋转按钮,点击停止按钮后中了特殊玩法,停止按钮不会恢复成旋转按钮!") self.assertEqual(setting_btn, False, "竖屏点击旋转按钮,点击停止按钮后中了特殊玩法,线数线注设置按钮会恢复显示!") self.assertEqual(auto_game_btn, False, "竖屏点击旋转按钮,点击停止按钮后中了特殊玩法,自动游戏按钮会恢复显示!") self.assertEqual(main_menu_expand, "retractP", "竖屏点击旋转按钮,点击停止按钮后中了特殊玩法,左侧选项菜单不会折叠!") self.assertEqual(main_menu, False, "竖屏点击旋转按钮,点击停止按钮后中了特殊玩法,左侧选项菜单会恢复可点击状态!") self.assertEqual(banner, coin, "竖屏点击旋转按钮,点击停止按钮后中了特殊玩法,下导航栏的提示文字错误!") except AssertionError: self.daf.get_screenshot(self.browser) raise # # # ------------------------------------------------------------------------ 横竖屏模式 ------------------------------------------------------------------------ # # def test_start_btn_click_switch_screen(self): """ 横竖屏点击旋转按钮 """ self.common.portrait() self.common.loading_pass() sleep(1) self.common.start_btn_click() sleep(0.5) self.common.landscape() sleep(0.5) self.common.wait_for_rolling(15) slot_rolling = self.common.slot_machine_rolling() start_btn_status = self.common.start_btn_status() setting_btn = self.common.setting_btn_visible() auto_game_btn = self.common.auto_game_btn_visible() main_menu_expand = self.common.main_menu_expand() main_menu = self.common.main_menu_touchable() try: self.assertEqual(slot_rolling, True, "横屏点击旋转按钮,滚轴不会滚动!") self.assertEqual(start_btn_status, "playing", "横屏点击旋转按钮,旋转按钮不会变成停止按钮!") self.assertEqual(setting_btn, False, "横屏点击旋转按钮,线数线注设置按钮不会消失!") self.assertEqual(auto_game_btn, False, "横屏点击旋转按钮,自动游戏按钮不会消失!") self.assertEqual(main_menu_expand, "retractL", "横屏点击旋转按钮,左侧选项菜单不会折叠!") self.assertEqual(main_menu, False, "横屏点击旋转按钮,左侧选项菜单可以点击!") except AssertionError: self.daf.get_screenshot(self.browser) raise self.common.wait_for_rolling_stop(15) self.common.portrait() sleep(0.5) game_status = self.common.get_game_current_status() coin = self.common.total_win() if game_status is None: if coin == 0: start_btn_status = self.common.start_btn_status() setting_btn = self.common.setting_btn_visible() auto_game_btn = self.common.auto_game_btn_visible() main_menu_expand = self.common.main_menu_expand() main_menu = self.common.main_menu_touchable() banner = self.common.info_bar_view_banner_tips_label() try: self.assertEqual(start_btn_status, "stopped", "点击旋转按钮,切换横竖屏,等待滚轴停下后,停止按钮不会恢复成旋转按钮!") self.assertEqual(setting_btn, True, "点击旋转按钮,切换横竖屏,等待滚轴停下后,线数线注设置按钮不会恢复显示!") self.assertEqual(auto_game_btn, True, "点击旋转按钮,切换横竖屏,等待滚轴停下后,自动游戏按钮不会恢复显示!") self.assertEqual(main_menu_expand, "retractP", "点击旋转按钮,切换横竖屏,等待滚轴停下后,左侧选项菜单不会折叠!") self.assertEqual(main_menu, True, "点击旋转按钮,切换横竖屏,等待滚轴停下后,左侧选项菜单不会恢复可点击状态!") self.assertEqual(banner, "滑动转轴或按旋转", "点击旋转按钮,切换横竖屏,等待滚轴停下后,下导航栏的提示文字错误!") except AssertionError: self.daf.get_screenshot(self.browser) raise else: start_btn_status = self.common.start_btn_status() setting_btn = self.common.setting_btn_visible() auto_game_btn = self.common.auto_game_btn_visible() main_menu_expand = self.common.main_menu_expand() main_menu = self.common.main_menu_touchable() banner = self.common.info_bar_view_banner_tips_label() locale.setlocale(locale.LC_ALL, "") coin = "奖金 ¥" + locale.format("%.2f", coin / 100, 1) try: self.assertEqual(start_btn_status, "stopped", "点击旋转按钮,切换横竖屏,等待滚轴停下后,停止按钮不会恢复成旋转按钮!") self.assertEqual(setting_btn, True, "点击旋转按钮,切换横竖屏,等待滚轴停下后,线数线注设置按钮不会恢复显示!") self.assertEqual(auto_game_btn, True, "点击旋转按钮,切换横竖屏,等待滚轴停下后,自动游戏按钮不会恢复显示!") self.assertEqual(main_menu_expand, "retractP", "点击旋转按钮,切换横竖屏,等待滚轴停下后,左侧选项菜单不会折叠!") self.assertEqual(main_menu, True, "点击旋转按钮,切换横竖屏,等待滚轴停下后,左侧选项菜单不会恢复可点击状态!") self.assertEqual(banner, coin, "点击旋转按钮,切换横竖屏,等待滚轴停下后,下导航栏的提示文字错误!") except AssertionError: self.daf.get_screenshot(self.browser) raise else: if coin == 0: start_btn_status = self.common.start_btn_status() setting_btn = self.common.setting_btn_visible() auto_game_btn = self.common.auto_game_btn_visible() main_menu_expand = self.common.main_menu_expand() main_menu = self.common.main_menu_touchable() banner = self.common.info_bar_view_banner_tips_label() try: self.assertEqual( start_btn_status, "stopped", "点击旋转按钮,切换横竖屏,等待滚轴停下后中了特殊玩法,停止按钮不会恢复成旋转按钮!") self.assertEqual( setting_btn, False, "点击旋转按钮,切换横竖屏,等待滚轴停下后中了特殊玩法,线数线注设置按钮会恢复显示!") self.assertEqual( auto_game_btn, False, "点击旋转按钮,切换横竖屏,等待滚轴停下后中了特殊玩法,自动游戏按钮会恢复显示!") self.assertEqual(main_menu_expand, "retractP", "点击旋转按钮,切换横竖屏,等待滚轴停下后中了特殊玩法,左侧选项菜单不会折叠!") self.assertEqual( main_menu, False, "点击旋转按钮,切换横竖屏,等待滚轴停下后中了特殊玩法,左侧选项菜单会恢复可点击状态!") self.assertEqual( banner, "滑动转轴或按旋转", "点击旋转按钮,切换横竖屏,等待滚轴停下后中了特殊玩法,下导航栏的提示文字错误!") except AssertionError: self.daf.get_screenshot(self.browser) raise else: start_btn_status = self.common.start_btn_status() setting_btn = self.common.setting_btn_visible() auto_game_btn = self.common.auto_game_btn_visible() main_menu_expand = self.common.main_menu_expand() main_menu = self.common.main_menu_touchable() banner = self.common.info_bar_view_banner_tips_label() locale.setlocale(locale.LC_ALL, "") coin = "奖金 ¥" + locale.format("%.2f", coin / 100, 1) try: self.assertEqual( start_btn_status, "stopped", "点击旋转按钮,切换横竖屏,等待滚轴停下后中了特殊玩法,停止按钮不会恢复成旋转按钮!") self.assertEqual( setting_btn, False, "点击旋转按钮,切换横竖屏,等待滚轴停下后中了特殊玩法,线数线注设置按钮会恢复显示!") self.assertEqual( auto_game_btn, False, "点击旋转按钮,切换横竖屏,等待滚轴停下后中了特殊玩法,自动游戏按钮会恢复显示!") self.assertEqual(main_menu_expand, "retractP", "点击旋转按钮,切换横竖屏,等待滚轴停下后中了特殊玩法,左侧选项菜单不会折叠!") self.assertEqual( main_menu, False, "点击旋转按钮,切换横竖屏,等待滚轴停下后中了特殊玩法,左侧选项菜单会恢复可点击状态!") self.assertEqual( banner, coin, "点击旋转按钮,切换横竖屏,等待滚轴停下后中了特殊玩法,下导航栏的提示文字错误!") except AssertionError: self.daf.get_screenshot(self.browser) raise def test_stop_btn_click_switch_screen(self): """ 横竖屏旋转过程点击停止按钮 """ self.common.portrait() self.common.loading_pass() sleep(1) self.common.start_btn_click() self.common.wait_for_rolling(15) sleep(0.5) self.common.landscape() sleep(0.5) self.common.start_btn_click() sleep(0.5) self.common.portrait() sleep(0.5) rolling = self.common.slot_machine_rolling() try: self.assertEqual(rolling, False, "旋转过程,点击停止按钮,横竖屏切换,滚轴没有立刻停下!") except AssertionError: self.daf.get_screenshot(self.browser) raise self.common.wait_for_rolling_stop(15) game_status = self.common.get_game_current_status() coin = self.common.total_win() if game_status is None: if coin == 0: start_btn_status = self.common.start_btn_status() setting_btn = self.common.setting_btn_visible() auto_game_btn = self.common.auto_game_btn_visible() main_menu_expand = self.common.main_menu_expand() main_menu = self.common.main_menu_touchable() banner = self.common.info_bar_view_banner_tips_label() try: self.assertEqual(start_btn_status, "stopped", "旋转过程,点击停止按钮,横竖屏切换,停止按钮不会恢复成旋转按钮!") self.assertEqual(setting_btn, True, "旋转过程,点击停止按钮,横竖屏切换,线数线注设置按钮不会恢复显示!") self.assertEqual(auto_game_btn, True, "旋转过程,点击停止按钮,横竖屏切换,自动游戏按钮不会恢复显示!") self.assertEqual(main_menu_expand, "retractP", "旋转过程,点击停止按钮,横竖屏切换,左侧选项菜单不会折叠!") self.assertEqual(main_menu, True, "旋转过程,点击停止按钮,横竖屏切换,左侧选项菜单不会恢复可点击状态!") self.assertEqual(banner, "滑动转轴或按旋转", "旋转过程,点击停止按钮,横竖屏切换,下导航栏默认的提示文字错误!") except AssertionError: self.daf.get_screenshot(self.browser) raise else: start_btn_status = self.common.start_btn_status() setting_btn = self.common.setting_btn_visible() auto_game_btn = self.common.auto_game_btn_visible() main_menu_expand = self.common.main_menu_expand() main_menu = self.common.main_menu_touchable() banner = self.common.info_bar_view_banner_tips_label() locale.setlocale(locale.LC_ALL, "") coin = "奖金 ¥" + locale.format("%.2f", coin / 100, 1) try: self.assertEqual(start_btn_status, "stopped", "旋转过程,点击停止按钮,横竖屏切换,停止按钮不会恢复成旋转按钮!") self.assertEqual(setting_btn, True, "旋转过程,点击停止按钮,横竖屏切换,线数线注设置按钮不会恢复显示!") self.assertEqual(auto_game_btn, True, "旋转过程,点击停止按钮,横竖屏切换,自动游戏按钮不会恢复显示!") self.assertEqual(main_menu_expand, "retractP", "旋转过程,点击停止按钮,横竖屏切换,左侧选项菜单不会折叠!") self.assertEqual(main_menu, True, "旋转过程,点击停止按钮,横竖屏切换,左侧选项菜单不会恢复可点击状态!") self.assertEqual(banner, coin, "旋转过程,点击停止按钮,横竖屏切换,下导航栏提示文字错误!") except AssertionError: self.daf.get_screenshot(self.browser) raise else: if coin == 0: start_btn_status = self.common.start_btn_status() setting_btn = self.common.setting_btn_visible() auto_game_btn = self.common.auto_game_btn_visible() main_menu_expand = self.common.main_menu_expand() main_menu = self.common.main_menu_touchable() banner = self.common.info_bar_view_banner_tips_label() try: self.assertEqual( start_btn_status, "stopped", "旋转过程,点击停止按钮后中了特殊玩法,横竖屏切换,停止按钮不会恢复成旋转按钮!") self.assertEqual( setting_btn, False, "旋转过程,点击停止按钮后中了特殊玩法,横竖屏切换,线数线注设置按钮会恢复显示!") self.assertEqual(auto_game_btn, False, "旋转过程,点击停止按钮后中了特殊玩法,横竖屏切换,自动游戏按钮会恢复显示!") self.assertEqual(main_menu_expand, "retractP", "旋转过程,点击停止按钮后中了特殊玩法,横竖屏切换,左侧选项菜单不会折叠!") self.assertEqual( main_menu, False, "旋转过程,点击停止按钮,横竖屏切换后中了特殊玩法,左侧选项菜单会恢复可点击状态!") self.assertEqual( banner, "滑动转轴或按旋转", "旋转过程,点击停止按钮后中了特殊玩法,横竖屏切换,下导航栏默认的提示文字错误!") except AssertionError: self.daf.get_screenshot(self.browser) raise else: start_btn_status = self.common.start_btn_status() setting_btn = self.common.setting_btn_visible() auto_game_btn = self.common.auto_game_btn_visible() main_menu_expand = self.common.main_menu_expand() main_menu = self.common.main_menu_touchable() banner = self.common.info_bar_view_banner_tips_label() locale.setlocale(locale.LC_ALL, "") coin = "奖金 ¥" + locale.format("%.2f", coin / 100, 1) try: self.assertEqual( start_btn_status, "stopped", "旋转过程,点击停止按钮后中了特殊玩法,横竖屏切换,停止按钮不会恢复成旋转按钮!") self.assertEqual( setting_btn, False, "旋转过程,点击停止按钮后中了特殊玩法,横竖屏切换,线数线注设置按钮会恢复显示!") self.assertEqual(auto_game_btn, False, "旋转过程,点击停止按钮后中了特殊玩法,横竖屏切换,自动游戏按钮会恢复显示!") self.assertEqual(main_menu_expand, "retractP", "旋转过程,点击停止按钮后中了特殊玩法,横竖屏切换,左侧选项菜单不会折叠!") self.assertEqual( main_menu, False, "旋转过程,点击停止按钮后中了特殊玩法,横竖屏切换,左侧选项菜单会恢复可点击状态!") self.assertEqual(banner, coin, "旋转过程,点击停止按钮后中了特殊玩法,横竖屏切换,下导航栏提示文字错误!") except AssertionError: self.daf.get_screenshot(self.browser) raise