Skip to content

Instantly share code, notes, and snippets.

@cuongld2
Created March 24, 2020 04:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cuongld2/dbd1662131a7746fad1c0a9da51ed75a to your computer and use it in GitHub Desktop.
Save cuongld2/dbd1662131a7746fad1c0a9da51ed75a to your computer and use it in GitHub Desktop.
Set coccoc mojichat after install cococc
class TestBrowser:
def test_debug_1(self):
from testscripts.smoketest.common import uninstall_then_install_coccoc_with_default
uninstall_then_install_coccoc_with_default(is_needed_clear_user_data=True,is_needed_clean_up=True)
def test_debug_2(self, browser):
from utils_automation.const import Urls
browser.get(Urls.COCCOC_FLAGS)
search_bar = browser.find_element_by_id('search')
search_bar.click()
search_bar.send_keys('Moji')
from selenium.webdriver.support.select import Select
select = Select(browser.find_element_by_xpath('//select[@aria-labelledby="enable-mojichat-extension_name"]'))
select.select_by_visible_text('Enabled')
import time
time.sleep(3)
from testscripts.smoketest.common import cleanup
cleanup()
def test_debug_3(self):
import subprocess
subprocess.Popen(["powershell.exe",
"C:\\Users\\cuongld\\AppData\\Local\\CocCoc\\Browser\\Application\\browser.exe",], shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
import time
time.sleep(4)
from testscripts.smoketest.common import cleanup
cleanup()
time.sleep(3)
def test_debug_4(self, browser):
from utils_automation.const import Urls
browser.get(Urls.COCCOC_EXTENSIONS)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment