SHARE
TWEET

Untitled

a guest Sep 19th, 2019 99 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import time
  2. import math
  3. import pytest
  4. import selenium
  5. from selenium import webdriver
  6. from selenium.webdriver.common.by import By
  7. from selenium.webdriver.support.ui import WebDriverWait
  8. from selenium.webdriver.support import expected_conditions as EC
  9. from selenium import webdriver
  10.  
  11. @pytest.fixture(scope="function")
  12. def browser():
  13.     print("\nstart browser for test..")
  14.     browser = webdriver.Chrome()
  15.     yield browser
  16.     print("\nquit browser..")
  17.     browser.quit()
  18.  
  19. @pytest.mark.parametrize('number', ["895", "896", "897", "898", "899", "903", "904", "905"])
  20. def solve(browser, number):
  21.     link = f"https://stepik.org/lesson/23689{number}/step/1"
  22.     browser.get(link)
  23.     field = WebDriverWait(browser, 5).until(
  24.         EC.element_to_be_present((By.CSS_SELECTOR, ".show-plugin .textarea"))
  25.     )
  26.     field.send_keys(str(math.log(int(time.time()))))
  27.  
  28.     button = browser.find_element_by_css_selector(".submit-submission")
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top