# Generated by Selenium IDE
import pytest
import time
import json
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.support import expected_conditions
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities

class TestPythonsearch():
  def setup_method(self, method):
    options = webdriver.ChromeOptions()
    options.add_argument("--no-sandbox")
    self.driver = webdriver.Chrome(options=options)
    self.vars = {}
  
  def teardown_method(self, method):
    self.driver.quit()
  
  def test_pythonsearch(self):
    self.driver.get("https://www.bing.com/")
    self.driver.implicitly_wait(10)
    self.driver.set_window_size(1295, 761)
    self.driver.switch_to_window()
    self.driver.find_element(By.ID, "sb_form_q").send_keys("python")
    self.driver.find_element(By.ID, "sb_form_q").send_keys(Keys.ENTER)
    assert self.driver.find_element(By.LINK_TEXT, "Welcome to Python.org").text == "Welcome to Python.org"
  
